| 314 | } |
| 315 | |
| 316 | func (s *StmtSuite) TestInsertMultipleRows(c *gc.C) { |
| 317 | stmt := table1.Insert(table1Col1, table1Col2) |
| 318 | stmt.Add(Literal(1), Literal(2)) |
| 319 | stmt.Add(Literal(11), Literal(22)) |
| 320 | stmt.Add(Literal(111), Literal(222)) |
| 321 | |
| 322 | sql, err := stmt.String("db") |
| 323 | c.Assert(err, gc.IsNil) |
| 324 | |
| 325 | c.Assert( |
| 326 | sql, |
| 327 | gc.Equals, |
| 328 | "INSERT INTO `db`.`table1` "+ |
| 329 | "(`table1`.`col1`,`table1`.`col2`) "+ |
| 330 | "VALUES (1,2), (11,22), (111,222)") |
| 331 | } |
| 332 | |
| 333 | func (s *StmtSuite) TestOnDuplicateKeyUpdateNilCol(c *gc.C) { |
| 334 | stmt := table1.Insert(table1Col1, table1Col2) |