mariadb/mysql-test/suite/gcol/t/gcol_ins_upd_innodb.test
Nikita Malyavin 0e9ba176bf MDEV-17890 Server crash on DELETE with YEAR field with truncated expr
The failing reason was inconsistent truncation rules: the value of virtual
column could have been evaluated to '2000' sometimes instead of '0000' for
value 'a'.

The reason why `c YEAR AS ('aaaa')` was not evaluated same is that len=4 is
a special case insidew Field_year::store.

The correct fix is: always evaluate a bad value to 0000 instead 2000.
The truncated values should be evaluated as usual.

$support_virtual_index is finally changed to 1 in gcol.gcol_ins_upd_innodb,
which is also enough for testing.

The test from original bug report is also added.
2021-07-12 22:00:39 +03:00

47 lines
2.3 KiB
Text

################################################################################
# t/gcol_ins_upd_innodb.test #
# #
# Purpose: #
# Testing DDL operations such as INSERT, UPDATE, REPLACE and DELETE. #
# #
# InnoDB branch #
# #
#------------------------------------------------------------------------------#
# Original Author: Andrey Zhakov #
# Original Date: 2008-09-04 #
# 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.
#
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
##### Storage engine to be tested
# Set the session storage engine
--source include/have_innodb.inc
eval SET @@session.default_storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
# none
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
let $support_virtual_index= 1;
--source suite/gcol/inc/gcol_ins_upd.inc
#------------------------------------------------------------------------------#
# Execute storage engine specific tests
#------------------------------------------------------------------------------#
# Cleanup
--source suite/gcol/inc/gcol_cleanup.inc