summaryrefslogtreecommitdiff
path: root/sql/sql_sequence.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2022-07-27 11:02:57 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2022-07-27 11:02:57 +0200
commit3bb36e949534fc4a24d68d4297663ae8b80ba336 (patch)
tree09907f6c2e82d718f261323075ffb33cb350fef7 /sql/sql_sequence.cc
parent9a897335eb4387980aed7698b832a893dbaa3d81 (diff)
parentbd935a41060199a17019453d6e187e8edd7929ba (diff)
downloadmariadb-git-3bb36e949534fc4a24d68d4297663ae8b80ba336.tar.gz
Merge branch '10.3' into 10.4
Diffstat (limited to 'sql/sql_sequence.cc')
-rw-r--r--sql/sql_sequence.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc
index 8488fa67ecb..ce033f45375 100644
--- a/sql/sql_sequence.cc
+++ b/sql/sql_sequence.cc
@@ -709,7 +709,9 @@ longlong SEQUENCE::next_value(TABLE *table, bool second_round, int *error)
{
longlong res_value, org_reserved_until, add_to;
bool out_of_values;
+ THD *thd= table->in_use;
DBUG_ENTER("SEQUENCE::next_value");
+ DBUG_ASSERT(thd);
*error= 0;
if (!second_round)
@@ -774,7 +776,8 @@ longlong SEQUENCE::next_value(TABLE *table, bool second_round, int *error)
DBUG_RETURN(next_value(table, 1, error));
}
- if (unlikely((*error= write(table, 0))))
+ if (unlikely((*error= write(table, thd->variables.binlog_row_image !=
+ BINLOG_ROW_IMAGE_MINIMAL))))
{
reserved_until= org_reserved_until;
next_free_value= res_value;
@@ -841,7 +844,9 @@ int SEQUENCE::set_value(TABLE *table, longlong next_val, ulonglong next_round,
longlong org_reserved_until= reserved_until;
longlong org_next_free_value= next_free_value;
ulonglong org_round= round;
+ THD *thd= table->in_use;
DBUG_ENTER("SEQUENCE::set_value");
+ DBUG_ASSERT(thd);
write_lock(table);
if (is_used)
@@ -880,7 +885,8 @@ int SEQUENCE::set_value(TABLE *table, longlong next_val, ulonglong next_round,
needs_to_be_stored)
{
reserved_until= next_free_value;
- if (write(table, 0))
+ if (write(table,
+ thd->variables.binlog_row_image != BINLOG_ROW_IMAGE_MINIMAL))
{
reserved_until= org_reserved_until;
next_free_value= org_next_free_value;