Rename columns that use reserved SQL words : items.left and items.right

This commit is contained in:
Romain LE DISEZ
2009-07-25 19:06:54 +02:00
parent 0aa3ec3ae9
commit 23bb6eb7e3
11 changed files with 102 additions and 162 deletions

View File

@@ -103,15 +103,15 @@ class Database_Test extends Unit_Test_Case {
$sql = "UPDATE {test_tables} SET `name` = '{test string}' " .
"WHERE `item_id` IN " .
" (SELECT `id` FROM {items} " .
" WHERE `left` >= 1 " .
" AND `right` <= 6)";
" WHERE `left_ptr` >= 1 " .
" AND `right_ptr` <= 6)";
$sql = $db->add_table_prefixes($sql);
$expected = "UPDATE g3test_test_tables SET `name` = '{test string}' " .
"WHERE `item_id` IN " .
" (SELECT `id` FROM g3test_items " .
" WHERE `left` >= 1 " .
" AND `right` <= 6)";
" WHERE `left_ptr` >= 1 " .
" AND `right_ptr` <= 6)";
$this->assert_same($expected, $sql);
}