{"issue":{"milestone":null,"title":"[FRG-385] INSERT does not trim CHAR values when inserted into VARCHAR columns","created_at":"2011-12-30T03:12:41Z","user":{"login":"dynamobi-build","id":1123017,"url":"https://api.github.com/users/dynamobi-build","avatar_url":"https://secure.gravatar.com/avatar/cb215b3d786be20761071a562a56af64?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cb215b3d786be20761071a562a56af64"},"updated_at":"2011-12-30T03:12:46Z","state":"closed","labels":[{"name":"FRG","url":"https://api.github.com/repos/dynamobi/dynamobi/labels/FRG","color":"1f8f0d"}],"id":2685779,"closed_at":"2011-12-30T03:12:42Z","html_url":"https://github.com/dynamobi/dynamobi/issues/405","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"<b><i>[reporter=\"jhyde\", created=\"Thu, 29 Oct 2009 22:01:33 -0500 (GMT-05:00)\"]</i></b>\nINSERT does not trim CHAR values when inserted into VARCHAR columns. It doesn't show up on a single-row INSERT, but it does show up when there are multiple rows and columns have different lengths, because values are promoted to the CHAR type of the longest value.\n<br/>\n\n<br/>\nFor example, in the following, both values come out with length 4, but one of the values should come out with length 3.\n<br/>\n\n<br/>\n0: jdbc:farrago:> set schema 'sales';\n<br/>\nNo rows affected (4.189 seconds)\n<br/>\n0: jdbc:farrago:> create table foo(i int not null primary key, v varchar(6));\n<br/>\nNo rows affected (1.01 seconds)\n<br/>\n0: jdbc:farrago:> insert into foo values (1, 'red'), (2, 'blue');\n<br/>\n2 rows affected (1.273 seconds)\n<br/>\n0: jdbc:farrago:> select char_length(v) from foo;\n<br/>\n+---------+\n<br/>\n| EXPR$0  |\n<br/>\n+---------+\n<br/>\n| 4       |\n<br/>\n| 4       |\n<br/>\n+---------+\n<br/>\n2 rows selected (1.616 seconds)\n<br/>\n","number":405,"url":"https://api.github.com/repos/dynamobi/dynamobi/issues/405","comments":3,"assignee":null},"comment":{"created_at":"2011-12-30T03:12:46Z","user":{"login":"dynamobi-build","id":1123017,"url":"https://api.github.com/users/dynamobi-build","avatar_url":"https://secure.gravatar.com/avatar/cb215b3d786be20761071a562a56af64?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cb215b3d786be20761071a562a56af64"},"updated_at":"2011-12-30T03:12:46Z","id":3309616,"body":"<b><i>[author=\"jvs\", created=\"Thu, 29 Oct 2009 22:12:53 -0500 (GMT-05:00)\"]</i></b>\nReassigning this for you to close as invalid unless you have comments.\n<br/>\n","url":"https://api.github.com/repos/dynamobi/dynamobi/issues/comments/3309616"},"action":"created"}