| 1 |
################################################################################################################ |
| 2 |
# Bug #32299738: GEOMETRY COLUMNS OF TYPE DATA_BLOB FROM 5.6 MAKES UPGRADE FROM 5.7 TO 8.0 FAIL |
| 3 |
################################################################################################################ |
| 4 |
|
| 5 |
# This test validates that the tables created with GEOMETRY type columns in 5.6 and 5.7 version are |
| 6 |
# successfully upgraded to 8.0 version. |
| 7 |
# The database being upgraded was generated by following steps: |
| 8 |
# 1. Created the database in 5.6 |
| 9 |
# 2. Created table t56_geometry_table with geometry datatypes |
| 10 |
# 3. Upgraded the database to 5.7 |
| 11 |
# 4. Created table t57_geometry_table with geometry datatypes and spatial indexes |
| 12 |
# 5. Table t56_geometry_table was altered to add a spatial index while running with 5.7 as spatial indexes |
| 13 |
# on InnoDB tables were not supported in 5.6 |
| 14 |
|
| 15 |
--source include/have_debug.inc |
| 16 |
--source include/not_valgrind.inc |
| 17 |
--source include/have_case_sensitive_file_system.inc |
| 18 |
|
| 19 |
--disable_query_log |
| 20 |
call mtr.add_suppression("\\[ERROR\\] .*MY-\\d+.* Incorrect definition of table mysql.event"); |
| 21 |
call mtr.add_suppression("\\[ERROR\\] .*MY-\\d+.* Incorrect definition of table mysql.proc"); |
| 22 |
call mtr.add_suppression("\\[Warning\\] .* System table 'plugin' is expected to be transactional."); |
| 23 |
call mtr.add_suppression("\\[Warning\\] .* System table 'time_zone_leap_second' is expected to be transactional."); |
| 24 |
call mtr.add_suppression("\\[Warning\\] .* System table 'time_zone_name' is expected to be transactional."); |
| 25 |
call mtr.add_suppression("\\[Warning\\] .* System table 'time_zone' is expected to be transactional."); |
| 26 |
call mtr.add_suppression("\\[Warning\\] .* System table 'time_zone_transition_type' is expected to be transactional."); |
| 27 |
call mtr.add_suppression("\\[Warning\\] .* System table 'time_zone_transition' is expected to be transactional."); |
| 28 |
call mtr.add_suppression("\\[Warning\\] .* db.opt file not found for test database."); |
| 29 |
--enable_query_log |
| 30 |
|
| 31 |
--echo # |
| 32 |
--echo # This test upgrades a 5.7 database with a table containing GEOMETRY columns. This table |
| 33 |
--echo # was originally created in 5.6 and then upgraded to 5.7. An additional table containing |
| 34 |
--echo # GEOMETRY columns was created in 5.7 |
| 35 |
--echo # |
| 36 |
|
| 37 |
--echo # Stop the running server |
| 38 |
--source include/shutdown_mysqld.inc |
| 39 |
|
| 40 |
--echo ################################################################################# |
| 41 |
--echo # Copy and unzip the datadir created with 5.6 version and upgraded to 5.7 |
| 42 |
--echo ################################################################################# |
| 43 |
|
| 44 |
--copy_file $MYSQLTEST_VARDIR/std_data/data_geometry_56.zip $MYSQL_TMP_DIR/data_geometry_56.zip |
| 45 |
--file_exists $MYSQL_TMP_DIR/data_geometry_56.zip |
| 46 |
--exec unzip -qo $MYSQL_TMP_DIR/data_geometry_56.zip -d $MYSQL_TMP_DIR |
| 47 |
let $DATADIR = $MYSQL_TMP_DIR/data_geometry_56; |
| 48 |
|
| 49 |
--echo # Restart the server with the unzipped datadir |
| 50 |
--replace_result $DATADIR DATADIR |
| 51 |
--let $wait_counter=3000 |
| 52 |
--let $restart_parameters = restart: --datadir=$DATADIR --innodb_page_size=16k |
| 53 |
--source include/start_mysqld.inc |
| 54 |
|
| 55 |
--echo # Check the contents of INFORMATION_SCHEMA |
| 56 |
SHOW TABLES; |
| 57 |
SELECT NAME, ROW_FORMAT, SPACE_TYPE FROM INFORMATION_SCHEMA.INNODB_TABLES WHERE name LIKE '%test/t_%' |
| 58 |
ORDER BY name; |
| 59 |
SHOW CREATE TABLE t56_geometry_table; |
| 60 |
SHOW CREATE TABLE t57_geometry_table; |
| 61 |
|
| 62 |
--echo # Perform some basic operations on the tables |
| 63 |
ALTER TABLE t56_geometry_table ADD SPATIAL INDEX si56_geometry (`c56_geometry`); |
| 64 |
SHOW CREATE TABLE t56_geometry_table; |
| 65 |
ALTER TABLE t57_geometry_table ADD SPATIAL INDEX si57_geometry (`c57_geometry`); |
| 66 |
SHOW CREATE TABLE t57_geometry_table; |
| 67 |
ALTER TABLE t56_geometry_table DROP INDEX si56_point; |
| 68 |
ALTER TABLE t57_geometry_table DROP INDEX si57_point; |
| 69 |
SHOW CREATE TABLE t56_geometry_table; |
| 70 |
SHOW CREATE TABLE t57_geometry_table; |
| 71 |
|
| 72 |
--echo # Cleanup |
| 73 |
--echo # Shutdown server |
| 74 |
--source include/shutdown_mysqld.inc |
| 75 |
|
| 76 |
--echo # Remove copied files |
| 77 |
--file_exists $MYSQL_TMP_DIR/data_geometry_56.zip |
| 78 |
--force-rmdir $MYSQL_TMP_DIR/data_geometry_56 |
| 79 |
--remove_file $MYSQL_TMP_DIR/data_geometry_56.zip |
| 80 |
|
| 81 |
--echo # Restart the server |
| 82 |
let $restart_parameters=; |
| 83 |
--source include/start_mysqld.inc |