diff options
author | Sreeharsha Ramanavarapu <sreeharsha.ramanavarapu@oracle.com> | 2017-11-16 09:31:12 +0530 |
---|---|---|
committer | Sreeharsha Ramanavarapu <sreeharsha.ramanavarapu@oracle.com> | 2017-11-16 09:31:12 +0530 |
commit | f06443ce5f9ca8a65b60b595b2095f76d8f65206 (patch) | |
tree | fb32f31b289023df647df574d0f094f8c90cea98 /sql/sql_lex.h | |
parent | 02c12999f9c8621619f61b10deaba36c0df4dbb7 (diff) | |
download | mariadb-git-f06443ce5f9ca8a65b60b595b2095f76d8f65206.tar.gz |
Bug #26881946: INCORRECT BEHAVIOR WITH "VALUES"
Issue:
------
VALUES doesn't have a type() function and is considered a
Item_field.
Solution for 5.7:
-----------------
Add a new type() function for Item_values_insert.
On 8.0 and trunk it was fixed by Mithun's Bug#19601973.
Solution for 5.6:
-----------------
Additionally Bug#17458914 is backported.
This will address the problem of using VALUES() in
INSERT ... ON DUPLICATE KEY UPDATE. Create a field object
only if it is in the UPDATE clause, else return a NULL
item.
This will also address the problems mentioned in
Bug#14789787 and Bug#16756402.
Solution for 5.5:
-----------------
As mentioned above Bug#17458914 is backported.
Additionally Bug#14786324 is also backported.
When VALUES() is detected outside its meaningful place,
it should be treated as NULL and is thus replaced with a
Field_null object, with the same name as the original
field.
Fields with type NULL are generally not handled well inside
the server (e.g Innodb will not accept them and it is
impossible to create them in regular tables). So create a
new const NULL item instead.
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r-- | sql/sql_lex.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 867997feb39..3c950ebe117 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2491,6 +2491,8 @@ struct LEX: public Query_tables_list bool escape_used; bool is_lex_started; /* If lex_start() did run. For debugging. */ + /// Set to true while resolving values in ON DUPLICATE KEY UPDATE clause + bool in_update_value_clause; /* The set of those tables whose fields are referenced in all subqueries |