diff options
author | unknown <gkodinov/kgeorge@macbook.gmz> | 2006-09-08 10:24:14 +0300 |
---|---|---|
committer | unknown <gkodinov/kgeorge@macbook.gmz> | 2006-09-08 10:24:14 +0300 |
commit | 54caf667ca45de1e81d306177147b53aab03fdff (patch) | |
tree | e893633ca30173920f8516931dde0ccf0c3831ad /sql/item.h | |
parent | b527a75e01b128f9e171e144c7658f8d8c5f0716 (diff) | |
download | mariadb-git-54caf667ca45de1e81d306177147b53aab03fdff.tar.gz |
Bug#21555: incorrect behavior with INSERT ... ON DUPL KEY UPDATE and VALUES
VALUES() was considered a constant. This caused replacing
(or pre-calculating) it using uninitialized values before the actual
execution takes place.
Mark it as a non-constant (still not dependent of tables) to prevent
the pre-calculation.
mysql-test/r/insert_update.result:
Bug#21555: incorrect behavior with INSERT ... ON DUPL KEY UPDATE and VALUES
- test case.
- EXPLAIN output changed due to VALUES() not being considered a constant
anymore
mysql-test/t/insert_update.test:
Bug#21555: incorrect behavior with INSERT ... ON DUPL KEY UPDATE and VALUES
- test case.
sql/item.h:
Bug#21555: incorrect behavior with INSERT ... ON DUPL KEY UPDATE and VALUES
- mark Item_insert_value as non-constant to prevent early calculation.
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/item.h b/sql/item.h index 3eab695cb5e..ad8bea663f1 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1241,7 +1241,11 @@ public: { return Item_field::save_in_field(field_arg, no_conversions); } - table_map used_tables() const { return (table_map)0L; } + /* + We use RAND_TABLE_BIT to prevent Item_insert_value from + being treated as a constant and precalculated before execution + */ + table_map used_tables() const { return RAND_TABLE_BIT; } bool walk(Item_processor processor, byte *args) { |