mirror of
https://github.com/MariaDB/server.git
synced 2025-01-28 17:54:16 +01:00
MDEV-22805 SIGSEGV in check_fields on UPDATE
Additional case for PS protocol: UPDATE is converted to multi-update in mysql_multi_update_prepare().
This commit is contained in:
parent
e451145aa9
commit
27b762e23d
3 changed files with 15 additions and 1 deletions
|
@ -299,6 +299,9 @@ CREATE TABLE t1 (a INT, b DATE, c DATE, PERIOD FOR APPTIME(b, c));
|
|||
INSERT INTO t1 VALUES(1, '1999-01-01', '2018-12-12');
|
||||
UPDATE t1 FOR PORTION OF APPTIME FROM (SELECT '1999-01-01' FROM t1 WHERE a=2) TO '2018-01-01' SET a = 100;
|
||||
ERROR 42000: This version of MariaDB doesn't yet support 'updating and querying the same temporal periods table'
|
||||
set @tmp= "UPDATE t1 FOR PORTION OF APPTIME FROM (SELECT '1999-01-01' FROM t1 WHERE a=2) TO '2018-01-01' SET a = 100";
|
||||
execute immediate @tmp;
|
||||
ERROR 42000: This version of MariaDB doesn't yet support 'updating and querying the same temporal periods table'
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
UPDATE v1 FOR PORTION OF APPTIME FROM (SELECT '1999-01-01' FROM t1 WHERE a=2) TO '2018-01-01' SET a = 100;
|
||||
ERROR 42S02: 'v1' is a view
|
||||
|
|
|
@ -192,8 +192,12 @@ CREATE TABLE t1 (a INT, b DATE, c DATE, PERIOD FOR APPTIME(b, c));
|
|||
INSERT INTO t1 VALUES(1, '1999-01-01', '2018-12-12');
|
||||
|
||||
# Without a patch the following statement crashs a server built in debug mode
|
||||
let $stmt= UPDATE t1 FOR PORTION OF APPTIME FROM (SELECT '1999-01-01' FROM t1 WHERE a=2) TO '2018-01-01' SET a = 100;
|
||||
--error ER_NOT_SUPPORTED_YET
|
||||
UPDATE t1 FOR PORTION OF APPTIME FROM (SELECT '1999-01-01' FROM t1 WHERE a=2) TO '2018-01-01' SET a = 100;
|
||||
eval $stmt;
|
||||
eval set @tmp= "$stmt";
|
||||
--error ER_NOT_SUPPORTED_YET
|
||||
execute immediate @tmp;
|
||||
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
--error ER_IT_IS_A_VIEW
|
||||
|
|
|
@ -190,6 +190,13 @@ static bool check_fields(THD *thd, TABLE_LIST *table, List<Item> &items,
|
|||
my_error(ER_IT_IS_A_VIEW, MYF(0), table->table_name.str);
|
||||
return TRUE;
|
||||
}
|
||||
if (thd->lex->sql_command == SQLCOM_UPDATE_MULTI)
|
||||
{
|
||||
my_error(ER_NOT_SUPPORTED_YET, MYF(0),
|
||||
"updating and querying the same temporal periods table");
|
||||
|
||||
return true;
|
||||
}
|
||||
DBUG_ASSERT(thd->lex->sql_command == SQLCOM_UPDATE);
|
||||
for (List_iterator_fast<Item> it(items); (item=it++);)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue