mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
9776b6f9cd
Inserting a negative value in the autoincrement column of a partitioned innodb table was causing the value of the auto increment counter to wrap around into a very large positive value. The consequences are the same as if a very large positive value was inserted into a column, e.g. reduced autoincrement range, failure to read autoincrement counter. The current patch ensures that before calculating the next auto increment value, the current value is within the positive maximum allowed limit. mysql-test/suite/parts/inc/partition_auto_increment.inc: Bug#45823 Assertion failure in file row/row0mysql.c line 1386 Adds tests for performing insert,update and delete on a partition table with negative auto_increment values. mysql-test/suite/parts/r/partition_auto_increment_innodb.result: Bug#45823 Assertion failure in file row/row0mysql.c line 1386 Result file for the innodb engine. mysql-test/suite/parts/r/partition_auto_increment_memory.result: Bug#45823 Assertion failure in file row/row0mysql.c line 1386 Result file for the memory engine. mysql-test/suite/parts/r/partition_auto_increment_myisam.result: Bug#45823 Assertion failure in file row/row0mysql.c line 1386 Result file for the myisam engine. mysql-test/suite/parts/r/partition_auto_increment_ndb.result: Bug#45823 Assertion failure in file row/row0mysql.c line 1386 Result file for the ndb engine. mysql-test/suite/parts/t/partition_auto_increment_archive.test: Bug#45823 Assertion failure in file row/row0mysql.c line 1386 Adds a variable that allows the Archive engine to skip tests that involve insertion of negative auto increment values. mysql-test/suite/parts/t/partition_auto_increment_blackhole.test: Bug#45823 Assertion failure in file row/row0mysql.c line 1386 Adds a variable that allows the Blackhole engine to skip tests that involve insertion of negative auto increment values. sql/ha_partition.cc: Bug#45823 Assertion failure in file row/row0mysql.c line 1386 Ensures that the current value is lesser than the upper limit for the type of the field before setting the next auto increment value to be calculated. sql/ha_partition.h: Bug#45823 Assertion failure in file row/row0mysql.c line 1386 Modifies the set_auto_increment_if_higher function, to take into account negative auto increment values when doing a comparison.
38 lines
1.9 KiB
Text
38 lines
1.9 KiB
Text
################################################################################
|
|
# t/partition_auto_increment_blackhole.test #
|
|
# #
|
|
# Purpose: #
|
|
# Tests around auto increment column #
|
|
# Blackhole branch #
|
|
# #
|
|
#------------------------------------------------------------------------------#
|
|
# Original Author: MattiasJ #
|
|
# Original Date: 2008-09-02 #
|
|
# Change Author: #
|
|
# Change Date: #
|
|
# Change: #
|
|
################################################################################
|
|
|
|
#
|
|
# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
|
|
# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
|
|
# THE SOURCED FILES ONLY.
|
|
#
|
|
|
|
# The server must support partitioning.
|
|
--source include/have_partition.inc
|
|
|
|
#------------------------------------------------------------------------------#
|
|
# Engine specific settings and requirements
|
|
--source include/have_blackhole.inc
|
|
# Bug#45823 Assertion failure in file row/row0mysql.c line 1386
|
|
# Blackhole does not handle negative autoincrement values correctly
|
|
let $skip_negative_auto_inc= 1;
|
|
|
|
##### Storage engine to be tested
|
|
let $engine= 'Blackhole';
|
|
|
|
#------------------------------------------------------------------------------#
|
|
# Execute the tests to be applied to all storage engines
|
|
--source suite/parts/inc/partition_auto_increment.inc
|
|
|