| 641 | @testing.variation("include_in_from", [True, False]) |
| 642 | @testing.variation("use_mysql", [True, False]) |
| 643 | def test_unconsumed_names_values_dict(self, include_in_from, use_mysql): |
| 644 | t = table("t", column("x"), column("y")) |
| 645 | t2 = table("t2", column("q"), column("z")) |
| 646 | |
| 647 | stmt = t.update().values(x=5, j=7).values({t2.c.z: 5}) |
| 648 | if include_in_from: |
| 649 | stmt = stmt.where(t.c.x == t2.c.q) |
| 650 | |
| 651 | if use_mysql: |
| 652 | if not include_in_from: |
| 653 | msg = ( |
| 654 | "Statement is not a multi-table UPDATE statement; cannot " |
| 655 | r"include columns from table\(s\) 't2' in SET clause" |
| 656 | ) |
| 657 | else: |
| 658 | msg = "Unconsumed column names: j" |
| 659 | else: |
| 660 | msg = ( |
| 661 | "Backend does not support additional tables in the SET " |
| 662 | r"clause; cannot include columns from table\(s\) 't2' in " |
| 663 | "SET clause" |
| 664 | ) |
| 665 | |
| 666 | with expect_raises_message(exc.CompileError, msg): |
| 667 | if use_mysql: |
| 668 | stmt.compile(dialect=mysql.dialect()) |
| 669 | else: |
| 670 | stmt.compile() |
| 671 | |
| 672 | def test_unconsumed_names_kwargs_w_keys(self): |
| 673 | t = table("t", column("x"), column("y")) |