summaryrefslogtreecommitdiff
path: root/sql/ha_sequence.cc
diff options
context:
space:
mode:
authorYuchen Pei <yuchen.pei@mariadb.com>2023-02-08 12:29:52 +1100
committerYuchen Pei <yuchen.pei@mariadb.com>2023-03-20 17:37:09 +1100
commit725c759a1ad22cf9c11b6a1415d44c5249467c8b (patch)
treed7f80d2363880f844ec4845631b3904ea17e9259 /sql/ha_sequence.cc
parentce4a289f1c367987977f1a02bbb8d8b8e8e6bb53 (diff)
downloadmariadb-git-bb-11.0-mdev-28152-squashed.tar.gz
MDEV-28152 Features for sequencesbb-11.0-mdev-28152-squashed
- Add `as <int_type>` to sequence creation options - int_type can be signed or unsigned integer types, including tinyint, smallint, mediumint, int and bigint - Limitation: when alter sequence as <new_int_type>, cannot have any other alter options in the same statement - Limitation: increment remains signed longlong, and the hidden constraint (cache_size x abs(increment) < longlong_max) stays for unsigned types. This means for bigint unsigned, neither abs(increment) nor (cache_size x abs(increment)) can be between longlong_max and ulonglong_max - Truncating maxvalue and minvalue from user input to the nearest max or min value of the type, plus or minus 1. When the truncation happens, a warning is emitted - Information schema table for sequences
Diffstat (limited to 'sql/ha_sequence.cc')
-rw-r--r--sql/ha_sequence.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/ha_sequence.cc b/sql/ha_sequence.cc
index b348e6e7025..8f511ba3a7f 100644
--- a/sql/ha_sequence.cc
+++ b/sql/ha_sequence.cc
@@ -227,7 +227,7 @@ int ha_sequence::write_row(const uchar *buf)
int error= 0;
/* This is called from alter table */
tmp_seq.read_fields(table);
- if (tmp_seq.check_and_adjust(0))
+ if (tmp_seq.check_and_adjust(thd, 0))
DBUG_RETURN(HA_ERR_SEQUENCE_INVALID_DATA);
sequence->copy(&tmp_seq);
if (likely(!(error= file->write_row(buf))))
@@ -258,7 +258,7 @@ int ha_sequence::write_row(const uchar *buf)
DBUG_RETURN(ER_LOCK_WAIT_TIMEOUT);
tmp_seq.read_fields(table);
- if (tmp_seq.check_and_adjust(0))
+ if (tmp_seq.check_and_adjust(thd, 0))
DBUG_RETURN(HA_ERR_SEQUENCE_INVALID_DATA);
/*