@@ -4305,23 +4305,42 @@ func TestPreparedInsert(t *testing.T, harness Harness) {
43054305 {
43064306 Name : "inserts should trigger string conversion errors" ,
43074307 SetUpScript : []string {
4308- "create table test (v varchar(10))" ,
4308+ "CREATE TABLE test (v1 VARCHAR(10));" ,
4309+ "CREATE TABLE test2 (v1 VARCHAR(10) CHARACTER SET latin1);" ,
43094310 },
43104311 Assertions : []queries.ScriptTestAssertion {
43114312 {
4312- Query : "insert into test values (?)" ,
4313+ Query : "INSERT INTO test VALUES (?); " ,
43134314 Bindings : map [string ]sqlparser.Expr {
43144315 "v1" : mustBuildBindVariable ([]byte {0x99 , 0x98 , 0x97 }),
43154316 },
43164317 ExpectedErrStr : "incorrect string value: '[153 152 151]'" ,
43174318 },
43184319 {
4319- Query : "insert into test values (?)" ,
4320+ Query : "INSERT INTO test VALUES (?); " ,
43204321 Bindings : map [string ]sqlparser.Expr {
43214322 "v1" : mustBuildBindVariable (string ([]byte {0x99 , 0x98 , 0x97 })),
43224323 },
43234324 ExpectedErrStr : "incorrect string value: '[153 152 151]'" ,
43244325 },
4326+ {
4327+ Query : "INSERT INTO test2 VALUES (?);" ,
4328+ Bindings : map [string ]sqlparser.Expr {
4329+ "v1" : mustBuildBindVariable ([]byte {0x99 , 0x98 , 0x97 }),
4330+ },
4331+ Expected : []sql.Row {
4332+ {types.OkResult {RowsAffected : 1 }},
4333+ },
4334+ },
4335+ {
4336+ Query : "INSERT INTO test2 VALUES (?);" ,
4337+ Bindings : map [string ]sqlparser.Expr {
4338+ "v1" : mustBuildBindVariable (string ([]byte {0x99 , 0x98 , 0x97 })),
4339+ },
4340+ Expected : []sql.Row {
4341+ {types.OkResult {RowsAffected : 1 }},
4342+ },
4343+ },
43254344 },
43264345 },
43274346 }
0 commit comments