| 430 | } |
| 431 | |
| 432 | func (s *StmtSuite) TestUpdateMultiValues(c *gc.C) { |
| 433 | stmt := table1.Update() |
| 434 | stmt.Set(table1Col1, Literal(1)) |
| 435 | stmt.Set(table1Col2, Literal(2)) |
| 436 | stmt.Where(EqL(table1Col2, 3)) |
| 437 | sql, err := stmt.String("db") |
| 438 | c.Assert(err, gc.IsNil) |
| 439 | |
| 440 | c.Assert( |
| 441 | sql, |
| 442 | gc.Equals, |
| 443 | "UPDATE `db`.`table1` "+ |
| 444 | "SET `table1`.`col1`=1, `table1`.`col2`=2 "+ |
| 445 | "WHERE `table1`.`col2`=3") |
| 446 | } |
| 447 | |
| 448 | func (s *StmtSuite) TestUpdateWithOrderBy(c *gc.C) { |
| 449 | stmt := table1.Update().Set(table1Col1, Literal(1)) |