Set `serial_normalization` to avoid Integer overflow
This commit is contained in:
parent
c9d92347aa
commit
2769fd1b3c
|
@ -863,6 +863,7 @@ SET CLUSTER SETTING jobs.registry.interval.cancel = '180s';
|
|||
SET CLUSTER SETTING jobs.retention_time = '15s';
|
||||
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
|
||||
SET CLUSTER SETTING kv.range_split.by_load_merge_delay = '5s';
|
||||
SET CLUSTER SETTING sql.defaults.serial_normalization = 'sql_sequence_cached';
|
||||
ALTER RANGE default CONFIGURE ZONE USING "gc.ttlseconds" = 600;
|
||||
ALTER DATABASE system CONFIGURE ZONE USING "gc.ttlseconds" = 600;
|
||||
|
||||
|
@ -903,6 +904,7 @@ SET CLUSTER SETTING jobs.registry.interval.cancel = '180s';
|
|||
SET CLUSTER SETTING jobs.retention_time = '15s';
|
||||
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
|
||||
SET CLUSTER SETTING kv.range_split.by_load_merge_delay = '5s';
|
||||
SET CLUSTER SETTING sql.defaults.serial_normalization = 'sql_sequence_cached';
|
||||
ALTER RANGE default CONFIGURE ZONE USING "gc.ttlseconds" = 600;
|
||||
ALTER DATABASE system CONFIGURE ZONE USING "gc.ttlseconds" = 600;
|
||||
SET CLUSTER SETTING sql.defaults.serial_normalization=sql_sequence;
|
||||
|
|
|
@ -29,6 +29,9 @@ public class CockroachDBIdentityColumnSupport extends IdentityColumnSupportImpl
|
|||
|
||||
@Override
|
||||
public String getIdentityColumnString(int type) {
|
||||
// Note that the unique_rowid() function used to generated values with serial_normalization=rowid (default)
|
||||
// will always produce INT8 (Types.BIGINT) values which might not fit other data types.
|
||||
// See https://www.cockroachlabs.com/docs/stable/serial.html
|
||||
switch ( type ) {
|
||||
case Types.TINYINT:
|
||||
case Types.SMALLINT:
|
||||
|
|
Loading…
Reference in New Issue