1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

don't support REPLACE and INSERT ODKU with system_versioning_insert_history

they'll ignore the value of system_versioning_insert_history,
just as DELETE and UPDATE do
This commit is contained in:
Sergei Golubchik
2022-10-18 15:56:28 +02:00
parent 13901dafe1
commit 3b6742a106
3 changed files with 18 additions and 47 deletions

View File

@@ -5579,7 +5579,8 @@ public:
{
DBUG_ASSERT(table->versioned());
return table->versioned(VERS_TIMESTAMP) &&
(variables.option_bits & OPTION_INSERT_HISTORY);
(variables.option_bits & OPTION_INSERT_HISTORY) &&
lex->duplicates == DUP_ERROR;
}
bool vers_insert_history(const Field *field)
@@ -5590,8 +5591,6 @@ public:
return false;
if (lex->sql_command != SQLCOM_INSERT &&
lex->sql_command != SQLCOM_INSERT_SELECT &&
lex->sql_command != SQLCOM_REPLACE &&
lex->sql_command != SQLCOM_REPLACE_SELECT &&
lex->sql_command != SQLCOM_LOAD)
return false;
return !is_set_timestamp_forbidden(this);