From 21eed902f3415956cb3d5a4153459acc2e299402 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Fri, 14 Jun 2019 21:23:53 +0300 Subject: [PATCH 01/22] Updated list of unstable tests for 10.2.25 --- mysql-test/unstable-tests | 152 +++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 74 deletions(-) diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index 18fb5cae559..9003dd2814c 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -24,21 +24,18 @@ ############################################################################## ############################################################################## -# Based on 10.2 1214674b712d855d7cd04f4daedb9a16c24fc63b +# Based on 10.2 b40c2d2c512ee947625f85e893089b4cac1da970 main.alter_table_trans : MDEV-12084 - timeout -main.analyze_stmt : Modified in 10.2.23 main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result main.auth_named_pipe : MDEV-14724 - System error 2 main.bootstrap : Modified in 10.2.24 -main.check_constraint : Modified in 10.2.23 main.connect : MDEV-17282 - Wrong result main.connect2 : MDEV-13885 - Server crash main.constraints : Modified in 10.2.24 main.count_distinct2 : MDEV-11768 - timeout main.create_delayed : MDEV-10605 - failed with timeout main.create_drop_event : MDEV-16271 - Wrong result -main.create_drop_role : Modified in 10.2.23 main.cte_nonrecursive : Modified in 10.2.24 main.ctype_big5 : Modified in 10.2.24 main.ctype_euckr : Modified in 10.2.24 @@ -57,6 +54,7 @@ main.ctype_utf16le : Modified in 10.2.24 main.ctype_utf32 : Modified in 10.2.24 main.ctype_utf32_uca : Modified in 10.2.24 main.ctype_utf8 : Modified in 10.2.24 +main.ctype_utf8_def_upgrade : Added in 10.2.25 main.ctype_utf8mb4 : Modified in 10.2.24 main.ctype_utf8mb4_heap : Modified in 10.2.24 main.ctype_utf8mb4_innodb : Modified in 10.2.24 @@ -64,8 +62,10 @@ main.ctype_utf8mb4_myisam : Modified in 10.2.24 main.ddl_i18n_koi8r : Modified in 10.2.24 main.ddl_i18n_utf8 : Modified in 10.2.24 main.debug_sync : MDEV-10607 - internal error -main.derived_cond_pushdown : Modified in 10.2.23 +main.derived : Modified in 10.2.25 +main.derived_cond_pushdown : Modified in 10.2.25 main.derived_opt : MDEV-11768 - timeout +main.derived_view : Modified in 10.2.25 main.dirty_close : MDEV-19368 - mysqltest failed but provided no output main.distinct : MDEV-14194 - Crash main.drop_bad_db_type : MDEV-15676 - Wrong result @@ -77,12 +77,9 @@ main.events_slowlog : MDEV-12821 - Wrong result main.flush : MDEV-19368 - mysqltest failed but provided no output main.func_gconcat : Modified in 10.2.24 main.func_hybrid_type : Modified in 10.2.24 -main.func_json : Modified in 10.2.23 -main.func_math : Modified in 10.2.23 +main.func_json : Modified in 10.2.25 main.func_str : Modified in 10.2.24 -main.func_time : Modified in 10.2.23 main.gis : MDEV-13411 - wrong result on P8; modified in 10.2.24 -main.gis-loaddata : Added in 10.2.23 main.gis_notembedded : Added in 10.2.24 main.gis-precise : Modified in 10.2.24 main.grant4 : Modified in 10.2.24 @@ -92,27 +89,28 @@ main.index_merge_innodb : MDEV-7142 - Plan mismatch; modified in 10.2 main.index_merge_myisam : Modified in 10.2.24 main.information_schema_prepare : Added in 10.2.24 main.innodb_mysql_lock : MDEV-7861 - Wrong result +main.join_cache : Modified in 10.2.25 +main.join_nested : Modified in 10.2.25 +main.join_outer : Modified in 10.2.25 main.kill-2 : MDEV-13257 - Wrong result main.kill_processlist-6619 : MDEV-10793 - Wrong result -main.loaddata : Modified in 10.2.23 -main.loadxml : Modified in 10.2.23 -main.log_slow : MDEV-13263 - Wrong result; modified in 10.2.23 -main.log_slow_debug : Added in 10.2.23 +main.loaddata : MDEV-19368 - mysqltest failed but provided no output +main.log_slow : MDEV-13263 - Wrong result main.log_tables-big : MDEV-13408 - wrong result main.mdev_19276 : Added in 10.2.24 main.mdev-504 : MDEV-15171 - warning main.mdev375 : MDEV-10607 - sporadic "can't connect" main.merge : MDEV-10607 - sporadic "can't connect" -main.multi_update : Modified in 10.2.24 -main.multi_update_innodb : Modified in 10.2.24 +main.multi_update : Modified in 10.2.25 +main.multi_update_debug : Added in 10.2.25 +main.multi_update_innodb : Modified in 10.2.25 main.mysql : Modified in 10.2.24 main.mysql_client_test : MDEV-19369 - error: 5888, status: 23, errno: 2 main.mysql_client_test_comp : MDEV-16641 - Error in exec main.mysql_client_test_nonblock : CONC-208 - Error on Power; MDEV-15096 - exec failed main.mysql_upgrade_noengine : MDEV-14355 - Wrong result main.mysql_upgrade_ssl : MDEV-13492 - Unknown SSL error -main.mysqld--help : Modified in 10.2.23 -main.mysqldump : MDEV-14800 - Stack smashing detected +main.mysqldump : MDEV-14800 - Stack smashing detected; modified in 10.2.25 main.mysqldump-compat : Modified in 10.2.24 main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug main.mysqlslap : MDEV-11801 - timeout @@ -123,13 +121,11 @@ main.openssl_1 : MDEV-13492 - Unknown SSL error main.openssl_6975 : MDEV-17184 - Failures with OpenSSL 1.1.1 main.order_by : Modified in 10.2.24 main.order_by_optimizer_innodb : MDEV-10683 - Wrong result -main.partition : Modified in 10.2.23 main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock main.partition_innodb : Modified in 10.2.24 main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings main.partition_innodb_semi_consistent : MDEV-19411 - Failed to start mysqld.1 main.ps : MDEV-11017 - Wrong result; modified in 10.2.24 -main.reopen_temp_table : Modified in 10.2.23 main.query_cache : MDEV-16180 - Wrong result main.query_cache_debug : MDEV-15281 - Query cache is disabled main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away @@ -138,45 +134,41 @@ main.set_statement_notembedded : MDEV-19414 - Wrong result main.shm : MDEV-12727 - Mismatch, ERROR 2013 main.show_check : Modified in 10.2.24 main.show_explain : MDEV-10674 - Wrong result code -main.show_explain_ps : Modified in 10.2.23 main.sp : MDEV-7866 - Mismatch; modified in 10.2.24 -main.sp_notembedded : MDEV-10607 - internal error; modified in 10.2.23 +main.sp_notembedded : MDEV-10607 - internal error main.sp-security : MDEV-10607 - sporadic "can't connect" -main.sp_trans : Modified in 10.2.23 -main.sp-ucs2 : Modified in 10.2.23 main.ssl : MDEV-17184 - Failures with OpenSSL 1.1.1 main.ssl_ca : MDEV-10895 - SSL connection error on Power main.ssl_cipher : MDEV-17184 - Failures with OpenSSL 1.1.1 main.ssl_connect : MDEV-13492 - Unknown SSL error -main.ssl_crl : MDEV-19119 - Wrong error code; modified in 10.2.23 -main.ssl_crl_clients : Modified in 10.2.23 +main.ssl_crl : MDEV-19119 - Wrong error code main.ssl_timeout : MDEV-11244 - Crash main.ssl_verify_ip : Added in 10.2.24 -main.stat_tables : Modified in 10.2.24 +main.stat_tables : Modified in 10.2.25 main.stat_tables_par : MDEV-13266 - Wrong result main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding main.statistics : Modified in 10.2.24 main.status : MDEV-13255 - Wrong result main.status2 : Modified in 10.2.24 main.subselect_innodb : MDEV-10614 - Sporadic wrong results -main.subselect_sj : Modified in 10.2.23 -main.subselect_sj_mat : Modified in 10.2.23 +main.subselect_no_semijoin : Modified in 10.2.25 +main.subselect_sj : Modified in 10.2.25 +main.subselect_sj_mat : Modified in 10.2.25 main.tc_heuristic_recover : MDEV-14189 - Wrong result +main.temp_table : Modified in 10.2.25 main.timezone2 : Modified in 10.2.24 main.trigger : Modified in 10.2.24 +main.trigger_null-8605 : Modified in 10.2.25 main.type_bit : Modified in 10.2.24 main.type_blob : MDEV-15195 - Wrong result; modified in 10.2.24 main.type_date : Modified in 10.2.24 main.type_datetime_hires : MDEV-10687 - Timeout main.type_decimal : Modified in 10.2.24 -main.type_year : Modified in 10.2.23 -main.update : Modified in 10.2.23 main.update_innodb : Modified in 10.2.24 -main.userstat : MDEV-12904 - SSL errors; modified in 10.2.23 -main.view : Modified in 10.2.23 +main.userstat : MDEV-12904 - SSL errors main.view_grant : Modified in 10.2.24 main.wait_timeout : MDEV-19023 - Lost connection to MySQL server during query -main.win : Modified in 10.2.24 +main.win : Modified in 10.2.25 main.xa : MDEV-11769 - lock wait timeout #---------------------------------------------------------------- @@ -194,9 +186,11 @@ archive-test_sql_discovery.discover : MDEV-16817 - Table marked as crashed binlog.binlog_commit_wait : MDEV-10150 - Mismatch binlog.binlog_innodb_stm : Added in 10.2.24 binlog.binlog_killed : MDEV-12925 - Wrong result +binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown binlog.binlog_mysqlbinlog2 : Modified in 10.2.24 binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint binlog.flashback : Modified in 10.2.24 +binlog.flashback-largebinlog : MDEV-19764 - Out of memory; added in 10.2.25 binlog.load_data_stm_view : MDEV-16948 - Wrong result #---------------------------------------------------------------- @@ -222,12 +216,12 @@ binlog_encryption.rpl_typeconv : MDEV-14362 - Lost connection to MySQL serv connect.pivot : MDEV-14803 - Failed to discover table connect.vcol : MDEV-12374 - Fails on Windows -connect.xml : MDEV-19409 - Result length mismatch connect.zip : MDEV-13884 - Wrong result #---------------------------------------------------------------- -encryption.corrupted_during_recovery : Added in 10.2.24 +encryption.compressed_import_tablespace : Added in 10.2.25 +encryption.corrupted_during_recovery : Modified in 10.2.25 encryption.create_or_replace : MDEV-12694 - Timeout; MDEV-16115 - Trying to access tablespace encryption.debug_key_management : MDEV-13841 - Timeout encryption.encrypt_and_grep : MDEV-13765 - Wrong result @@ -237,23 +231,22 @@ encryption.innodb-bad-key-change2 : MDEV-19118 - Can't connect th encryption.innodb-checksum-algorithm : MDEV-12898 - Deadlock of threads; MDEV-16896 - Server crash encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate; modified in 10.2.24 encryption.innodb-discard-import : MDEV-19113 - Timeout -encryption.innodb_encrypt_key_rotation_age : Added in 10.2.24 +encryption.innodb_encrypt_key_rotation_age : MDEV-19763 - Timeout; added in 10.2.24 encryption.innodb_encrypt_log : MDEV-13725 - Wrong result encryption.innodb_encryption : MDEV-15675 - Timeout -encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout; modified in 10.2.23 +encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout encryption.innodb-encryption-disable : Modified in 10.2.24 encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure encryption.innodb_encryption_row_compressed : MDEV-16113 - Crash encryption.innodb_first_page : MDEV-10689 - Crash encryption.innodb-first-page-read : MDEV-14356 - Timeout in wait condition -encryption.innodb-force-corrupt : MDEV-17286 - SSL error; modified in 10.2.24 +encryption.innodb-force-corrupt : MDEV-17286 - SSL error; modified in 10.2.25 encryption.innodb-key-rotation-disable : Modified in 10.2.24 encryption.innodb-missing-key : Modified in 10.2.24 encryption.innodb_onlinealter_encryption : MDEV-17287 - SIGABRT on server restart encryption.innodb-page_encryption : MDEV-10641 - mutex problem encryption.innodb-read-only : MDEV-16563 - Crash on startup -encryption.innodb-redo-badkey : MDEV-13893 - Page cannot be decrypted encryption.innodb-remove-encryption : MDEV-16493 - Timeout in wait condition encryption.innodb_scrub : MDEV-8139 - scrubbing tests need fixing encryption.innodb_scrub_background : MDEV-8139 - scrubbing tests need fixing @@ -297,29 +290,27 @@ gcol.gcol_rollback : MDEV-16954 - Unknown storage engine 'Inno gcol.innodb_virtual_basic : MDEV-16950 - Failing assertion; modified in 10.2.24 gcol.innodb_virtual_debug : Modified in 10.2.24 gcol.innodb_virtual_debug_purge : MDEV-16952 - Wrong result +gcol.innodb_virtual_purge : Modified in 10.2.25 #---------------------------------------------------------------- innodb.101_compatibility : MDEV-13891 - Wrong result innodb.alter_copy : MDEV-16181 - Assertion failure -innodb.alter_crash : MDEV-16944 - The process cannot access the file; modified in 10.2.23 +innodb.alter_crash : MDEV-16944 - The process cannot access the file innodb.alter_kill : Modified in 10.2.24 -innodb.alter_table : Modified in 10.2.23 innodb.autoinc_persist : MDEV-15282 - Assertion failure innodb.binlog_consistent : MDEV-10618 - Server fails to start -innodb.corrupted_during_recovery : Added in 10.2.24 -innodb.doublewrite : MDEV-12905 - Server crash; modified in 10.2.23 +innodb.corrupted_during_recovery : Modified in 10.2.25 +innodb.doublewrite : MDEV-12905 - Server crash innodb.drop_table_background : Modified in 10.2.24 innodb.foreign_key : Modified in 10.2.24 -innodb.foreign-keys : Modified in 10.2.23 +innodb.foreign-keys : Modified in 10.2.25 innodb.group_commit_crash : MDEV-14191 - InnoDB registration failed innodb.group_commit_crash_no_optimize_thread : MDEV-13830 - Assertion failure innodb.ibuf_not_empty : MDEV-19021 - Wrong result -innodb.innodb : MDEV-19408 - Assertion failure innodb.innodb-32k-crash : MDEV-16953 - Corrupt log record found -innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup +innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup; modified in 10.2.25 innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS -innodb.innodb-alter-nullable : Modified in 10.2.23 innodb.innodb-alter-table : MDEV-10619 - Testcase timeout innodb.innodb-alter-tempfile : MDEV-15285 - Table already exists innodb.innodb-blob : MDEV-12053 - Client crash @@ -330,13 +321,14 @@ innodb.innodb_bug48024 : MDEV-14352 - Assertion failure innodb.innodb_bug59641 : MDEV-13830 - Assertion failure innodb.innodb_bulk_create_index_replication : MDEV-15273 - Slave failed to start innodb.innodb-change-buffer-recovery : MDEV-19115 - Lost connection to MySQL server during query -innodb.innodb-corrupted-table : Modified in 10.2.23 innodb.innodb_defrag_stats_many_tables : MDEV-14198 - Table is full innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown +innodb.innodb_force_recovery : Modified in 10.2.25 innodb.innodb-get-fk : MDEV-13276 - Server crash innodb.innodb-index : Modified in 10.2.24 innodb.innodb-index-online : MDEV-14809 - Cannot save statistics innodb.innodb_information_schema : MDEV-8851 - Wrong result +innodb.leaf_page_corrupted_during_recovery : Added in 10.2.25 innodb.innodb_max_recordsize_32k : MDEV-14801 - Operation failed innodb.innodb_max_recordsize_64k : MDEV-15203 - Wrong result innodb.innodb_monitor : MDEV-10939 - Testcase timeout @@ -353,15 +345,14 @@ innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find innodb.log_alter_table : Modified in 10.2.24 innodb.log_corruption : MDEV-13251 - Wrong result innodb.log_data_file_size : MDEV-14204 - Server failed to start -innodb.log_file_name : MDEV-14193 - Exception; modified in 10.2.23 +innodb.log_file_name : MDEV-14193 - Exception innodb.log_file_size : MDEV-15668 - Not found pattern -innodb.monitor : MDEV-16179 - Wrong result +innodb.monitor : MDEV-16179 - Wrong result; modified in 10.2.25 innodb.page_reorganize : Added in 10.2.24 innodb.purge_secondary : MDEV-15681 - Wrong result innodb.purge_thread_shutdown : MDEV-13792 - Wrong result innodb.read_only_recovery : MDEV-13886 - Server crash -innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile; modified in 10.2.23 -innodb.restart : Modified in 10.2.23 +innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace innodb.table_definition_cache_debug : MDEV-14206 - Extra warning innodb.table_flags : MDEV-13572 - Wrong result; MDEV-19374 - Server failed to start @@ -369,31 +360,25 @@ innodb.temp_table_savepoint : MDEV-16182 - Wrong result innodb.temporary_table : MDEV-13265 - Wrong result innodb.update_time : MDEV-14804 - Wrong result innodb.undo_truncate : MDEV-17340 - Server hung -innodb.undo_truncate_recover : MDEV-17679 - MySQL server has gone away; modified in 10.2.23 -innodb.xa_debug : MDEV-19408 - Assertion failure; added in 10.2.24 +innodb.undo_truncate_recover : MDEV-17679 - MySQL server has gone away +innodb.xa_debug : MDEV-19408 - Added in 10.2.24 innodb.xa_recovery : MDEV-15279 - mysqld got exception -innodb_fts.fulltext3 : Modified in 10.2.23 +innodb_fts.innodb_ft_aux_table : Added in 10.2.25 innodb_fts.innodb-fts-fic : MDEV-14154 - Assertion failure innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning innodb_fts.innodb_fts_plugin : MDEV-13888 - Errors in server log innodb_fts.innodb_fts_stopword_charset : MDEV-13259 - Table crashed innodb_fts.sync : MDEV-14808 - Wrong result -innodb_fts.sync_ddl : MDEV-17296 - Assertion failure innodb_gis.kill_server : MDEV-16941 - Checksum mismatch -innodb_gis.multi_pk : MDEV-13942 - AddressSanitizer: use-after-poison -innodb_gis.rtree_compress : MDEV-13942 - AddressSanitizer: use-after-poison -innodb_gis.rtree_compress2 : MDEV-13942 - AddressSanitizer: use-after-poison +innodb_gis.rtree_add_index : Added in 10.2.25 innodb_gis.rtree_concurrent_srch : MDEV-15284 - Wrong result with embedded -innodb_gis.rtree_debug : MDEV-13942 - AddressSanitizer: use-after-poison innodb_gis.rtree_purge : MDEV-15275 - Timeout innodb_gis.rtree_recovery : MDEV-15274 - Error on check -innodb_gis.rtree_rollback1 : MDEV-13942 - AddressSanitizer: use-after-poison innodb_gis.rtree_split : MDEV-14208 - Too many arguments innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file innodb_gis.types : MDEV-15679 - Table is marked as crashed -innodb_gis.update_root : MDEV-13942 - AddressSanitizer: use-after-poison innodb_zip.cmp_per_index : MDEV-14490 - Table is marked as crashed innodb_zip.innochecksum_3 : MDEV-13279 - Extra warnings @@ -407,7 +392,6 @@ innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error maria.insert_select : MDEV-12757 - Timeout maria.insert_select-7314 : MDEV-16492 - Timeout maria.maria : MDEV-14430 - Extra warning -maria.maria-recovery : Modified in 10.2.23 #---------------------------------------------------------------- @@ -423,10 +407,8 @@ mariabackup.full_backup : MDEV-16571 - Wrong result mariabackup.huge_lsn : MDEV-15662 - Sequence number is in the future mariabackup.incremental_backup : MDEV-14192 - Assertion failure mariabackup.incremental_encrypted : MDEV-15667 - Timeout; MDEV-14192 - Assertion failure -mariabackup.incremental_rocksdb : Added in 10.2.23 mariabackup.innodb_log_optimize_ddl : MDEV-14192 - Assertion failure mariabackup.mdev-14447 : MDEV-15201 - Timeout -mariabackup.page_compression_level : Added in 10.2.23 mariabackup.partial_exclude : MDEV-15270 - Error on exec mariabackup.rename_during_backup : MDEV-14192 - Assertion failure mariabackup.xbstream : MDEV-14192 - Crash @@ -440,7 +422,6 @@ mroonga/storage.column_datetime_32bit_2038 : Wrong resul mroonga/storage.column_datetime_32bit_before_unix_epoch : Wrong result on Alpha mroonga/storage.column_datetime_32bit_max : Wrong result on Alpha mroonga/storage.column_datetime_32bit_out_of_range : Wrong result on Alpha -mroonga/storage.column_generated_stored_add_column : Modified in 10.2.23 mroonga/storage.index_multiple_column_unique_date_32bit_equal : Wrong result on Alpha mroonga/storage.index_multiple_column_unique_date_order_32bit_desc : Wrong result on Alpha mroonga/storage.index_multiple_column_unique_datetime_index_read : MDEV-8643 - Valgrind @@ -463,7 +444,6 @@ multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_ parts.partition_alter2_2_maria : MDEV-14364 - Lost connection to MySQL server during query parts.partition_auto_increment_archive : MDEV-16491 - Marked as crashed and should be repaired parts.partition_auto_increment_maria : MDEV-14430 - Extra warning -parts.partition_auto_increment_max : Added in 10.2.23 parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket; MDEV-15095 - Table doesn't exist parts.partition_exch_qa_10 : MDEV-11765 - wrong result parts.partition_innodb_status_file : MDEV-12901 - Valgrind @@ -499,6 +479,7 @@ perfschema_stress.* : MDEV-10996 - Not maintained #---------------------------------------------------------------- +plugins.feedback_plugin_load : Modified in 10.2.25 plugins.feedback_plugin_send : MDEV-7932, MDEV-11118 - Connection problems and such plugins.pam : Modified in 10.2.24 plugins.processlist : MDEV-16574 - Wrong result @@ -519,8 +500,29 @@ rocksdb.drop_index_inplace : MDEV-14162 - Crash on shutdown rocksdb.drop_table : MDEV-14308 - Timeout rocksdb.drop_table3 : MDEV-16949 - Server crash rocksdb.dup_key_update : MDEV-17284 - Wrong result -rocksdb.locking_issues : MDEV-14464 - Wrong result +rocksdb.locking_issues : MDEV-14464 - Wrong result; modified in 10.2.25 +rocksdb.locking_issues_case1_1_rc : Added in 10.2.25 +rocksdb.locking_issues_case1_1_rr : Added in 10.2.25 +rocksdb.locking_issues_case1_2_rc : Added in 10.2.25 +rocksdb.locking_issues_case1_2_rr : Added in 10.2.25 +rocksdb.locking_issues_case2_rc : Added in 10.2.25 +rocksdb.locking_issues_case2_rc_lsr : Added in 10.2.25 +rocksdb.locking_issues_case2_rr : Added in 10.2.25 +rocksdb.locking_issues_case2_rr_lsr : Added in 10.2.25 +rocksdb.locking_issues_case3_rc : Added in 10.2.25 +rocksdb.locking_issues_case3_rr : Added in 10.2.25 +rocksdb.locking_issues_case4_rc : Added in 10.2.25 +rocksdb.locking_issues_case4_rr : Added in 10.2.25 +rocksdb.locking_issues_case5_rc : Added in 10.2.25 +rocksdb.locking_issues_case5_rr : Added in 10.2.25 +rocksdb.locking_issues_case6_rc : Added in 10.2.25 +rocksdb.locking_issues_case6_rr : Added in 10.2.25 +rocksdb.locking_issues_case7_rc : Added in 10.2.25 +rocksdb.locking_issues_case7_rc_lsr : Added in 10.2.25 +rocksdb.locking_issues_case7_rr : Added in 10.2.25 +rocksdb.locking_issues_case7_rr_lsr : Added in 10.2.25 rocksdb.mariadb_ignore_dirs : MDEV-16639 - Server crash +rocksdb.mariadb_plugin : Modified in 10.2.25 rocksdb.mariadb_port_fixes : MDEV-16387 - Wrong plan rocksdb.max_open_files : MDEV-16639 - Server crash rocksdb.perf_context : MDEV-17285 - Wrong results @@ -554,8 +556,11 @@ rpl.last_insert_id : MDEV-10625 - warnings in error log rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log +rpl.rpl_binlog_dup_entry : Added in 10.2.25 rpl.rpl_binlog_errors : MDEV-12742 - Crash rpl.rpl_binlog_index : MDEV-9501 - Failed registering on master +rpl.rpl_blackhole : Re-enabled in 10.2.25 +rpl.rpl_blackhole_row_annotate : Added in 10.2.25 rpl.rpl_colSize : MDEV-16112 - Server crash rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac rpl.rpl_ddl : MDEV-10417 - Fails on Mips @@ -608,11 +613,13 @@ rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed rpl.rpl_row_index_choice : MDEV-15196 - Slave crash +rpl.rpl_row_mysqlbinlog : Re-enabled in 10.2.25 rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x rpl.rpl_semi_sync : MDEV-11220 - Wrong result rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings +rpl.rpl_semi_sync_skip_repl : Modified in 10.2.25 rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Assorted failures rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition rpl.rpl_set_statement_default_master : MDEV-13258 - Extra warning @@ -633,6 +640,7 @@ rpl.rpl_temporal_mysql56_to_mariadb53 : MDEV-9501 - Failed registering on master rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output rpl.rpl_trigger : MDEV-18055 - Wrong result +rpl.rpl_truncate_3innodb : MDEV-19454 - Sporadic syntax error rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result rpl/extra/rpl_tests.* : MDEV-10994 - Not maintained @@ -672,16 +680,12 @@ stress.ddl_innodb : MDEV-10635 - Testcase timeout sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x sys_vars.delayed_insert_limit_func : MDEV-17683 - Wrong result sys_vars.innodb_buffer_pool_dump_at_shutdown_basic : MDEV-14280 - Unexpected error -sys_vars.innodb_ft_result_cache_limit_32 : MDEV-19387 - Fails on s390x +sys_vars.innodb_ft_result_cache_limit : Modified in 10.2.25 sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash sys_vars.rpl_init_slave_func : MDEV-10149 - Test assertion sys_vars.slow_query_log_func : MDEV-14273 - Wrong result -sys_vars.sql_buffer_result_func : Modified in 10.2.23 -sys_vars.sysvars_server_embedded : Include file modified in 10.2.23 -sys_vars.sysvars_server_notembedded : Include file modified in 10.2.23 sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result -sys_vars.thread_stack_basic : Modified in 10.2.23 sys_vars.transaction_prealloc_size_bug27322 : Modified in 10.2.24 sys_vars.wait_timeout_func : MDEV-12896 - Wrong result @@ -746,7 +750,6 @@ vcol.not_supported : MDEV-10639 - Testcase timeout vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout vcol.vcol_keys_myisam : Modified in 10.2.24 vcol.vcol_misc : MDEV-16651 - Wrong error message; modified in 10.2.24 -vcol.wrong_arena : Modified in 10.2.23 #---------------------------------------------------------------- @@ -755,4 +758,5 @@ wsrep.mdev_6832 : MDEV-14195 - Check testcase failed wsrep.pool_of_threads : MDEV-17345 - WSREP has not yet prepared node for application use wsrep.variables : MDEV-14311 - Wrong result; MDEV-17585 - Deadlock +wsrep_info.* : Config file modified in 10.2.25 wsrep_info.plugin : MDEV-13569 - No nodes coming from prim view From 0789a1a18f0e780c0412667e7b6e0a9970aa6905 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Sat, 15 Jun 2019 01:21:40 +0300 Subject: [PATCH 02/22] Updated list of unstable tests for 10.3.16 release --- mysql-test/unstable-tests | 188 +++++++++++++++++++------------------- 1 file changed, 92 insertions(+), 96 deletions(-) diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index b707ffbb416..78a640f8c98 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,7 +23,7 @@ # ############################################################################## -# Based on 10.3 5c93509aad6aa952c48f078557c86322dfc35692 +# Based on 10.3 1135244a647e423f6a7b2122ad9c305253039399 #----------------------------------------------------------------------- @@ -38,11 +38,11 @@ archive-test_sql_discovery.discover : MDEV-16817 #----------------------------------------------------------------------- binlog.binlog_commit_wait : MDEV-10150 - Mismatch -binlog.binlog_innodb_stm : Added in 10.3.14 binlog.binlog_killed : MDEV-12925 - Wrong result -binlog.binlog_mysqlbinlog2 : Modified in 10.3.14 +binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint binlog.flashback : Modified in 10.3.15 +binlog.flashback-largebinlog : MDEV-19764 - Out of memory; added in 10.3.16 binlog.load_data_stm_view : MDEV-16948 - Wrong result #----------------------------------------------------------------------- @@ -84,7 +84,8 @@ connect.zip : MDEV-13884 #----------------------------------------------------------------------- -encryption.corrupted_during_recovery : Added in 10.3.15 +encryption.compressed_import_tablespace : Added in 10.3.16 +encryption.corrupted_during_recovery : Modified in 10.3.16 encryption.create_or_replace : MDEV-12694 - Timeout; MDEV-16115 - Trying to access tablespace encryption.debug_key_management : MDEV-13841 - Timeout encryption.encrypt_and_grep : MDEV-13765 - Wrong result @@ -93,18 +94,19 @@ encryption.innodb-bad-key-change2 : MDEV-19118 encryption.innodb-checksum-algorithm : MDEV-12898 - Deadlock of threads; MDEV-16896 - Server crash encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate; modified in 10.3.15 encryption.innodb-discard-import : MDEV-19113 - Timeout -encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout; modified in 10.3.14 +encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout encryption.innodb_encryption_tables : MDEV-17339 - Crash on restart encryption.innodb-first-page-read : MDEV-14356 - Timeout in wait condition -encryption.innodb-force-corrupt : MDEV-17286 - SSL error +encryption.innodb-force-corrupt : MDEV-17286 - SSL error; modified in 10.3.16 encryption.innodb-key-rotation-disable : Modified in 10.3.15 encryption.innodb-missing-key : MDEV-14728 - SSL error encryption.innodb-page_encryption : MDEV-10641 - mutex problem encryption.innodb-page_encryption_log_encryption : MDEV-17339 - Crash on restart encryption.innodb-read-only : MDEV-16563 - Crash on startup +encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup encryption.innodb-remove-encryption : MDEV-16493 - Timeout in wait condition encryption.innodb-spatial-index : MDEV-13746 - Wrong result -encryption.innodb_encrypt_key_rotation_age : Added in 10.3.15 +encryption.innodb_encrypt_key_rotation_age : MDEV-19763 - Timeout; added in 10.3.15 encryption.innodb_encrypt_log : MDEV-13725 - Wrong result encryption.innodb_encryption : MDEV-15675 - Timeout encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure @@ -135,10 +137,8 @@ federated.federatedx : MDEV-10617 #----------------------------------------------------------------------- funcs_1.memory_views : MDEV-11773 - timeout -funcs_1.processlist_priv_ps : Include file modified in 10.3.14 -funcs_1.processlist_priv_no_prot : Include file modified in 10.3.14 -funcs_1.processlist_val_no_prot : MDEV-11223 - Wrong result; include file modified in 10.3.14 -funcs_1.processlist_val_ps : MDEV-12175 - Wrong plan; include file modified in 10.3.14 +funcs_1.processlist_val_no_prot : MDEV-11223 - Wrong result +funcs_1.processlist_val_ps : MDEV-12175 - Wrong plan #----------------------------------------------------------------------- @@ -164,40 +164,35 @@ gcol.innodb_virtual_fk_restart : MDEV-17466 innodb.101_compatibility : MDEV-13891 - Wrong result innodb.alter_copy : MDEV-16181 - Assertion failure -innodb.alter_crash : MDEV-16944 - The process cannot access the file; modified in 10.3.14 +innodb.alter_crash : MDEV-16944 - The process cannot access the file innodb.alter_kill : Modified in 10.3.15 -innodb.alter_table : Modified in 10.3.14 innodb.autoinc_persist : MDEV-15282 - Assertion failure innodb.binlog_consistent : MDEV-10618 - Server fails to start -innodb.corrupted_during_recovery : Added in 10.3.15 -innodb.doublewrite : MDEV-12905 - Server crash; modified in 10.3.14 +innodb.corrupted_during_recovery : Modified in 10.3.16 +innodb.doublewrite : MDEV-12905 - Server crash innodb.drop_table_background : Modified in 10.3.15 innodb.foreign_key : Modified in 10.3.15 -innodb.foreign_keys : Modified in 10.3.14 innodb.foreign-keys : Modified in 10.3.15 innodb.group_commit_crash : MDEV-14191 - InnoDB registration failed innodb.group_commit_crash_no_optimize_thread : MDEV-13830 - Assertion failure innodb.ibuf_not_empty : MDEV-19021 - Wrong result innodb.innodb-32k-crash : MDEV-16953 - Corrupt log record found -innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup +innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup; modified in 10.3.16 innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS -innodb.innodb-alter-nullable : Modified in 10.3.14 innodb.innodb-alter-table : MDEV-10619 - Testcase timeout innodb.innodb-alter-tempfile : MDEV-15285 - Table already exists -innodb.innodb-alter-timestamp : Modified in 10.3.14 innodb.innodb-bigblob : MDEV-18655 - ASAN unknown crash innodb.innodb-blob : MDEV-12053 - Client crash innodb.innodb-change-buffer-recovery : MDEV-19115 - Lost connection to MySQL server during query -innodb.innodb-corrupted-table : Modified in 10.3.14 innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown innodb.innodb-get-fk : MDEV-13276 - Server crash innodb.innodb-index : Modified in 10.3.15 -innodb.innodb-index-online : MDEV-14809 - Cannot save statistics; modified in 10.3.14 +innodb.innodb-index-online : MDEV-14809 - Cannot save statistics innodb.innodb-page_compression_default : MDEV-13644 - Assertion failure innodb.innodb-page_compression_lzma : MDEV-14353 - Wrong result innodb.innodb-page_compression_snappy : MDEV-13644 - Assertion failure innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem -innodb.innodb-table-online : MDEV-13894 - Wrong result; modified in 10.3.14 +innodb.innodb-table-online : MDEV-13894 - Wrong result innodb.innodb-truncate : Modified in 10.3.15 innodb.innodb-wl5522 : MDEV-13644 - Assertion failure innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno @@ -209,6 +204,7 @@ innodb.innodb_buffer_pool_resize : MDEV-16964 innodb.innodb_buffer_pool_resize_with_chunks : MDEV-16964 - Assertion failure innodb.innodb_bulk_create_index_replication : MDEV-15273 - Slave failed to start innodb.innodb_defrag_stats_many_tables : MDEV-14198 - Table is full +innodb.innodb_force_recovery : Modified in 10.3.16 innodb.innodb_information_schema : MDEV-8851 - Wrong result innodb.innodb_max_recordsize_32k : MDEV-14801 - Operation failed innodb.innodb_max_recordsize_64k : MDEV-15203 - Wrong result @@ -220,11 +216,11 @@ innodb.innodb_stats_persistent_debug : MDEV-14801 innodb.innodb_sys_semaphore_waits : MDEV-10331 - Semaphore wait innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find free blocks innodb.instant_alter_crash : Modified in 10.3.15 -innodb.instant_alter_debug : Modified in 10.3.14 +innodb.leaf_page_corrupted_during_recovery : MDEV-19766 - Warning: Data too long; added in 10.3.16 innodb.log_alter_table : Modified in 10.3.15 innodb.log_corruption : MDEV-13251 - Wrong result innodb.log_data_file_size : MDEV-14204 - Server failed to start -innodb.log_file_name : MDEV-14193 - Exception; modified in 10.3.14 +innodb.log_file_name : MDEV-14193 - Exception innodb.log_file_size : MDEV-15668 - Not found pattern innodb.monitor : MDEV-16179 - Wrong result innodb.page_reorganize : Added in 10.3.15 @@ -232,7 +228,6 @@ innodb.purge_secondary : MDEV-15681 innodb.purge_thread_shutdown : MDEV-13792 - Wrong result innodb.read_only_recovery : MDEV-13886 - Server crash innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile -innodb.restart : Modified in 10.3.14 innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace innodb.table_definition_cache_debug : MDEV-14206 - Extra warning innodb.table_flags : MDEV-13572 - Wrong result; MDEV-19374 - Server failed to start @@ -240,17 +235,17 @@ innodb.temp_table_savepoint : MDEV-16182 innodb.temporary_table : MDEV-13265 - Wrong result innodb.update_time : MDEV-14804 - Wrong result innodb.undo_truncate : MDEV-17340 - Server hung -innodb.undo_truncate_recover : MDEV-13080 - Missing checkpoint; MDEV-17679 - Server has gone away; modified in 10.3.15 +innodb.undo_truncate_recover : MDEV-17679 - Server has gone away; modified in 10.3.15 innodb.xa_debug : Added in 10.3.15 innodb.xa_recovery : MDEV-15279 - mysqld got exception #----------------------------------------------------------------------- -innodb_fts.fulltext3 : Modified in 10.3.14 innodb_fts.innodb-fts-fic : MDEV-14154 - Assertion failure innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning innodb_fts.innodb_fts_plugin : MDEV-13888 - Errors in server log innodb_fts.innodb_fts_stopword_charset : MDEV-13259 - Table crashed +innodb_fts.innodb_ft_aux_table : Added in 10.3.16 innodb_fts.sync : MDEV-14808 - Wrong result innodb_fts.sync_ddl : MDEV-18654 - Assertion failure @@ -258,6 +253,7 @@ innodb_fts.sync_ddl : MDEV-18654 innodb_gis.alter_spatial_index : MDEV-13745 - Server crash innodb_gis.kill_server : MDEV-16941 - Checksum mismatch +innodb_gis.rtree_add_index : Added in 10.3.16 innodb_gis.rtree_compress2 : MDEV-16269 - Wrong result innodb_gis.rtree_concurrent_srch : MDEV-15284 - Wrong result with embedded innodb_gis.rtree_purge : MDEV-15275 - Timeout @@ -278,19 +274,16 @@ innodb_zip.wl6501_scale_1 : MDEV-13254 #----------------------------------------------------------------------- main.alter_table_trans : MDEV-12084 - timeout -main.analyze_stmt : Modified in 10.3.14 main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result main.auth_named_pipe : MDEV-14724 - System error 2 main.bootstrap : Modified in 10.3.15 main.cast : Modified in 10.3.15 -main.check_constraint : Modified in 10.3.14 main.connect : MDEV-17282 - Wrong result main.connect2 : MDEV-13885 - Server crash main.constraints : Modified in 10.3.15 main.count_distinct2 : MDEV-11768 - timeout main.create_delayed : MDEV-10605 - failed with timeout main.create_drop_event : MDEV-16271 - Wrong result -main.create_drop_role : Modified in 10.3.14 main.cte_nonrecursive : Modified in 10.3.15 main.ctype_big5 : Include file modified in 10.3.15 main.ctype_euckr : Include file modified in 10.3.15 @@ -309,36 +302,31 @@ main.ctype_utf16_uca : Include fil main.ctype_utf32 : Include file modified in 10.3.15 main.ctype_utf32_uca : Include file modified in 10.3.15 main.ctype_utf8 : Modified in 10.3.15 +main.ctype_utf8_def_upgrade : Added in 10.3.16 main.ctype_utf8mb4 : Include file modified in 10.3.15 main.ctype_utf8mb4_heap : Include file modified in 10.3.15 main.ctype_utf8mb4_innodb : MDEV-17744 - Timeout; MDEV-18567 - ASAN use-after-poison; include file modified in 10.3.15 main.ctype_utf8mb4_myisam : Include file modified in 10.3.15 -main.ddl_i18n_koi8r : Modified in 10.3.14 -main.ddl_i18n_utf8 : Modified in 10.3.14 main.debug_sync : MDEV-10607 - internal error -main.derived : Modified in 10.3.15 +main.derived : Modified in 10.3.16 main.derived_cond_pushdown : Modified in 10.3.15 main.derived_opt : MDEV-11768 - timeout -main.derived_split_innodb : Modified in 10.3.14 +main.derived_view : Modified in 10.3.16 main.dirty_close : MDEV-19368 - mysqltest failed but provided no output main.distinct : MDEV-14194 - Crash main.drop_bad_db_type : MDEV-15676 - Wrong result main.dyncol : MDEV-19455 - Extra warning -main.events_1 : Modified in 10.3.14 main.events_2 : MDEV-13277 - Crash main.events_bugs : MDEV-12892 - Crash main.events_restart : MDEV-12236 - Server shutdown problem main.events_slowlog : MDEV-12821 - Wrong result main.flush : MDEV-19368 - mysqltest failed but provided no output main.flush_logs_not_windows : Added in 10.3.15 -main.func_debug : MDEV-19452 - Garbage output; modified in 10.3.14 main.func_gconcat : Modified in 10.3.15 main.func_hybrid_type : Modified in 10.3.15 -main.func_json : Modified in 10.3.14 -main.func_math : Modified in 10.3.14 +main.func_json : Modified in 10.3.16 main.func_str : Modified in 10.3.15 -main.func_time : Modified in 10.3.14 -main.gis : MDEV-13411 - wrong result on P8; modified in 10.3.15 +main.gis : MDEV-13411 - wrong result on P8; modified in 10.3.16 main.gis_notembedded : Added in 10.3.15 main.gis-precise : Modified in 10.3.15 main.grant4 : Modified in 10.3.15 @@ -348,25 +336,26 @@ main.index_merge_innodb : MDEV-7142 - main.index_merge_myisam : Include file modified in 10.3.15 main.information_schema_prepare : Added in 10.3.15 main.innodb_mysql_lock : MDEV-7861 - Wrong result -main.join_cache : MDEV-17743 - Bad address from storage engine MyISAM +main.join : Modified in 10.3.16 +main.join_cache : MDEV-17743 - Bad address from storage engine MyISAM; modified in 10.3.16 +main.join_nested : Modified in 10.3.16 +main.join_outer : Modified in 10.3.16 main.kill-2 : MDEV-13257 - Wrong result -main.kill_processlist-6619 : MDEV-10793 - Wrong result; modified in 10.3.14 -main.loaddata : Modified in 10.3.14 -main.log_slow : MDEV-13263 - Wrong result; modified in 10.3.14 -main.log_slow_debug : Added in 10.3.14 +main.kill_processlist-6619 : MDEV-10793 - Wrong result +main.loaddata : MDEV-19368 - mysqltest failed but provided no output +main.log_slow : MDEV-13263 - Wrong result main.log_tables-big : MDEV-13408 - wrong result main.mdev375 : MDEV-10607 - sporadic "can't connect" main.mdev_19276 : Added in 10.3.15 main.mdev-504 : MDEV-15171 - warning main.merge : MDEV-10607 - sporadic "can't connect" -main.multi_update : Modified in 10.3.15 -main.multi_update_innodb : Modified in 10.3.15 -main.mysql : Modified in 10.3.14 -main.mysqld--help : Modified in 10.3.14 +main.multi_update : Modified in 10.3.16 +main.multi_update_debug : Added in 10.3.16 +main.multi_update_innodb : Modified in 10.3.16 main.mysql_client_test : MDEV-19369 - error: 5888, status: 23, errno: 2 main.mysql_client_test_comp : MDEV-16641 - Error in exec main.mysql_client_test_nonblock : CONC-208 - Error on Power; MDEV-15096 - exec failed -main.mysqldump : MDEV-14800 - Stack smashing detected +main.mysqldump : MDEV-14800 - Stack smashing detected; modified in 10.3.16 main.mysqldump-compat : Modified in 10.3.15 main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug main.mysqlslap : MDEV-11801 - timeout @@ -374,12 +363,11 @@ main.mysqltest : MDEV-13887 main.mysql_upgrade_noengine : MDEV-14355 - Wrong result main.mysql_upgrade_ssl : MDEV-13492 - Unknown SSL error main.olap : Modified in 10.3.15 -main.old-mode : MDEV-19373 - Wrong result; modified in 10.3.14 +main.old-mode : MDEV-19373 - Wrong result main.openssl_1 : MDEV-13492 - Unknown SSL error main.openssl_6975 : MDEV-17184 - Failures with OpenSSL 1.1.1 -main.order_by : Modified in 10.3.15 +main.order_by : Modified in 10.3.16 main.order_by_optimizer_innodb : MDEV-10683 - Wrong result -main.partition : Modified in 10.3.14 main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock main.partition_innodb : Modified in 10.3.15 main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings @@ -389,52 +377,46 @@ main.ps : MDEV-11017 main.query_cache_debug : MDEV-15281 - Query cache is disabled main.query_cache : MDEV-16180 - Wrong result main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away -main.reopen_temp_table : Modified in 10.3.14 main.set_statement : MDEV-13183 - Wrong result main.set_statement_notembedded : MDEV-19414 - Wrong result main.shm : MDEV-12727 - Mismatch, ERROR 2013 -main.show_check : Modified in 10.3.14 main.show_explain : MDEV-10674 - Wrong result code -main.show_explain_ps : Modified in 10.3.14 main.sp : MDEV-7866 - Mismatch; modified in 10.3.15 -main.sp_notembedded : MDEV-10607 - internal error; modified in 10.3.14 +main.sp_notembedded : MDEV-10607 - internal error main.sp-security : MDEV-10607 - sporadic "can't connect" -main.sp_trans : Modified in 10.3.14 -main.sp-ucs2 : Modified in 10.3.14 main.ssl : MDEV-17184 - Failures with OpenSSL 1.1.1 main.ssl_ca : MDEV-10895 - SSL connection error on Power main.ssl_cipher : MDEV-17184 - Failures with OpenSSL 1.1.1 main.ssl_connect : MDEV-13492 - Unknown SSL error -main.ssl_crl : MDEV-19119 - Wrong error code; modified in 10.3.14 -main.ssl_crl_clients : Modified in 10.3.14 +main.ssl_crl : MDEV-19119 - Wrong error code main.ssl_timeout : MDEV-11244 - Crash main.ssl_verify_ip : Added in 10.3.15 -main.stat_tables : Modified in 10.3.15 +main.stat_tables : Modified in 10.3.16 main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding main.stat_tables_par : MDEV-13266 - Wrong result main.statistics : Modified in 10.3.15 main.status : MDEV-13255 - Wrong result main.status2 : Modified in 10.3.15 main.subselect_innodb : MDEV-10614 - Wrong result -main.subselect_sj : Modified in 10.3.14 +main.subselect_no_semijoin : Modified in 10.3.16 +main.subselect_sj : Modified in 10.3.16 +main.subselect_sj_mat : Modified in 10.3.16 main.table_value_constr : Modified in 10.3.15 main.tc_heuristic_recover : MDEV-14189 - Wrong result +main.temp_table : Modified in 10.3.16 main.timezone2 : Modified in 10.3.15 main.trigger : Modified in 10.3.15 +main.trigger_null-8605 : Modified in 10.3.16 main.type_bit : Modified in 10.3.15 -main.type_blob : MDEV-15195 - Wrong result; modified in 10.3.14 +main.type_blob : MDEV-15195 - Wrong result main.type_date : Modified in 10.3.15 main.type_datetime_hires : MDEV-10687 - Timeout -main.type_decimal : Modified in 10.3.14 -main.type_year : Modified in 10.3.14 -main.union : Modified in 10.3.14 -main.update : Modified in 10.3.14 +main.type_float : Modified in 10.3.16 main.update_innodb : Modified in 10.3.15 -main.userstat : MDEV-12904 - SSL errors; modified in 10.3.14 -main.view : Modified in 10.3.14 +main.userstat : MDEV-12904 - SSL errors main.view_grant : Modified in 10.3.15 main.wait_timeout : MDEV-19023 - Lost connection to MySQL server during query -main.win : Modified in 10.3.15 +main.win : Modified in 10.3.16 main.xa : MDEV-11769 - lock wait timeout #----------------------------------------------------------------------- @@ -442,11 +424,10 @@ main.xa : MDEV-11769 maria.insert_select : MDEV-12757 - Timeout maria.insert_select-7314 : MDEV-16492 - Timeout maria.maria : MDEV-14430 - Extra warning -maria.maria-recovery : Modified in 10.3.14 #----------------------------------------------------------------------- -mariabackup.absolute_ibdata_paths : MDEV-16571 - Wrong result; modified in 10.3.14 +mariabackup.absolute_ibdata_paths : MDEV-16571 - Wrong result mariabackup.apply-log-only : MDEV-14192 - Assertion failure mariabackup.apply-log-only-incr : MDEV-14192 - Assertion failure mariabackup.backup_grants : Modified in 10.3.15 @@ -454,22 +435,19 @@ mariabackup.backup_ssl : MDEV-14192 mariabackup.create_with_data_directory_during_backup : MDEV-14192 - Assertion failure mariabackup.data_directory : MDEV-15270 - Error on exec mariabackup.drop_table_during_backup : MDEV-14192 - Assertion failure -mariabackup.encrypted_page_compressed : Modified in 10.3.14 -mariabackup.encrypted_page_corruption : Modified in 10.3.14 mariabackup.full_backup : MDEV-16571 - Wrong result mariabackup.huge_lsn : MDEV-15662 - Sequence number is in the future; MDEV-18569 - Table doesn't exist mariabackup.incremental_backup : MDEV-14192 - Assertion failure mariabackup.incremental_encrypted : MDEV-15667 - timeout mariabackup.innodb_log_optimize_ddl : MDEV-14192 - Assertion failure -mariabackup.log_checksum_mismatch : MDEV-16571 - Wrong result; modified in 10.3.14 +mariabackup.log_checksum_mismatch : MDEV-16571 - Wrong result mariabackup.mdev-14447 : MDEV-15201 - Timeout mariabackup.mlog_index_load : MDEV-14192 - Assertion failure -mariabackup.page_compression_level : Added in 10.3.14 mariabackup.partial_exclude : MDEV-15270 - Error on exec mariabackup.rename_during_backup : MDEV-14192 - Assertion failure mariabackup.rename_during_mdl_lock : MDEV-14192 - Assertion failure mariabackup.system_versioning : MDEV-14192 - Assertion failure -mariabackup.unencrypted_page_compressed : MDEV-18653 - Wrong error; modified in 10.3.14 +mariabackup.unencrypted_page_compressed : MDEV-18653 - Wrong error mariabackup.unsupported_redo : MDEV-14192 - Crash mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault mariabackup.xb_file_key_management : MDEV-16571 - Wrong result @@ -484,7 +462,6 @@ mroonga/storage.column_datetime_32bit_2038 : Wrong resul mroonga/storage.column_datetime_32bit_before_unix_epoch : Wrong result on Alpha mroonga/storage.column_datetime_32bit_max : Wrong result on Alpha mroonga/storage.column_datetime_32bit_out_of_range : Wrong result on Alpha -mroonga/storage.column_generated_stored_add_column : Modified in 10.3.14 mroonga/storage.index_multiple_column_unique_date_32bit_equal : Wrong result on Alpha mroonga/storage.index_multiple_column_unique_date_order_32bit_desc : Wrong result on Alpha mroonga/storage.index_multiple_column_unique_datetime_index_read : MDEV-8643 - Valgrind @@ -510,7 +487,6 @@ parts.partition_alter1_2_innodb : MDEV-18655 parts.partition_alter2_2_maria : MDEV-14364 - Lost connection to MySQL server during query parts.partition_auto_increment_archive : MDEV-16491 - Marked as crashed and should be repaired parts.partition_auto_increment_maria : MDEV-14430 - Extra warning -parts.partition_auto_increment_max : Added in 10.3.14 parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket; MDEV-15095 - Table doesn't exist parts.partition_exch_qa_10 : MDEV-11765 - wrong result parts.partition_innodb_status_file : MDEV-12901 - Valgrind @@ -547,6 +523,7 @@ perfschema_stress.* : MDEV-10996 #----------------------------------------------------------------------- +plugins.feedback_plugin_load : Modified in 10.3.16 plugins.feedback_plugin_send : MDEV-7932, MDEV-11118 - Connection problems and such plugins.pam : Modified in 10.3.15 plugins.processlist : MDEV-16574 - Wrong result @@ -568,8 +545,29 @@ rocksdb.drop_table : MDEV-14308 rocksdb.drop_table3 : MDEV-16949 - Server crash rocksdb.dup_key_update : MDEV-17284 - Wrong result rocksdb.innodb_i_s_tables_disabled : Added in 10.3.15 -rocksdb.locking_issues : MDEV-14464 - Wrong result +rocksdb.locking_issues : MDEV-14464 - Wrong result; modified in 10.3.16 +rocksdb.locking_issues_case1_1_rc : Added in 10.3.16 +rocksdb.locking_issues_case1_1_rr : Added in 10.3.16 +rocksdb.locking_issues_case1_2_rc : Added in 10.3.16 +rocksdb.locking_issues_case1_2_rr : Added in 10.3.16 +rocksdb.locking_issues_case2_rc : Added in 10.3.16 +rocksdb.locking_issues_case2_rc_lsr : Added in 10.3.16 +rocksdb.locking_issues_case2_rr : Added in 10.3.16 +rocksdb.locking_issues_case2_rr_lsr : Added in 10.3.16 +rocksdb.locking_issues_case3_rc : Added in 10.3.16 +rocksdb.locking_issues_case3_rr : Added in 10.3.16 +rocksdb.locking_issues_case4_rc : Added in 10.3.16 +rocksdb.locking_issues_case4_rr : Added in 10.3.16 +rocksdb.locking_issues_case5_rc : Added in 10.3.16 +rocksdb.locking_issues_case5_rr : Added in 10.3.16 +rocksdb.locking_issues_case6_rc : Added in 10.3.16 +rocksdb.locking_issues_case6_rr : Added in 10.3.16 +rocksdb.locking_issues_case7_rc : Added in 10.3.16 +rocksdb.locking_issues_case7_rc_lsr : Added in 10.3.16 +rocksdb.locking_issues_case7_rr : Added in 10.3.16 +rocksdb.locking_issues_case7_rr_lsr : Added in 10.3.16 rocksdb.mariadb_ignore_dirs : MDEV-16639 - Server crash +rocksdb.mariadb_plugin : Modified in 10.3.16 rocksdb.mariadb_port_fixes : MDEV-16387 - Wrong plan rocksdb.max_open_files : MDEV-16639 - Server crash rocksdb.perf_context : MDEV-17285 - Wrong results @@ -612,8 +610,11 @@ rpl.last_insert_id : MDEV-10625 rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log +rpl.rpl_binlog_dup_entry : Added in 10.3.16 rpl.rpl_binlog_errors : MDEV-12742 - Crash rpl.rpl_binlog_index : MDEV-9501 - Failed registering on master +rpl.rpl_blackhole : Modified in 10.3.16 +rpl.rpl_blackhole_row_annotate : Added in 10.3.16 rpl.rpl_colSize : MDEV-16112 - Server crash rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac rpl.rpl_ddl : MDEV-10417 - Fails on Mips @@ -628,7 +629,6 @@ rpl.rpl_gtid_basic : MDEV-10681 rpl.rpl_gtid_crash : MDEV-9501 - Failed registering on master, MDEV-13643 - Lost connection rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash -rpl.rpl_gtid_excess_initial_delay : Added in 10.3.14 rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings rpl.rpl_gtid_reconnect : MDEV-14497 - Crash rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings @@ -658,7 +658,6 @@ rpl.rpl_parallel_retry : MDEV-11119 rpl.rpl_parallel_temptable : MDEV-10356 - Crash; MDEV-19076 - Wrong result rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings -rpl.rpl_rewrt_db : Modified in 10.3.14 rpl.rpl_row_001 : MDEV-16653 - MTR's internal check fails rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed @@ -667,12 +666,14 @@ rpl.rpl_row_img_blobs : MDEV-13875 rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed rpl.rpl_row_index_choice : MDEV-15196 - Slave crash +rpl.rpl_row_mysqlbinlog : Modified in 10.3.16 rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x rpl.rpl_row_until : MDEV-14052 - Master will not send events with checksum rpl.rpl_semi_sync : MDEV-11220 - Wrong result rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings +rpl.rpl_semi_sync_skip_repl : Modified in 10.3.16 rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Assorted failures rpl.rpl_semi_sync_wait_no_slave : Added in 10.3.15 rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition @@ -681,7 +682,6 @@ rpl.rpl_set_statement_default_master : MDEV-13258 rpl.rpl_show_slave_hosts : MDEV-10681 - Crash rpl.rpl_skip_replication : MDEV-13258 - Extra warning rpl.rpl_slave_grp_exec : MDEV-10514 - Deadlock -rpl.rpl_slave_invalid_external_user : Added in 10.3.14 rpl.rpl_slave_load_tmpdir_not_exist : MDEV-14203 - Extra warning rpl.rpl_slow_query_log : MDEV-13250 - Test abort rpl.rpl_sp_effects : MDEV-13249 - Crash @@ -746,12 +746,9 @@ sys_vars.innodb_buffer_pool_dump_at_shutdown_basic : MDEV-14280 sys_vars.innodb_ft_result_cache_limit : Modified in 10.3.15 sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash -sys_vars.max_prepared_stmt_count_func : Modified in 10.3.14 sys_vars.rpl_init_slave_func : MDEV-10149 - Test assertion sys_vars.slow_query_log_func : MDEV-14273 - Wrong result -sys_vars.sql_buffer_result_func : Modified in 10.3.14 sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result -sys_vars.thread_stack_basic : Modified in 10.3.14 sys_vars.wait_timeout_func : MDEV-12896 - Wrong result sys_vars.wsrep_provider_basic : MDEV-19457 - Assertion failure @@ -828,18 +825,16 @@ vcol.not_supported : MDEV-10639 vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout vcol.vcol_keys_myisam : Modified in 10.3.15 vcol.vcol_misc : MDEV-16651 - Wrong error message; modified in 10.3.15 -vcol.wrong_arena : Modified in 10.3.14 #----------------------------------------------------------------------- -versioning.alter : Modified in 10.3.14 -versioning.foreign : Modified in 10.3.14 -versioning.partition : Modified in 10.3.14 -versioning.partition_innodb : Modified in 10.3.14 -versioning.rpl : Modified in 10.3.14 -versioning.rpl_row : Added in 10.3.14 -versioning.trx_id : Modified in 10.3.14 -versioning.update : Modified in 10.3.14 +versioning.create : Modified in 10.3.16 +versioning.engines : New combination added in 10.3.16 +versioning.partition : Modified in 10.3.16 +versioning.replace : Modified in 10.3.16 +versioning.rpl : Modified in 10.3.16 +versioning.simple : MDEV-19767 - Wrong result with embedded server; modified in 10.3.16 +versioning.update-big : Added in 10.3.16 #----------------------------------------------------------------------- @@ -850,4 +845,5 @@ wsrep.variables : MDEV-14311 #----------------------------------------------------------------------- +wsrep_info.* : Config file modified in 10.3.16 wsrep_info.plugin : MDEV-13569 - No nodes coming from prim view From c02d6164fbdd5effe758a61d9bb709c581fefef1 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sat, 15 Jun 2019 14:46:25 +0300 Subject: [PATCH 03/22] MDEV-19771 REPLACE on table with virtual_field can cause crash Fixes also MDEV-17837 Problem was that we did not ignore warnings from virtual fields when updated virtual fields for to-be-replaced row. --- mysql-test/suite/vcol/r/vcol_misc.result | 38 +++++++++++++++++++++ mysql-test/suite/vcol/t/vcol_misc.test | 42 +++++++++++++++++++++--- sql/sql_insert.cc | 3 ++ 3 files changed, 79 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 291a954baf6..8716e39eb82 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -423,5 +423,43 @@ ERROR HY000: Incorrect information in file: './test/t1.frm' ALTER TABLE t1; ERROR HY000: Incorrect information in file: './test/t1.frm' # +# MDEV-19771 REPLACE on table with virtual_field can cause crash in set_ok_status() + +create or replace table t1 (pk int primary key, col_bit bit(15) default null, +vcol_bit bit(10) GENERATED ALWAYS AS (`col_bit`) VIRTUAL); +replace INTO `t1` (`pk`,col_bit) VALUES (99,1000); +select pk, col_bit+0, vcol_bit+0 from t1; +pk col_bit+0 vcol_bit+0 +99 1000 1000 +replace INTO `t1` (`pk`,col_bit) VALUES (99,10000); +select pk, col_bit+0, vcol_bit+0 from t1; +pk col_bit+0 vcol_bit+0 +99 10000 1023 +REPLACE LOW_PRIORITY INTO `t1` (`pk`) VALUES (99); +Warnings: +Warning 1264 Out of range value for column 'vcol_bit' at row 1 +drop table t1; +# +# MDEV-17837 REPLACE on table with virtual_field can cause crash in set_ok_status() +# +SET @old_sql_mode=@@sql_mode; +SET sql_mode= STRICT_ALL_TABLES; +CREATE TABLE t1 ( +pk INT, +i TINYINT, +vi TINYINT AS (i+1) PERSISTENT, +PRIMARY KEY(pk) +); +INSERT INTO t1 (pk,i) VALUES (1,1); +TRUNCATE TABLE t1; +INSERT IGNORE INTO t1 (pk,i) VALUES (1,127); +Warnings: +Warning 1264 Out of range value for column 'vi' at row 1 +REPLACE INTO t1 (pk,i) VALUES (1,2); +Warnings: +Warning 1264 Out of range value for column 'vi' at row 1 +DROP TABLE t1; +SET @sql_mode=@old_sql_mode; +# # End of 10.2 tests # diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index 255621845fb..1de2827efe6 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -215,12 +215,12 @@ drop table t1; create table t1 (a int, b int); insert into t1 values (3, 30), (4, 20), (1, 20); create table t2 (c int, d int, v int as (d+1), index idx(c)); -insert into t2(c,d) values +insert into t2(c,d) values (20, 100), (20, 300), (30, 100), (30, 200), (40, 500), - (70, 100), (40, 300), (60, 100), (40, 100), (70, 100); -insert into t2(c,d) values + (70, 100), (40, 300), (60, 100), (40, 100), (70, 100); +insert into t2(c,d) values (120, 100), (150, 300), (130, 100), (130, 200), (140, 500), - (170, 100), (180, 300), (160, 100), (40, 100), (170, 100); + (170, 100), (180, 300), (160, 100), (40, 100), (170, 100); set join_cache_level=6; explain @@ -391,6 +391,40 @@ SHOW CREATE TABLE t1; ALTER TABLE t1; --remove_file $MYSQLD_DATADIR/test/t1.frm +--echo # +--echo # MDEV-19771 REPLACE on table with virtual_field can cause crash in set_ok_status() +--echo + +create or replace table t1 (pk int primary key, col_bit bit(15) default null, + vcol_bit bit(10) GENERATED ALWAYS AS (`col_bit`) VIRTUAL); +replace INTO `t1` (`pk`,col_bit) VALUES (99,1000); +select pk, col_bit+0, vcol_bit+0 from t1; +replace INTO `t1` (`pk`,col_bit) VALUES (99,10000); +select pk, col_bit+0, vcol_bit+0 from t1; +REPLACE LOW_PRIORITY INTO `t1` (`pk`) VALUES (99); +drop table t1; + +--echo # +--echo # MDEV-17837 REPLACE on table with virtual_field can cause crash in set_ok_status() +--echo # + +SET @old_sql_mode=@@sql_mode; +SET sql_mode= STRICT_ALL_TABLES; + +CREATE TABLE t1 ( + pk INT, + i TINYINT, + vi TINYINT AS (i+1) PERSISTENT, + PRIMARY KEY(pk) +); + +INSERT INTO t1 (pk,i) VALUES (1,1); +TRUNCATE TABLE t1; +INSERT IGNORE INTO t1 (pk,i) VALUES (1,127); +REPLACE INTO t1 (pk,i) VALUES (1,2); +DROP TABLE t1; +SET @sql_mode=@old_sql_mode; + --echo # --echo # End of 10.2 tests --echo # diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 2502be7e454..e2e7454803b 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1747,12 +1747,15 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) } if (table->vfield) { + my_bool abort_on_warning= thd->abort_on_warning; /* We have not yet called update_virtual_fields(VOL_UPDATE_FOR_READ) in handler methods for the just read row in record[1]. */ table->move_fields(table->field, table->record[1], table->record[0]); + thd->abort_on_warning= 0; table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_REPLACE); + thd->abort_on_warning= abort_on_warning; table->move_fields(table->field, table->record[0], table->record[1]); } if (info->handle_duplicates == DUP_UPDATE) From 95d783af62202623dc8fe1fb75dc441652c3e48b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 15 Jun 2019 21:30:44 +0200 Subject: [PATCH 04/22] fix versioning.simple for embedded --- mysql-test/suite/versioning/r/simple.result | 217 ++++++++++---------- mysql-test/suite/versioning/t/simple.test | 2 +- 2 files changed, 107 insertions(+), 112 deletions(-) diff --git a/mysql-test/suite/versioning/r/simple.result b/mysql-test/suite/versioning/r/simple.result index 6a4ea469d1c..df47f80c9e9 100644 --- a/mysql-test/suite/versioning/r/simple.result +++ b/mysql-test/suite/versioning/r/simple.result @@ -86,120 +86,115 @@ b timestamp(6) YES NULL VIRTUAL GENERATED c timestamp(6) YES NULL STORED GENERATED d timestamp(6) NO NULL STORED GENERATED e timestamp(6) NO NULL STORED GENERATED -select *,'---' from information_schema.columns where table_name='t1'; -TABLE_CATALOG def -TABLE_SCHEMA test -TABLE_NAME t1 -COLUMN_NAME a -ORDINAL_POSITION 1 -COLUMN_DEFAULT current_timestamp(6) -IS_NULLABLE NO -DATA_TYPE timestamp -CHARACTER_MAXIMUM_LENGTH NULL -CHARACTER_OCTET_LENGTH NULL -NUMERIC_PRECISION NULL -NUMERIC_SCALE NULL -DATETIME_PRECISION 6 -CHARACTER_SET_NAME NULL -COLLATION_NAME NULL -COLUMN_TYPE timestamp(6) -COLUMN_KEY -EXTRA on update current_timestamp(6) -PRIVILEGES select,insert,update,references -COLUMN_COMMENT -IS_GENERATED NEVER -GENERATION_EXPRESSION NULL +select table_catalog,table_schema,table_name,column_name,ordinal_position,column_default,is_nullable,data_type,character_maximum_length,character_octet_length,numeric_precision,numeric_scale,datetime_precision,character_set_name,collation_name,column_type,column_key,extra,column_comment,is_generated,generation_expression,'---' from information_schema.columns where table_name='t1'; +table_catalog def +table_schema test +table_name t1 +column_name a +ordinal_position 1 +column_default current_timestamp(6) +is_nullable NO +data_type timestamp +character_maximum_length NULL +character_octet_length NULL +numeric_precision NULL +numeric_scale NULL +datetime_precision 6 +character_set_name NULL +collation_name NULL +column_type timestamp(6) +column_key +extra on update current_timestamp(6) +column_comment +is_generated NEVER +generation_expression NULL --- --- -TABLE_CATALOG def -TABLE_SCHEMA test -TABLE_NAME t1 -COLUMN_NAME b -ORDINAL_POSITION 2 -COLUMN_DEFAULT NULL -IS_NULLABLE YES -DATA_TYPE timestamp -CHARACTER_MAXIMUM_LENGTH NULL -CHARACTER_OCTET_LENGTH NULL -NUMERIC_PRECISION NULL -NUMERIC_SCALE NULL -DATETIME_PRECISION 6 -CHARACTER_SET_NAME NULL -COLLATION_NAME NULL -COLUMN_TYPE timestamp(6) -COLUMN_KEY -EXTRA VIRTUAL GENERATED -PRIVILEGES select,insert,update,references -COLUMN_COMMENT -IS_GENERATED ALWAYS -GENERATION_EXPRESSION `a` + interval 1 day +table_catalog def +table_schema test +table_name t1 +column_name b +ordinal_position 2 +column_default NULL +is_nullable YES +data_type timestamp +character_maximum_length NULL +character_octet_length NULL +numeric_precision NULL +numeric_scale NULL +datetime_precision 6 +character_set_name NULL +collation_name NULL +column_type timestamp(6) +column_key +extra VIRTUAL GENERATED +column_comment +is_generated ALWAYS +generation_expression `a` + interval 1 day --- --- -TABLE_CATALOG def -TABLE_SCHEMA test -TABLE_NAME t1 -COLUMN_NAME c -ORDINAL_POSITION 3 -COLUMN_DEFAULT NULL -IS_NULLABLE YES -DATA_TYPE timestamp -CHARACTER_MAXIMUM_LENGTH NULL -CHARACTER_OCTET_LENGTH NULL -NUMERIC_PRECISION NULL -NUMERIC_SCALE NULL -DATETIME_PRECISION 6 -CHARACTER_SET_NAME NULL -COLLATION_NAME NULL -COLUMN_TYPE timestamp(6) -COLUMN_KEY -EXTRA STORED GENERATED -PRIVILEGES select,insert,update,references -COLUMN_COMMENT -IS_GENERATED ALWAYS -GENERATION_EXPRESSION `a` + interval 1 month +table_catalog def +table_schema test +table_name t1 +column_name c +ordinal_position 3 +column_default NULL +is_nullable YES +data_type timestamp +character_maximum_length NULL +character_octet_length NULL +numeric_precision NULL +numeric_scale NULL +datetime_precision 6 +character_set_name NULL +collation_name NULL +column_type timestamp(6) +column_key +extra STORED GENERATED +column_comment +is_generated ALWAYS +generation_expression `a` + interval 1 month --- --- -TABLE_CATALOG def -TABLE_SCHEMA test -TABLE_NAME t1 -COLUMN_NAME d -ORDINAL_POSITION 4 -COLUMN_DEFAULT NULL -IS_NULLABLE NO -DATA_TYPE timestamp -CHARACTER_MAXIMUM_LENGTH NULL -CHARACTER_OCTET_LENGTH NULL -NUMERIC_PRECISION NULL -NUMERIC_SCALE NULL -DATETIME_PRECISION 6 -CHARACTER_SET_NAME NULL -COLLATION_NAME NULL -COLUMN_TYPE timestamp(6) -COLUMN_KEY -EXTRA STORED GENERATED -PRIVILEGES select,insert,update,references -COLUMN_COMMENT -IS_GENERATED ALWAYS -GENERATION_EXPRESSION ROW START +table_catalog def +table_schema test +table_name t1 +column_name d +ordinal_position 4 +column_default NULL +is_nullable NO +data_type timestamp +character_maximum_length NULL +character_octet_length NULL +numeric_precision NULL +numeric_scale NULL +datetime_precision 6 +character_set_name NULL +collation_name NULL +column_type timestamp(6) +column_key +extra STORED GENERATED +column_comment +is_generated ALWAYS +generation_expression ROW START --- --- -TABLE_CATALOG def -TABLE_SCHEMA test -TABLE_NAME t1 -COLUMN_NAME e -ORDINAL_POSITION 5 -COLUMN_DEFAULT NULL -IS_NULLABLE NO -DATA_TYPE timestamp -CHARACTER_MAXIMUM_LENGTH NULL -CHARACTER_OCTET_LENGTH NULL -NUMERIC_PRECISION NULL -NUMERIC_SCALE NULL -DATETIME_PRECISION 6 -CHARACTER_SET_NAME NULL -COLLATION_NAME NULL -COLUMN_TYPE timestamp(6) -COLUMN_KEY -EXTRA STORED GENERATED -PRIVILEGES select,insert,update,references -COLUMN_COMMENT -IS_GENERATED ALWAYS -GENERATION_EXPRESSION ROW END +table_catalog def +table_schema test +table_name t1 +column_name e +ordinal_position 5 +column_default NULL +is_nullable NO +data_type timestamp +character_maximum_length NULL +character_octet_length NULL +numeric_precision NULL +numeric_scale NULL +datetime_precision 6 +character_set_name NULL +collation_name NULL +column_type timestamp(6) +column_key +extra STORED GENERATED +column_comment +is_generated ALWAYS +generation_expression ROW END --- --- drop table t1; diff --git a/mysql-test/suite/versioning/t/simple.test b/mysql-test/suite/versioning/t/simple.test index be795577702..b550b3967d9 100644 --- a/mysql-test/suite/versioning/t/simple.test +++ b/mysql-test/suite/versioning/t/simple.test @@ -84,6 +84,6 @@ create table t1 ( period for system_time(d,e) ) with system versioning; show columns from t1; -query_vertical select *,'---' from information_schema.columns where table_name='t1'; +query_vertical select table_catalog,table_schema,table_name,column_name,ordinal_position,column_default,is_nullable,data_type,character_maximum_length,character_octet_length,numeric_precision,numeric_scale,datetime_precision,character_set_name,collation_name,column_type,column_key,extra,column_comment,is_generated,generation_expression,'---' from information_schema.columns where table_name='t1'; drop table t1; From 9dd72bbfb078fbd31676eb8685065b9ef2d72c18 Mon Sep 17 00:00:00 2001 From: Daniel Bartholomew Date: Sat, 15 Jun 2019 16:54:02 -0400 Subject: [PATCH 05/22] bump the VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2143ac61009..748fcaa7c2b 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=2 -MYSQL_VERSION_PATCH=25 +MYSQL_VERSION_PATCH=26 From 2b0eb352b3850666950df03ccc5559e06bb646e6 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Sun, 16 Jun 2019 12:12:00 +0300 Subject: [PATCH 06/22] Trivial test result update after fix for MDEV-19771 --- mysql-test/suite/vcol/r/vcol_misc.result | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 8716e39eb82..d0fa2415b77 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -203,10 +203,10 @@ drop table t1; create table t1 (a int, b int); insert into t1 values (3, 30), (4, 20), (1, 20); create table t2 (c int, d int, v int as (d+1), index idx(c)); -insert into t2(c,d) values +insert into t2(c,d) values (20, 100), (20, 300), (30, 100), (30, 200), (40, 500), (70, 100), (40, 300), (60, 100), (40, 100), (70, 100); -insert into t2(c,d) values +insert into t2(c,d) values (120, 100), (150, 300), (130, 100), (130, 200), (140, 500), (170, 100), (180, 300), (160, 100), (40, 100), (170, 100); set join_cache_level=6; @@ -441,10 +441,10 @@ Warning 1264 Out of range value for column 'vcol_bit' at row 1 drop table t1; # # MDEV-17837 REPLACE on table with virtual_field can cause crash in set_ok_status() -# +# SET @old_sql_mode=@@sql_mode; SET sql_mode= STRICT_ALL_TABLES; -CREATE TABLE t1 ( +CREATE TABLE t1 ( pk INT, i TINYINT, vi TINYINT AS (i+1) PERSISTENT, From 93c84cc8f24d80a74919d1609d73cb97502fd885 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Sat, 15 Jun 2019 19:55:57 +0300 Subject: [PATCH 07/22] MDEV-17045: MyRocks tables cannot be updated when binlog_format=MIXED. --- storage/rocksdb/ha_rocksdb.cc | 53 ++++++++++++++----- storage/rocksdb/ha_rocksdb.h | 26 +-------- .../rocksdb/r/mariadb_misc_binlog.result | 11 +++- .../mysql-test/rocksdb/r/rpl_statement.result | 4 +- .../rocksdb/t/mariadb_misc_binlog.test | 12 ++++- .../mysql-test/rocksdb/t/rpl_statement.test | 4 +- 6 files changed, 65 insertions(+), 45 deletions(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 3331b94c62c..cb289fb0077 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -11025,6 +11025,41 @@ void ha_rocksdb::read_thd_vars(THD *const thd) { m_checksums_pct = THDVAR(thd, checksums_pct); } +ulonglong ha_rocksdb::table_flags() const +{ + DBUG_ENTER_FUNC(); + + /* + HA_BINLOG_STMT_CAPABLE + Upstream: MyRocks advertises itself as it supports SBR, but has additional + checks in ha_rocksdb::external_lock()/ start_stmt() which will return an + error if one tries to run the statement. + Exceptions: @@rocksdb_unsafe_for_binlog or we are an SQL slave thread. + + MariaDB: Inform the upper layer we don't support SBR, so it switches to RBR + if possible. The exceptions are the same as with the upstream. + + HA_REC_NOT_IN_SEQ + If we don't set it, filesort crashes, because it assumes rowids are + 1..8 byte numbers + HA_PRIMARY_KEY_IN_READ_INDEX + This flag is always set, even for tables that: + - have no PK + - have some (or all) of PK that can't be decoded from the secondary + index. + */ + THD *thd= ha_thd(); + DBUG_RETURN(HA_BINLOG_ROW_CAPABLE | + ((thd && (THDVAR(thd, unsafe_for_binlog) ||thd->rgi_slave))? + HA_BINLOG_STMT_CAPABLE : 0) | + HA_REC_NOT_IN_SEQ | HA_CAN_INDEX_BLOBS | + HA_PRIMARY_KEY_IN_READ_INDEX | + HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | HA_NULL_IN_KEY | + HA_PARTIAL_COLUMN_READ | + HA_TABLE_SCAN_ON_INDEX); +} + + /** @return @@ -11037,6 +11072,9 @@ int ha_rocksdb::external_lock(THD *const thd, int lock_type) { DBUG_ASSERT(thd != nullptr); int res = HA_EXIT_SUCCESS; +#if 0 + // MariaDB uses a different way to implement this, see ha_rocksdb::table_flags + int binlog_format = my_core::thd_binlog_format(thd); bool unsafe_for_binlog = THDVAR(ha_thd(), unsafe_for_binlog); @@ -11065,6 +11103,7 @@ int ha_rocksdb::external_lock(THD *const thd, int lock_type) { my_error(ER_REQUIRE_ROW_BINLOG_FORMAT, MYF(0)); DBUG_RETURN(HA_ERR_UNSUPPORTED); } +#endif if (lock_type == F_UNLCK) { Rdb_transaction *const tx = get_tx_from_thd(thd); @@ -11167,20 +11206,6 @@ int ha_rocksdb::external_lock(THD *const thd, int lock_type) { int ha_rocksdb::start_stmt(THD *const thd, thr_lock_type lock_type) { DBUG_ENTER_FUNC(); - /* - MariaDB: the following is a copy of the check in ha_rocksdb::external_lock: - */ - int binlog_format = my_core::thd_binlog_format(thd); - bool unsafe_for_binlog = THDVAR(ha_thd(), unsafe_for_binlog); - if (lock_type >= TL_WRITE_ALLOW_WRITE && - !thd->rgi_slave && !unsafe_for_binlog && - binlog_format != BINLOG_FORMAT_ROW && - binlog_format != BINLOG_FORMAT_UNSPEC && - my_core::thd_binlog_filter_ok(thd)) { - my_error(ER_REQUIRE_ROW_BINLOG_FORMAT, MYF(0)); - DBUG_RETURN(HA_ERR_UNSUPPORTED); - } - DBUG_ASSERT(thd != nullptr); Rdb_transaction *const tx = get_or_create_tx(thd); diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h index aae823fe4e1..a48d745fcf2 100644 --- a/storage/rocksdb/ha_rocksdb.h +++ b/storage/rocksdb/ha_rocksdb.h @@ -863,31 +863,7 @@ public: This is a list of flags that indicate what functionality the storage engine implements. The current table flags are documented in handler.h */ - ulonglong table_flags() const override { - DBUG_ENTER_FUNC(); - - /* - HA_BINLOG_STMT_CAPABLE - We are saying that this engine is just statement capable to have - an engine that can only handle statement-based logging. This is - used in testing. - HA_REC_NOT_IN_SEQ - If we don't set it, filesort crashes, because it assumes rowids are - 1..8 byte numbers - HA_PRIMARY_KEY_IN_READ_INDEX - This flag is always set, even for tables that: - - have no PK - - have some (or all) of PK that can't be decoded from the secondary - index. - */ - DBUG_RETURN(HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | - HA_REC_NOT_IN_SEQ | HA_CAN_INDEX_BLOBS | - HA_PRIMARY_KEY_IN_READ_INDEX | - HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | HA_NULL_IN_KEY | - HA_PARTIAL_COLUMN_READ | - HA_TABLE_SCAN_ON_INDEX); - } - + ulonglong table_flags() const override ; private: bool init_with_fields(); /* no 'override' in MariaDB */ public: diff --git a/storage/rocksdb/mysql-test/rocksdb/r/mariadb_misc_binlog.result b/storage/rocksdb/mysql-test/rocksdb/r/mariadb_misc_binlog.result index e4ac62aa481..c37ab9461af 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/mariadb_misc_binlog.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/mariadb_misc_binlog.result @@ -18,7 +18,16 @@ set @tmp_bf= @@binlog_format; set binlog_format='STATEMENT'; lock tables t1 write; insert into t1 values(1); -ERROR HY000: Can't execute updates on master with binlog_format != ROW. +ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. unlock tables; set @@binlog_format=@tmp_bf; drop table t1; +# +# MDEV-17045: MyRocks tables cannot be updated when binlog_format=MIXED. +# +set @tmp_bf= @@binlog_format; +set binlog_format='MIXED'; +create table t1 (pk int primary key) engine=rocksdb; +insert into t1 values (1); +drop table t1; +set @@binlog_format=@tmp_bf; diff --git a/storage/rocksdb/mysql-test/rocksdb/r/rpl_statement.result b/storage/rocksdb/mysql-test/rocksdb/r/rpl_statement.result index cdf0c37e339..df1a60519db 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/rpl_statement.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/rpl_statement.result @@ -8,7 +8,7 @@ select @@binlog_format; STATEMENT create table t1 (pk int primary key) engine=rocksdb; insert into t1 values (1),(2),(3); -ERROR HY000: Can't execute updates on master with binlog_format != ROW. +ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. set session rocksdb_unsafe_for_binlog=on; insert into t1 values (1),(2),(3); select * from t1; @@ -19,7 +19,7 @@ pk delete from t1; set session rocksdb_unsafe_for_binlog=off; insert into t1 values (1),(2),(3); -ERROR HY000: Can't execute updates on master with binlog_format != ROW. +ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. set binlog_format=row; insert into t1 values (1),(2),(3); include/sync_slave_sql_with_master.inc diff --git a/storage/rocksdb/mysql-test/rocksdb/t/mariadb_misc_binlog.test b/storage/rocksdb/mysql-test/rocksdb/t/mariadb_misc_binlog.test index fb150f7a791..e32679e88a2 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/mariadb_misc_binlog.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/mariadb_misc_binlog.test @@ -21,10 +21,20 @@ unlock tables; set @tmp_bf= @@binlog_format; set binlog_format='STATEMENT'; lock tables t1 write; ---error ER_REQUIRE_ROW_BINLOG_FORMAT +--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE insert into t1 values(1); unlock tables; set @@binlog_format=@tmp_bf; drop table t1; +--echo # +--echo # MDEV-17045: MyRocks tables cannot be updated when binlog_format=MIXED. +--echo # +set @tmp_bf= @@binlog_format; +set binlog_format='MIXED'; +create table t1 (pk int primary key) engine=rocksdb; +insert into t1 values (1); +drop table t1; +set @@binlog_format=@tmp_bf; + diff --git a/storage/rocksdb/mysql-test/rocksdb/t/rpl_statement.test b/storage/rocksdb/mysql-test/rocksdb/t/rpl_statement.test index 29671308e9c..cb5f5e04b00 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/rpl_statement.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/rpl_statement.test @@ -12,7 +12,7 @@ connection master; select @@binlog_format; create table t1 (pk int primary key) engine=rocksdb; ---error ER_REQUIRE_ROW_BINLOG_FORMAT +--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE insert into t1 values (1),(2),(3); set session rocksdb_unsafe_for_binlog=on; @@ -21,7 +21,7 @@ select * from t1; delete from t1; set session rocksdb_unsafe_for_binlog=off; ---error ER_REQUIRE_ROW_BINLOG_FORMAT +--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE insert into t1 values (1),(2),(3); set binlog_format=row; From 86faa98bd7b8e9dccb0e9b20429069ba9c3f56d7 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Thu, 13 Jun 2019 17:53:57 +0300 Subject: [PATCH 08/22] Removed -fno-rtti from BUILD scripts --- BUILD/SETUP.sh | 2 +- BUILD/compile-dist | 2 +- BUILD/compile-pentium-icc | 2 +- BUILD/compile-pentium-icc-yassl | 2 +- BUILD/compile-pentium-pgcc | 2 +- BUILD/compile-pentium32-icc-valgrind-max | 2 +- BUILD/compile-solaris-sparc | 2 +- BUILD/compile-solaris-sparc-debug | 2 +- BUILD/compile-solaris-sparc-purify | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 2288f149d37..d5b052b9620 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -170,7 +170,7 @@ debug_cflags="-DEXTRA_DEBUG -DSAFE_MUTEX -DSAFEMALLOC" error_inject="--with-error-inject " # # Base C++ flags for all builds -base_cxxflags="-felide-constructors -fexceptions -fno-rtti" +base_cxxflags="-felide-constructors -fexceptions" # # Flags for optimizing builds. # Be as fast as we can be without losing our ability to backtrace. diff --git a/BUILD/compile-dist b/BUILD/compile-dist index 7f4437bf913..64147b7af80 100755 --- a/BUILD/compile-dist +++ b/BUILD/compile-dist @@ -48,7 +48,7 @@ if test -z "$CXX" ; then # Set some required compile options if test -z "$CXXFLAGS" ; then export CXXFLAGS - CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti" + CXXFLAGS="-felide-constructors -fno-exceptions" fi fi diff --git a/BUILD/compile-pentium-icc b/BUILD/compile-pentium-icc index 565b3d51e63..510cbb1abb0 100755 --- a/BUILD/compile-pentium-icc +++ b/BUILD/compile-pentium-icc @@ -34,7 +34,7 @@ extra_flags="$fast_cflags -unroll2 -ip -mp -restrict" # IPO link: can not find "-lstdc++_shared" # icpc: error: problem during multi-file optimization compilation (code 1) extra_flags="$extra_flags -no-ipo" -base_cxxflags="-fno-exceptions -fno-rtti" +base_cxxflags="-fno-exceptions" extra_configs="$pentium_configs $static_link $disable_64_bit_plugins" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-icc-yassl b/BUILD/compile-pentium-icc-yassl index cd4d8dc822e..f5cc27c34f0 100755 --- a/BUILD/compile-pentium-icc-yassl +++ b/BUILD/compile-pentium-icc-yassl @@ -34,7 +34,7 @@ extra_flags="$fast_cflags -unroll2 -ip -mp -restrict" # IPO link: can not find "-lstdc++_shared" # icpc: error: problem during multi-file optimization compilation (code 1) extra_flags="$extra_flags -no-ipo" -base_cxxflags="-fno-exceptions -fno-rtti" +base_cxxflags="-fno-exceptions" extra_configs="$pentium_configs $static_link --with-yassl" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-pgcc b/BUILD/compile-pentium-pgcc index 5b2193c9fe9..b6073d745b1 100755 --- a/BUILD/compile-pentium-pgcc +++ b/BUILD/compile-pentium-pgcc @@ -8,7 +8,7 @@ path=`dirname $0` . "$path/autorun.sh" export PATH=/usr/local/pgcc/bin:$PATH -CFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O6 -mpentiumpro -fomit-frame-pointer -mstack-align-double" CXX=g++ CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O6 -fomit-frame-pointer -mpentiumpro -mstack-align-double" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static +CFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O6 -mpentiumpro -fomit-frame-pointer -mstack-align-double" CXX=g++ CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -O6 -fomit-frame-pointer -mpentiumpro -mstack-align-double" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static gmake -j 4 diff --git a/BUILD/compile-pentium32-icc-valgrind-max b/BUILD/compile-pentium32-icc-valgrind-max index 182028629ac..7d7a1a197ef 100755 --- a/BUILD/compile-pentium32-icc-valgrind-max +++ b/BUILD/compile-pentium32-icc-valgrind-max @@ -57,7 +57,7 @@ extra_flags="$pentium_cflags $debug_cflags $valgrind_flags" c_warnings="-Wall -Wcheck -wd161,444,279,810,981,1292,1469,1572" cxx_warnings="$c_warnings -wd869,874" -base_cxxflags="-fno-exceptions -fno-rtti" +base_cxxflags="-fno-exceptions" extra_configs="$pentium_configs $debug_configs $valgrind_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-solaris-sparc b/BUILD/compile-solaris-sparc index 911d0025a0f..27c611ec73a 100755 --- a/BUILD/compile-solaris-sparc +++ b/BUILD/compile-solaris-sparc @@ -24,6 +24,6 @@ PATH=$PATH:/usr/ccs/bin:/usr/local/bin path=`dirname $0` . "$path/autorun.sh" -CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa $EXTRA_FLAGS $EXTRA_CFLAGS" CXX=g++ CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g $EXTRA_FLAGS $EXTRA_CXXFLAGS" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client +CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa $EXTRA_FLAGS $EXTRA_CFLAGS" CXX=g++ CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g $EXTRA_FLAGS $EXTRA_CXXFLAGS" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client make -j 4 diff --git a/BUILD/compile-solaris-sparc-debug b/BUILD/compile-solaris-sparc-debug index e960039baff..194b4b94a2a 100755 --- a/BUILD/compile-solaris-sparc-debug +++ b/BUILD/compile-solaris-sparc-debug @@ -6,6 +6,6 @@ make -k clean || true path=`dirname $0` . "$path/autorun.sh" -CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer" CXX=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug +CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer" CXX=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -O3 -fno-omit-frame-pointer" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug make -j 4 diff --git a/BUILD/compile-solaris-sparc-purify b/BUILD/compile-solaris-sparc-purify index 22fe5b5616e..a4b7ec63214 100755 --- a/BUILD/compile-solaris-sparc-purify +++ b/BUILD/compile-solaris-sparc-purify @@ -37,7 +37,7 @@ make -k maintainer-clean || true path=`dirname $0` . "$path/autorun.sh" -CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_valgrind -DEXTRA_DEBUG -O2" CXX=g++ CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_valgrind -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-embedded-server --with-innodb $EXTRA_CONFIG_FLAGS +CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_valgrind -DEXTRA_DEBUG -O2" CXX=g++ CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -DHAVE_valgrind -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-embedded-server --with-innodb $EXTRA_CONFIG_FLAGS make -j 4 From fb5ee3ff96dccacea96810a12cff141085ec4218 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Fri, 14 Jun 2019 10:07:23 +0300 Subject: [PATCH 09/22] Fixed that ma_test_all.sh works Updated ma_test1 to reflect the change from MDEV-15458 where ma_write() doesn't update current record position anymore. --- storage/maria/ma_test1.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/maria/ma_test1.c b/storage/maria/ma_test1.c index 6a19366c169..9d739580470 100644 --- a/storage/maria/ma_test1.c +++ b/storage/maria/ma_test1.c @@ -292,6 +292,11 @@ static int run_test(const char *filename) if (!silent) printf("- Updating rows\n"); + create_key(key, j); + if ((maria_rkey(file, read_record, 0, key, + HA_WHOLE_KEY, HA_READ_KEY_EXACT))) + printf("Can't find last written row with maria_rkey\n"); + /* Update first last row to force extend of file */ if (maria_rsame(file,read_record,-1)) { From e9795d0208cd821e2aaef14681556a6e656f551f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Sun, 16 Jun 2019 15:38:05 +0300 Subject: [PATCH 10/22] Add mtr_buf_t::for_each_block_in_reverse() const Avoid unnecessary creation of named objects for invoking mtr_buf_t::for_each_block_in_reverse(). --- storage/innobase/include/dyn0buf.h | 19 ++++++ storage/innobase/mtr/mtr0mtr.cc | 104 ++++++++++++++++------------- 2 files changed, 75 insertions(+), 48 deletions(-) diff --git a/storage/innobase/include/dyn0buf.h b/storage/innobase/include/dyn0buf.h index c7a5c96cd50..a7a8e1dea1e 100644 --- a/storage/innobase/include/dyn0buf.h +++ b/storage/innobase/include/dyn0buf.h @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 2013, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -371,6 +372,24 @@ public: return(true); } + /** + Iterate over all the blocks in reverse and call the iterator + @return false if iteration was terminated. */ + template + bool for_each_block_in_reverse(const Functor& functor) const + { + for (block_t* block = UT_LIST_GET_LAST(m_list); + block != NULL; + block = UT_LIST_GET_PREV(m_node, block)) { + + if (!functor(block)) { + return(false); + } + } + + return(true); + } + /** @return the first block */ block_t* front() diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index 6e9136df644..2d6b03c512c 100644 --- a/storage/innobase/mtr/mtr0mtr.cc +++ b/storage/innobase/mtr/mtr0mtr.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2018, MariaDB Corporation. +Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -37,16 +37,43 @@ Created 11/26/1995 Heikki Tuuri /** Iterate over a memo block in reverse. */ template -struct Iterate { +struct CIterate { + CIterate() : functor() {} - /** Release specific object */ - explicit Iterate(Functor& functor) - : - m_functor(functor) + CIterate(const Functor& functor) : functor(functor) {} + + /** @return false if the functor returns false. */ + bool operator()(mtr_buf_t::block_t* block) const { - /* Do nothing */ + const mtr_memo_slot_t* start = + reinterpret_cast( + block->begin()); + + mtr_memo_slot_t* slot = + reinterpret_cast( + block->end()); + + ut_ad(!(block->used() % sizeof(*slot))); + + while (slot-- != start) { + + if (!functor(slot)) { + return(false); + } + } + + return(true); } + Functor functor; +}; + +template +struct Iterate { + Iterate() : functor() {} + + Iterate(const Functor& functor) : functor(functor) {} + /** @return false if the functor returns false. */ bool operator()(mtr_buf_t::block_t* block) { @@ -62,7 +89,7 @@ struct Iterate { while (slot-- != start) { - if (!m_functor(slot)) { + if (!functor(slot)) { return(false); } } @@ -70,7 +97,7 @@ struct Iterate { return(true); } - Functor& m_functor; + Functor functor; }; /** Find specific object */ @@ -511,12 +538,7 @@ mtr_t::Command::release_resources() /* Currently only used in commit */ ut_ad(m_impl->m_state == MTR_STATE_COMMITTING); -#ifdef UNIV_DEBUG - DebugCheck release; - Iterate iterator(release); - - m_impl->m_memo.for_each_block_in_reverse(iterator); -#endif /* UNIV_DEBUG */ + ut_d(m_impl->m_memo.for_each_block_in_reverse(CIterate())); /* Reset the mtr buffers */ m_impl->m_log.erase(); @@ -739,11 +761,10 @@ mtr_t::memo_release(const void* object, ulint type) middle of a mini-transaction. */ ut_ad(!m_impl.m_modifications || type != MTR_MEMO_PAGE_X_FIX); - Find find(object, type); - Iterate iterator(find); + Iterate iteration(Find(object, type)); - if (!m_impl.m_memo.for_each_block_in_reverse(iterator)) { - memo_slot_release(find.m_slot); + if (!m_impl.m_memo.for_each_block_in_reverse(iteration)) { + memo_slot_release(iteration.functor.m_slot); return(true); } @@ -763,11 +784,10 @@ mtr_t::release_page(const void* ptr, mtr_memo_type_t type) middle of a mini-transaction. */ ut_ad(!m_impl.m_modifications || type != MTR_MEMO_PAGE_X_FIX); - FindPage find(ptr, type); - Iterate iterator(find); + Iterate iteration(FindPage(ptr, type)); - if (!m_impl.m_memo.for_each_block_in_reverse(iterator)) { - memo_slot_release(find.get_slot()); + if (!m_impl.m_memo.for_each_block_in_reverse(iteration)) { + memo_slot_release(iteration.functor.get_slot()); return; } @@ -891,10 +911,7 @@ mtr_t::Command::finish_write( void mtr_t::Command::release_all() { - ReleaseAll release; - Iterate iterator(release); - - m_impl->m_memo.for_each_block_in_reverse(iterator); + m_impl->m_memo.for_each_block_in_reverse(CIterate()); /* Note that we have released the latches. */ m_locks_released = 1; @@ -904,10 +921,7 @@ mtr_t::Command::release_all() void mtr_t::Command::release_latches() { - ReleaseLatches release; - Iterate iterator(release); - - m_impl->m_memo.for_each_block_in_reverse(iterator); + m_impl->m_memo.for_each_block_in_reverse(CIterate()); /* Note that we have released the latches. */ m_locks_released = 1; @@ -917,10 +931,10 @@ mtr_t::Command::release_latches() void mtr_t::Command::release_blocks() { - ReleaseBlocks release(m_start_lsn, m_end_lsn, m_impl->m_flush_observer); - Iterate iterator(release); - - m_impl->m_memo.for_each_block_in_reverse(iterator); + m_impl->m_memo.for_each_block_in_reverse( + CIterate( + ReleaseBlocks(m_start_lsn, m_end_lsn, + m_impl->m_flush_observer))); } /** Write the redo log record, add dirty pages to the flush list and release @@ -997,10 +1011,8 @@ mtr_t::memo_contains( const void* object, ulint type) { - Find find(object, type); - Iterate iterator(find); - - if (memo->for_each_block_in_reverse(iterator)) { + Iterate iteration(Find(object, type)); + if (memo->for_each_block_in_reverse(iteration)) { return(false); } @@ -1089,10 +1101,8 @@ mtr_t::memo_contains_flagged(const void* ptr, ulint flags) const ut_ad(m_impl.m_magic_n == MTR_MAGIC_N); ut_ad(is_committing() || is_active()); - FlaggedCheck check(ptr, flags); - Iterate iterator(check); - - return(!m_impl.m_memo.for_each_block_in_reverse(iterator)); + return !m_impl.m_memo.for_each_block_in_reverse( + CIterate(FlaggedCheck(ptr, flags))); } /** Check if memo contains the given page. @@ -1106,11 +1116,9 @@ mtr_t::memo_contains_page_flagged( const byte* ptr, ulint flags) const { - FindPage check(ptr, flags); - Iterate iterator(check); - - return(m_impl.m_memo.for_each_block_in_reverse(iterator) - ? NULL : check.get_block()); + Iterate iteration(FindPage(ptr, flags)); + return m_impl.m_memo.for_each_block_in_reverse(iteration) + ? NULL : iteration.functor.get_block(); } /** Mark the given latched page as modified. From a94638f1553f5947db6d48bab9e4951356b362a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Sun, 16 Jun 2019 15:54:14 +0300 Subject: [PATCH 11/22] Clarify the purpose of MTR_LOG_NONE --- storage/innobase/include/mtr0types.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/innobase/include/mtr0types.h b/storage/innobase/include/mtr0types.h index 20864c88ac5..1179da6d926 100644 --- a/storage/innobase/include/mtr0types.h +++ b/storage/innobase/include/mtr0types.h @@ -38,7 +38,9 @@ enum mtr_log_t { /** Default mode: log all operations modifying disk-based data */ MTR_LOG_ALL = 21, - /** Log no operations and dirty pages are not added to the flush list */ + /** Log no operations and dirty pages are not added to the flush list. + Set when applying log in crash recovery or when a modification of a + ROW_FORMAT=COMPRESSED page is attempted. */ MTR_LOG_NONE = 22, /** Don't generate REDO log but add dirty pages to flush list */ From 2b660fb4c212973ba0f118b47336b608d091f327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Sun, 16 Jun 2019 15:55:09 +0300 Subject: [PATCH 12/22] mtr_t::is_block_dirtied(): Define inline --- storage/innobase/include/mtr0mtr.h | 2 +- storage/innobase/include/mtr0mtr.ic | 16 +++++++++++++++- storage/innobase/mtr/mtr0mtr.cc | 14 -------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h index d1e0ad6f7a9..4f518071bfb 100644 --- a/storage/innobase/include/mtr0mtr.h +++ b/storage/innobase/include/mtr0mtr.h @@ -550,7 +550,7 @@ struct mtr_t { /** Check if this mini-transaction is dirtying a clean page. @param block block being x-fixed @return true if the mtr is dirtying a clean page. */ - static bool is_block_dirtied(const buf_block_t* block) + static inline bool is_block_dirtied(const buf_block_t* block) MY_ATTRIBUTE((warn_unused_result)); private: diff --git a/storage/innobase/include/mtr0mtr.ic b/storage/innobase/include/mtr0mtr.ic index 984b7b34bcf..574d0de24a5 100644 --- a/storage/innobase/include/mtr0mtr.ic +++ b/storage/innobase/include/mtr0mtr.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -26,6 +26,20 @@ Created 11/26/1995 Heikki Tuuri #include "buf0buf.h" +/** Check if a mini-transaction is dirtying a clean page. +@return true if the mtr is dirtying a clean page. */ +bool +mtr_t::is_block_dirtied(const buf_block_t* block) +{ + ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE); + ut_ad(block->page.buf_fix_count > 0); + + /* It is OK to read oldest_modification because no + other thread can be performing a write of it and it + is only during write that the value is reset to 0. */ + return(block->page.oldest_modification == 0); +} + /** Pushes an object to an mtr memo stack. */ void diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index 2d6b03c512c..fc6f3321164 100644 --- a/storage/innobase/mtr/mtr0mtr.cc +++ b/storage/innobase/mtr/mtr0mtr.cc @@ -457,20 +457,6 @@ private: lsn_t m_end_lsn; }; -/** Check if a mini-transaction is dirtying a clean page. -@return true if the mtr is dirtying a clean page. */ -bool -mtr_t::is_block_dirtied(const buf_block_t* block) -{ - ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE); - ut_ad(block->page.buf_fix_count > 0); - - /* It is OK to read oldest_modification because no - other thread can be performing a write of it and it - is only during write that the value is reset to 0. */ - return(block->page.oldest_modification == 0); -} - /** Write the block contents to the REDO log */ struct mtr_write_log_t { /** Append a block to the redo log buffer. From a626abb66908e499624eba1508ca333116084fd1 Mon Sep 17 00:00:00 2001 From: Nikita Malyavin Date: Tue, 25 Sep 2018 17:58:39 +1000 Subject: [PATCH 13/22] Fix LEX_CSTRING passed as argument of printf-like functions --- sql/set_var.cc | 2 +- sql/sql_handler.cc | 2 +- storage/innobase/handler/handler0alter.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/set_var.cc b/sql/set_var.cc index 3272d0dfe5b..3711ec64aeb 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -808,7 +808,7 @@ int set_var::light_check(THD *thd) if (var->check_type(type)) { int err= type == OPT_GLOBAL ? ER_LOCAL_VARIABLE : ER_GLOBAL_VARIABLE; - my_error(err, MYF(0), var->name); + my_error(err, MYF(0), var->name.str); return -1; } if (type == OPT_GLOBAL && check_global_access(thd, SUPER_ACL)) diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 0b37b44b7cf..9fdfd612c96 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -683,7 +683,7 @@ mysql_ha_fix_cond_and_key(SQL_HANDLER *handler, HA_ONLY_WHOLE_INDEX)) { my_error(ER_KEY_DOESNT_SUPPORT, MYF(0), - table->file->index_type(handler->keyno), keyinfo->name); + table->file->index_type(handler->keyno), keyinfo->name.str); return 1; } diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 3ee4a5ba9dd..571ec821999 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -6474,7 +6474,7 @@ dup_fk: Sql_condition::WARN_LEVEL_WARN, HA_ERR_WRONG_INDEX, "InnoDB could not find key" - " with name %s", key->name); + " with name %s", key->name.str); } else { ut_ad(!index->to_be_dropped); if (!index->is_primary()) { From c8b5fa4afc6c233101b8163ef19c1abc1be0373d Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 17 Jun 2019 17:50:08 +0300 Subject: [PATCH 14/22] MDEV-19055 Failures with temporary tables and Aria There was two separate problems: - Aria pagecache didn't properly handle re-reading of blocks that have given errors before (this triggered an assert) - temporary tables that where opened several times where not properly closed in ALTER, REPAIR or OPTIMIZE table Other things - Added a couple of asserts that will make it easier to find problems like this in the future. --- mysql-test/suite/maria/alter.result | 43 +++++++++++++++++++++++++++++ mysql-test/suite/maria/alter.test | 35 +++++++++++++++++++++++ mysys/my_pread.c | 2 ++ sql/sql_admin.cc | 28 +++++++++++-------- sql/sql_table.cc | 2 ++ storage/maria/ma_blockrec.c | 2 ++ storage/maria/ma_pagecache.c | 3 +- 7 files changed, 101 insertions(+), 14 deletions(-) diff --git a/mysql-test/suite/maria/alter.result b/mysql-test/suite/maria/alter.result index c63688dddd6..ea72328a38f 100644 --- a/mysql-test/suite/maria/alter.result +++ b/mysql-test/suite/maria/alter.result @@ -47,3 +47,46 @@ t1 CREATE TABLE `t1` ( ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=1 CREATE TABLE t2 SELECT * FROM t1; DROP TABLE t1, t2; +# +# MDEV-19055 Assertion `(_my_thread_var())->thr_errno != 0' failed in pagecache_read +# +CREATE OR REPLACE TABLE t1 (x INT) ENGINE=Aria; +CREATE TEMPORARY TABLE t2 (a TIME) ENGINE=Aria; +ALTER TABLE t2 ADD b DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; +ALTER TABLE t2 ADD CHECK (b = 4); +INSERT IGNORE INTO t2 () VALUES (),(),(),(); +ALTER IGNORE TABLE t2 ADD c INT; +SELECT count(a),sum(a) FROM t2; +count(a) sum(a) +0 NULL +DELETE FROM t2 ORDER BY c LIMIT 1; +INSERT IGNORE INTO t2 SELECT * FROM t2; +OPTIMIZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 optimize status OK +SELECT count(a),sum(a) FROM t2; +count(a) sum(a) +0 NULL +INSERT IGNORE INTO t2 SELECT * FROM t2; +SET SQL_MODE= 'STRICT_ALL_TABLES'; +SELECT count(a),sum(a) FROM t2; +count(a) sum(a) +0 NULL +ALTER TABLE t2 CHANGE IF EXISTS d c INT; +ERROR 22007: Incorrect datetime value: '4' +SELECT count(a),sum(a) FROM t2; +count(a) sum(a) +0 NULL +ALTER IGNORE TABLE t2 ADD IF NOT EXISTS e BIT; +ALTER TABLE t1 MODIFY IF EXISTS xx INT; +INSERT IGNORE INTO t2 () VALUES (),(),(),(); +SELECT count(a),sum(a) FROM t2; +count(a) sum(a) +0 NULL +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +check table t2; +Table Op Msg_type Msg_text +test.t2 check status OK +DROP TABLE t1,t2; diff --git a/mysql-test/suite/maria/alter.test b/mysql-test/suite/maria/alter.test index 09672cdfa3b..ef21ab2e5d2 100644 --- a/mysql-test/suite/maria/alter.test +++ b/mysql-test/suite/maria/alter.test @@ -42,3 +42,38 @@ ALTER TABLE t1 ORDER BY unknown_column; SHOW CREATE TABLE t1; CREATE TABLE t2 SELECT * FROM t1; DROP TABLE t1, t2; + +--echo # +--echo # MDEV-19055 Assertion `(_my_thread_var())->thr_errno != 0' failed in pagecache_read +--echo # + +--disable_warnings +CREATE OR REPLACE TABLE t1 (x INT) ENGINE=Aria; +CREATE TEMPORARY TABLE t2 (a TIME) ENGINE=Aria; +ALTER TABLE t2 ADD b DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP; +ALTER TABLE t2 ADD CHECK (b = 4); +INSERT IGNORE INTO t2 () VALUES (),(),(),(); +ALTER IGNORE TABLE t2 ADD c INT; +SELECT count(a),sum(a) FROM t2; +DELETE FROM t2 ORDER BY c LIMIT 1; +INSERT IGNORE INTO t2 SELECT * FROM t2; +OPTIMIZE TABLE t2; +SELECT count(a),sum(a) FROM t2; +INSERT IGNORE INTO t2 SELECT * FROM t2; +SET SQL_MODE= 'STRICT_ALL_TABLES'; +SELECT count(a),sum(a) FROM t2; +--error ER_TRUNCATED_WRONG_VALUE +ALTER TABLE t2 CHANGE IF EXISTS d c INT; +SELECT count(a),sum(a) FROM t2; +ALTER IGNORE TABLE t2 ADD IF NOT EXISTS e BIT; +ALTER TABLE t1 MODIFY IF EXISTS xx INT; +INSERT IGNORE INTO t2 () VALUES (),(),(),(); +SELECT count(a),sum(a) FROM t2; +--enable_warnings +check table t1; +check table t2; +DROP TABLE t1,t2; + +# +# End of 10.2 tests +# diff --git a/mysys/my_pread.c b/mysys/my_pread.c index 08285738528..15586d00a6f 100644 --- a/mysys/my_pread.c +++ b/mysys/my_pread.c @@ -68,6 +68,8 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset, if (readbytes != Count) { + /* We should never read with wrong file descriptor! */ + DBUG_ASSERT(my_errno != 9); my_errno= errno; if (errno == 0 || (readbytes != (size_t) -1 && (MyFlags & (MY_NABP | MY_FNABP)))) diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index ed5ba93c3fe..ab95fdc340c 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -697,19 +697,23 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, MDL_SHARED_NO_READ_WRITE lock (MDL_SHARED_WRITE cannot be upgraded) by *not* having HA_CONCURRENT_OPTIMIZE table_flag. */ - if (lock_type == TL_WRITE && !table->table->s->tmp_table && - table->mdl_request.type > MDL_SHARED_WRITE) + if (lock_type == TL_WRITE && table->mdl_request.type > MDL_SHARED_WRITE) { - if (wait_while_table_is_used(thd, table->table, HA_EXTRA_NOT_USED)) - goto err; - DEBUG_SYNC(thd, "after_admin_flush"); - /* Flush entries in the query cache involving this table. */ - query_cache_invalidate3(thd, table->table, 0); - /* - XXX: hack: switch off open_for_modify to skip the - flush that is made later in the execution flow. - */ - open_for_modify= 0; + if (table->table->s->tmp_table) + thd->close_unused_temporary_table_instances(tables); + else + { + if (wait_while_table_is_used(thd, table->table, HA_EXTRA_NOT_USED)) + goto err; + DEBUG_SYNC(thd, "after_admin_flush"); + /* Flush entries in the query cache involving this table. */ + query_cache_invalidate3(thd, table->table, 0); + /* + XXX: hack: switch off open_for_modify to skip the + flush that is made later in the execution flow. + */ + open_for_modify= 0; + } } if (table->table->s->crashed && operator_func == &handler::ha_check) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index a64e17e2d3b..522d18b3701 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -9536,6 +9536,8 @@ do_continue:; DEBUG_SYNC(thd, "alter_table_copy_after_lock_upgrade"); } + else + thd->close_unused_temporary_table_instances(table_list); // It's now safe to take the table level lock. if (lock_tables(thd, table_list, alter_ctx.tables_opened, 0)) diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index c38b27d0f6c..13323dcae55 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -5244,6 +5244,8 @@ my_bool _ma_scan_init_block_record(MARIA_HA *info) { MARIA_SHARE *share= info->s; DBUG_ENTER("_ma_scan_init_block_record"); + DBUG_ASSERT(info->dfile.file == share->bitmap.file.file); + /* bitmap_buff may already be allocated if this is the second call to rnd_init() without a rnd_end() in between, see sql/handler.h diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index 7b0f395f926..f8c83e12a18 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -3464,8 +3464,6 @@ restart: pagecache_pthread_mutex_lock(&pagecache->cache_lock); #endif } - if (status & PCBLOCK_ERROR) - my_errno= block->error; } remove_reader(block); @@ -3497,6 +3495,7 @@ restart: if (status & PCBLOCK_ERROR) { + my_errno= block->error; DBUG_ASSERT(my_errno != 0); DBUG_PRINT("error", ("Got error %d when doing page read", my_errno)); DBUG_RETURN((uchar *) 0); From 3784ed7a623ccc55a4755efeeb2f9ba06c7baf4e Mon Sep 17 00:00:00 2001 From: Daniel Bartholomew Date: Mon, 17 Jun 2019 10:51:41 -0400 Subject: [PATCH 15/22] bump the VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index dcabf3343b2..070cdafdf2e 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=3 -MYSQL_VERSION_PATCH=16 +MYSQL_VERSION_PATCH=17 SERVER_MATURITY=stable From 81f60e8adeb241ed845427e0792349f3a05af99b Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 17 Jun 2019 18:04:22 +0100 Subject: [PATCH 16/22] Portability fix. --- mysys/my_pread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/my_pread.c b/mysys/my_pread.c index 15586d00a6f..9713deebbe5 100644 --- a/mysys/my_pread.c +++ b/mysys/my_pread.c @@ -69,7 +69,7 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset, if (readbytes != Count) { /* We should never read with wrong file descriptor! */ - DBUG_ASSERT(my_errno != 9); + DBUG_ASSERT(my_errno != EBADF); my_errno= errno; if (errno == 0 || (readbytes != (size_t) -1 && (MyFlags & (MY_NABP | MY_FNABP)))) From 5804bb4ef0acd7ac42e628c2d8c404957dc86cf9 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 17 Jun 2019 09:56:00 +0100 Subject: [PATCH 17/22] MDEV-19750 mysql command wrong encoding Restore the detection of default charset in command line utilities. It worked up to 10.1, but was broken by Connector/C. Moved code for detection of default charset from sql-common/client.c to mysys, and make command line utilities to use this code if charset was not specified on the command line. --- client/mysql.cc | 4 +- client/mysqladmin.cc | 3 + client/mysqlcheck.c | 6 +- client/mysqlimport.c | 7 +- client/mysqlshow.c | 2 + include/my_sys.h | 1 + mysql-test/r/charset_client_win.result | 2 + mysql-test/t/charset_client_win.test | 2 + mysys/charset.c | 218 ++++++++++++++++++++- sql-common/client.c | 252 +------------------------ 10 files changed, 245 insertions(+), 252 deletions(-) create mode 100644 mysql-test/r/charset_client_win.result create mode 100644 mysql-test/t/charset_client_win.test diff --git a/client/mysql.cc b/client/mysql.cc index 06bf31e16ce..2247e93ca93 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -40,6 +40,7 @@ #include "my_readline.h" #include #include +#include #if defined(USE_LIBEDIT_INTERFACE) && defined(HAVE_LOCALE_H) #include @@ -4701,7 +4702,8 @@ sql_real_connect(char *host,char *database,char *user,char *password, select_limit,max_join_size); mysql_options(&mysql, MYSQL_INIT_COMMAND, init_command); } - + if (!strcmp(default_charset,MYSQL_AUTODETECT_CHARSET_NAME)) + default_charset= (char *)my_default_csname(); mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); if (!do_connect(&mysql, host, user, password, database, diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index ef8cb27e672..a4e06b46d94 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -26,6 +26,7 @@ #include #include #include +#include #define ADMIN_VERSION "9.1" #define MAX_MYSQL_VAR 512 @@ -371,6 +372,8 @@ int main(int argc,char *argv[]) if (shared_memory_base_name) mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); #endif + if (!strcmp(default_charset,MYSQL_AUTODETECT_CHARSET_NAME)) + default_charset= (char *)my_default_csname(); mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); error_flags= (myf)(opt_nobeep ? 0 : ME_BELL); diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index ae8ddeec59c..42c4cae5621 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -440,8 +440,10 @@ static int get_options(int *argc, char ***argv) else default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME; } - if (strcmp(default_charset, MYSQL_AUTODETECT_CHARSET_NAME) && - !get_charset_by_csname(default_charset, MY_CS_PRIMARY, MYF(MY_WME))) + if (!strcmp(default_charset, MYSQL_AUTODETECT_CHARSET_NAME)) + default_charset= (char *)my_default_csname(); + + if (!get_charset_by_csname(default_charset, MY_CS_PRIMARY, MYF(MY_WME))) { printf("Unsupported character set: %s\n", default_charset); DBUG_RETURN(1); diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 722b23844d9..9d8239fe6db 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -30,6 +30,8 @@ #define IMPORT_VERSION "3.7" #include "client_priv.h" +#include + #include "mysql_version.h" #include /* ORACLE_WELCOME_COPYRIGHT_NOTICE */ @@ -472,8 +474,9 @@ static MYSQL *db_connect(char *host, char *database, if (opt_default_auth && *opt_default_auth) mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); - - mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset); + if (!strcmp(default_charset,MYSQL_AUTODETECT_CHARSET_NAME)) + default_charset= (char *)my_default_csname(); + mysql_options(mysql, MYSQL_SET_CHARSET_NAME, my_default_csname()); mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0); mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "mysqlimport"); diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 3fb2d371f2f..47dc7212ca2 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -135,6 +135,8 @@ int main(int argc, char **argv) if (shared_memory_base_name) mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); #endif + if (!strcmp(default_charset,MYSQL_AUTODETECT_CHARSET_NAME)) + default_charset= (char *)my_default_csname(); mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); if (opt_plugin_dir && *opt_plugin_dir) diff --git a/include/my_sys.h b/include/my_sys.h index c1d81108a84..fe66aeef48c 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -1043,6 +1043,7 @@ extern char *get_tty_password(const char *opt_message); /* File system character set */ extern CHARSET_INFO *fs_character_set(void); #endif +extern const char *my_default_csname(void); extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info, char *to, size_t to_length, const char *from, size_t length); diff --git a/mysql-test/r/charset_client_win.result b/mysql-test/r/charset_client_win.result new file mode 100644 index 00000000000..08a32b0b80f --- /dev/null +++ b/mysql-test/r/charset_client_win.result @@ -0,0 +1,2 @@ +@@character_set_client +cp1257 diff --git a/mysql-test/t/charset_client_win.test b/mysql-test/t/charset_client_win.test new file mode 100644 index 00000000000..b4a21d4f0a4 --- /dev/null +++ b/mysql-test/t/charset_client_win.test @@ -0,0 +1,2 @@ +--source include/windows.inc +--exec chcp 1257 > NUL && $MYSQL --default-character-set=auto -e "select @@character_set_client" diff --git a/mysys/charset.c b/mysys/charset.c index 51afbb16cf0..f44dc7606c1 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -20,7 +20,12 @@ #include #include #include - +#ifdef HAVE_LANGINFO_H +#include +#endif +#ifdef HAVE_LOCALE_H +#include +#endif /* The code below implements this functionality: @@ -1216,3 +1221,214 @@ size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info, *to= 0; return overflow ? (ulong)~0 : (ulong) (to - to_start); } + + +typedef enum my_cs_match_type_enum +{ + /* MySQL and OS charsets are fully compatible */ + my_cs_exact, + /* MySQL charset is very close to OS charset */ + my_cs_approx, + /* + MySQL knows this charset, but it is not supported as client character set. + */ + my_cs_unsupp +} my_cs_match_type; + + +typedef struct str2str_st +{ + const char* os_name; + const char* my_name; + my_cs_match_type param; +} MY_CSET_OS_NAME; + +static const MY_CSET_OS_NAME charsets[] = +{ +#ifdef _WIN32 + {"cp437", "cp850", my_cs_approx}, + {"cp850", "cp850", my_cs_exact}, + {"cp852", "cp852", my_cs_exact}, + {"cp858", "cp850", my_cs_approx}, + {"cp866", "cp866", my_cs_exact}, + {"cp874", "tis620", my_cs_approx}, + {"cp932", "cp932", my_cs_exact}, + {"cp936", "gbk", my_cs_approx}, + {"cp949", "euckr", my_cs_approx}, + {"cp950", "big5", my_cs_exact}, + {"cp1200", "utf16le", my_cs_unsupp}, + {"cp1201", "utf16", my_cs_unsupp}, + {"cp1250", "cp1250", my_cs_exact}, + {"cp1251", "cp1251", my_cs_exact}, + {"cp1252", "latin1", my_cs_exact}, + {"cp1253", "greek", my_cs_exact}, + {"cp1254", "latin5", my_cs_exact}, + {"cp1255", "hebrew", my_cs_approx}, + {"cp1256", "cp1256", my_cs_exact}, + {"cp1257", "cp1257", my_cs_exact}, + {"cp10000", "macroman", my_cs_exact}, + {"cp10001", "sjis", my_cs_approx}, + {"cp10002", "big5", my_cs_approx}, + {"cp10008", "gb2312", my_cs_approx}, + {"cp10021", "tis620", my_cs_approx}, + {"cp10029", "macce", my_cs_exact}, + {"cp12001", "utf32", my_cs_unsupp}, + {"cp20107", "swe7", my_cs_exact}, + {"cp20127", "latin1", my_cs_approx}, + {"cp20866", "koi8r", my_cs_exact}, + {"cp20932", "ujis", my_cs_exact}, + {"cp20936", "gb2312", my_cs_approx}, + {"cp20949", "euckr", my_cs_approx}, + {"cp21866", "koi8u", my_cs_exact}, + {"cp28591", "latin1", my_cs_approx}, + {"cp28592", "latin2", my_cs_exact}, + {"cp28597", "greek", my_cs_exact}, + {"cp28598", "hebrew", my_cs_exact}, + {"cp28599", "latin5", my_cs_exact}, + {"cp28603", "latin7", my_cs_exact}, +#ifdef UNCOMMENT_THIS_WHEN_WL_4579_IS_DONE + {"cp28605", "latin9", my_cs_exact}, +#endif + {"cp38598", "hebrew", my_cs_exact}, + {"cp51932", "ujis", my_cs_exact}, + {"cp51936", "gb2312", my_cs_exact}, + {"cp51949", "euckr", my_cs_exact}, + {"cp51950", "big5", my_cs_exact}, +#ifdef UNCOMMENT_THIS_WHEN_WL_WL_4024_IS_DONE + {"cp54936", "gb18030", my_cs_exact}, +#endif + {"cp65001", "utf8", my_cs_exact}, + +#else /* not Windows */ + + {"646", "latin1", my_cs_approx}, /* Default on Solaris */ + {"ANSI_X3.4-1968", "latin1", my_cs_approx}, + {"ansi1251", "cp1251", my_cs_exact}, + {"armscii8", "armscii8", my_cs_exact}, + {"armscii-8", "armscii8", my_cs_exact}, + {"ASCII", "latin1", my_cs_approx}, + {"Big5", "big5", my_cs_exact}, + {"cp1251", "cp1251", my_cs_exact}, + {"cp1255", "hebrew", my_cs_approx}, + {"CP866", "cp866", my_cs_exact}, + {"eucCN", "gb2312", my_cs_exact}, + {"euc-CN", "gb2312", my_cs_exact}, + {"eucJP", "ujis", my_cs_exact}, + {"euc-JP", "ujis", my_cs_exact}, + {"eucKR", "euckr", my_cs_exact}, + {"euc-KR", "euckr", my_cs_exact}, +#ifdef UNCOMMENT_THIS_WHEN_WL_WL_4024_IS_DONE + {"gb18030", "gb18030", my_cs_exact}, +#endif + {"gb2312", "gb2312", my_cs_exact}, + {"gbk", "gbk", my_cs_exact}, + {"georgianps", "geostd8", my_cs_exact}, + {"georgian-ps", "geostd8", my_cs_exact}, + {"IBM-1252", "cp1252", my_cs_exact}, + + {"iso88591", "latin1", my_cs_approx}, + {"ISO_8859-1", "latin1", my_cs_approx}, + {"ISO8859-1", "latin1", my_cs_approx}, + {"ISO-8859-1", "latin1", my_cs_approx}, + + {"iso885913", "latin7", my_cs_exact}, + {"ISO_8859-13", "latin7", my_cs_exact}, + {"ISO8859-13", "latin7", my_cs_exact}, + {"ISO-8859-13", "latin7", my_cs_exact}, + +#ifdef UNCOMMENT_THIS_WHEN_WL_4579_IS_DONE + {"iso885915", "latin9", my_cs_exact}, + {"ISO_8859-15", "latin9", my_cs_exact}, + {"ISO8859-15", "latin9", my_cs_exact}, + {"ISO-8859-15", "latin9", my_cs_exact}, +#endif + + {"iso88592", "latin2", my_cs_exact}, + {"ISO_8859-2", "latin2", my_cs_exact}, + {"ISO8859-2", "latin2", my_cs_exact}, + {"ISO-8859-2", "latin2", my_cs_exact}, + + {"iso88597", "greek", my_cs_exact}, + {"ISO_8859-7", "greek", my_cs_exact}, + {"ISO8859-7", "greek", my_cs_exact}, + {"ISO-8859-7", "greek", my_cs_exact}, + + {"iso88598", "hebrew", my_cs_exact}, + {"ISO_8859-8", "hebrew", my_cs_exact}, + {"ISO8859-8", "hebrew", my_cs_exact}, + {"ISO-8859-8", "hebrew", my_cs_exact}, + + {"iso88599", "latin5", my_cs_exact}, + {"ISO_8859-9", "latin5", my_cs_exact}, + {"ISO8859-9", "latin5", my_cs_exact}, + {"ISO-8859-9", "latin5", my_cs_exact}, + + {"koi8r", "koi8r", my_cs_exact}, + {"KOI8-R", "koi8r", my_cs_exact}, + {"koi8u", "koi8u", my_cs_exact}, + {"KOI8-U", "koi8u", my_cs_exact}, + + {"roman8", "hp8", my_cs_exact}, /* Default on HP UX */ + + {"Shift_JIS", "sjis", my_cs_exact}, + {"SJIS", "sjis", my_cs_exact}, + {"shiftjisx0213", "sjis", my_cs_exact}, + + {"tis620", "tis620", my_cs_exact}, + {"tis-620", "tis620", my_cs_exact}, + + {"ujis", "ujis", my_cs_exact}, + + {"US-ASCII", "latin1", my_cs_approx}, + + {"utf8", "utf8", my_cs_exact}, + {"utf-8", "utf8", my_cs_exact}, +#endif + {NULL, NULL, 0} +}; + + +static const char* +my_os_charset_to_mysql_charset(const char* csname) +{ + const MY_CSET_OS_NAME* csp; + for (csp = charsets; csp->os_name; csp++) + { + if (!strcasecmp(csp->os_name, csname)) + { + switch (csp->param) + { + case my_cs_exact: + return csp->my_name; + + case my_cs_approx: + /* + Maybe we should print a warning eventually: + character set correspondence is not exact. + */ + return csp->my_name; + + default: + return NULL; + } + } + } + return NULL; +} + +const char* my_default_csname() +{ + const char* csname = NULL; +#ifdef _WIN32 + char cpbuf[64]; + int cp = GetConsoleCP(); + if (cp == 0) + cp = GetACP(); + snprintf(cpbuf, sizeof(cpbuf), "cp%d", (int)cp); + csname = my_os_charset_to_mysql_charset(cpbuf); +#elif defined(HAVE_SETLOCALE) && defined(HAVE_NL_LANGINFO) + if (setlocale(LC_CTYPE, "") && (csname = nl_langinfo(CODESET))) + csname = my_os_charset_to_mysql_charset(csname); +#endif + return csname ? csname : MYSQL_DEFAULT_CHARSET_NAME; +} \ No newline at end of file diff --git a/sql-common/client.c b/sql-common/client.c index 2ec5250d828..4624c6e0f6c 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1927,250 +1927,13 @@ static MYSQL_METHODS client_methods= }; - -typedef enum my_cs_match_type_enum -{ - /* MySQL and OS charsets are fully compatible */ - my_cs_exact, - /* MySQL charset is very close to OS charset */ - my_cs_approx, - /* - MySQL knows this charset, but it is not supported as client character set. - */ - my_cs_unsupp -} my_cs_match_type; - - -typedef struct str2str_st -{ - const char *os_name; - const char *my_name; - my_cs_match_type param; -} MY_CSET_OS_NAME; - -const MY_CSET_OS_NAME charsets[]= -{ -#ifdef __WIN__ - {"cp437", "cp850", my_cs_approx}, - {"cp850", "cp850", my_cs_exact}, - {"cp852", "cp852", my_cs_exact}, - {"cp858", "cp850", my_cs_approx}, - {"cp866", "cp866", my_cs_exact}, - {"cp874", "tis620", my_cs_approx}, - {"cp932", "cp932", my_cs_exact}, - {"cp936", "gbk", my_cs_approx}, - {"cp949", "euckr", my_cs_approx}, - {"cp950", "big5", my_cs_exact}, - {"cp1200", "utf16le", my_cs_unsupp}, - {"cp1201", "utf16", my_cs_unsupp}, - {"cp1250", "cp1250", my_cs_exact}, - {"cp1251", "cp1251", my_cs_exact}, - {"cp1252", "latin1", my_cs_exact}, - {"cp1253", "greek", my_cs_exact}, - {"cp1254", "latin5", my_cs_exact}, - {"cp1255", "hebrew", my_cs_approx}, - {"cp1256", "cp1256", my_cs_exact}, - {"cp1257", "cp1257", my_cs_exact}, - {"cp10000", "macroman", my_cs_exact}, - {"cp10001", "sjis", my_cs_approx}, - {"cp10002", "big5", my_cs_approx}, - {"cp10008", "gb2312", my_cs_approx}, - {"cp10021", "tis620", my_cs_approx}, - {"cp10029", "macce", my_cs_exact}, - {"cp12001", "utf32", my_cs_unsupp}, - {"cp20107", "swe7", my_cs_exact}, - {"cp20127", "latin1", my_cs_approx}, - {"cp20866", "koi8r", my_cs_exact}, - {"cp20932", "ujis", my_cs_exact}, - {"cp20936", "gb2312", my_cs_approx}, - {"cp20949", "euckr", my_cs_approx}, - {"cp21866", "koi8u", my_cs_exact}, - {"cp28591", "latin1", my_cs_approx}, - {"cp28592", "latin2", my_cs_exact}, - {"cp28597", "greek", my_cs_exact}, - {"cp28598", "hebrew", my_cs_exact}, - {"cp28599", "latin5", my_cs_exact}, - {"cp28603", "latin7", my_cs_exact}, -#ifdef UNCOMMENT_THIS_WHEN_WL_4579_IS_DONE - {"cp28605", "latin9", my_cs_exact}, -#endif - {"cp38598", "hebrew", my_cs_exact}, - {"cp51932", "ujis", my_cs_exact}, - {"cp51936", "gb2312", my_cs_exact}, - {"cp51949", "euckr", my_cs_exact}, - {"cp51950", "big5", my_cs_exact}, -#ifdef UNCOMMENT_THIS_WHEN_WL_WL_4024_IS_DONE - {"cp54936", "gb18030", my_cs_exact}, -#endif - {"cp65001", "utf8", my_cs_exact}, - -#else /* not Windows */ - - {"646", "latin1", my_cs_approx}, /* Default on Solaris */ - {"ANSI_X3.4-1968", "latin1", my_cs_approx}, - {"ansi1251", "cp1251", my_cs_exact}, - {"armscii8", "armscii8", my_cs_exact}, - {"armscii-8", "armscii8", my_cs_exact}, - {"ASCII", "latin1", my_cs_approx}, - {"Big5", "big5", my_cs_exact}, - {"cp1251", "cp1251", my_cs_exact}, - {"cp1255", "hebrew", my_cs_approx}, - {"CP866", "cp866", my_cs_exact}, - {"eucCN", "gb2312", my_cs_exact}, - {"euc-CN", "gb2312", my_cs_exact}, - {"eucJP", "ujis", my_cs_exact}, - {"euc-JP", "ujis", my_cs_exact}, - {"eucKR", "euckr", my_cs_exact}, - {"euc-KR", "euckr", my_cs_exact}, -#ifdef UNCOMMENT_THIS_WHEN_WL_WL_4024_IS_DONE - {"gb18030", "gb18030", my_cs_exact}, -#endif - {"gb2312", "gb2312", my_cs_exact}, - {"gbk", "gbk", my_cs_exact}, - {"georgianps", "geostd8", my_cs_exact}, - {"georgian-ps", "geostd8", my_cs_exact}, - {"IBM-1252", "cp1252", my_cs_exact}, - - {"iso88591", "latin1", my_cs_approx}, - {"ISO_8859-1", "latin1", my_cs_approx}, - {"ISO8859-1", "latin1", my_cs_approx}, - {"ISO-8859-1", "latin1", my_cs_approx}, - - {"iso885913", "latin7", my_cs_exact}, - {"ISO_8859-13", "latin7", my_cs_exact}, - {"ISO8859-13", "latin7", my_cs_exact}, - {"ISO-8859-13", "latin7", my_cs_exact}, - -#ifdef UNCOMMENT_THIS_WHEN_WL_4579_IS_DONE - {"iso885915", "latin9", my_cs_exact}, - {"ISO_8859-15", "latin9", my_cs_exact}, - {"ISO8859-15", "latin9", my_cs_exact}, - {"ISO-8859-15", "latin9", my_cs_exact}, -#endif - - {"iso88592", "latin2", my_cs_exact}, - {"ISO_8859-2", "latin2", my_cs_exact}, - {"ISO8859-2", "latin2", my_cs_exact}, - {"ISO-8859-2", "latin2", my_cs_exact}, - - {"iso88597", "greek", my_cs_exact}, - {"ISO_8859-7", "greek", my_cs_exact}, - {"ISO8859-7", "greek", my_cs_exact}, - {"ISO-8859-7", "greek", my_cs_exact}, - - {"iso88598", "hebrew", my_cs_exact}, - {"ISO_8859-8", "hebrew", my_cs_exact}, - {"ISO8859-8", "hebrew", my_cs_exact}, - {"ISO-8859-8", "hebrew", my_cs_exact}, - - {"iso88599", "latin5", my_cs_exact}, - {"ISO_8859-9", "latin5", my_cs_exact}, - {"ISO8859-9", "latin5", my_cs_exact}, - {"ISO-8859-9", "latin5", my_cs_exact}, - - {"koi8r", "koi8r", my_cs_exact}, - {"KOI8-R", "koi8r", my_cs_exact}, - {"koi8u", "koi8u", my_cs_exact}, - {"KOI8-U", "koi8u", my_cs_exact}, - - {"roman8", "hp8", my_cs_exact}, /* Default on HP UX */ - - {"Shift_JIS", "sjis", my_cs_exact}, - {"SJIS", "sjis", my_cs_exact}, - {"shiftjisx0213", "sjis", my_cs_exact}, - - {"tis620", "tis620", my_cs_exact}, - {"tis-620", "tis620", my_cs_exact}, - - {"ujis", "ujis", my_cs_exact}, - - {"US-ASCII", "latin1", my_cs_approx}, - - {"utf8", "utf8", my_cs_exact}, - {"utf-8", "utf8", my_cs_exact}, -#endif - {NULL, NULL, 0} -}; - - -static const char * -my_os_charset_to_mysql_charset(const char *csname) -{ - const MY_CSET_OS_NAME *csp; - for (csp= charsets; csp->os_name; csp++) - { - if (!my_strcasecmp(&my_charset_latin1, csp->os_name, csname)) - { - switch (csp->param) - { - case my_cs_exact: - return csp->my_name; - - case my_cs_approx: - /* - Maybe we should print a warning eventually: - character set correspondence is not exact. - */ - return csp->my_name; - - default: - my_printf_error(ER_UNKNOWN_ERROR, - "OS character set '%s'" - " is not supported by MySQL client", - MYF(0), csp->my_name); - goto def; - } - } - } - - my_printf_error(ER_UNKNOWN_ERROR, - "Unknown OS character set '%s'.", - MYF(0), csname); - -def: - csname= MYSQL_DEFAULT_CHARSET_NAME; - my_printf_error(ER_UNKNOWN_ERROR, - "Switching to the default character set '%s'.", - MYF(0), csname); - return csname; -} - - -#ifndef __WIN__ -#include /* for getenv() */ -#ifdef HAVE_LANGINFO_H -#include -#endif -#ifdef HAVE_LOCALE_H -#include -#endif -#endif /* __WIN__ */ - - +#include static int mysql_autodetect_character_set(MYSQL *mysql) { - const char *csname= MYSQL_DEFAULT_CHARSET_NAME; - -#ifdef __WIN__ - char cpbuf[64]; - { - UINT cp= GetConsoleCP(); - if (cp == 0) - cp= GetACP(); - my_snprintf(cpbuf, sizeof(cpbuf), "cp%d", (int)cp); - csname= my_os_charset_to_mysql_charset(cpbuf); - } -#elif defined(HAVE_SETLOCALE) && defined(HAVE_NL_LANGINFO) - { - if (setlocale(LC_CTYPE, "") && (csname= nl_langinfo(CODESET))) - csname= my_os_charset_to_mysql_charset(csname); - } -#endif - if (mysql->options.charset_name) my_free(mysql->options.charset_name); - if (!(mysql->options.charset_name= my_strdup(csname, MYF(MY_WME)))) + if (!(mysql->options.charset_name= my_strdup(my_default_csname(),MYF(MY_WME)))) return 1; return 0; } @@ -2211,16 +1974,13 @@ C_MODE_START int mysql_init_character_set(MYSQL *mysql) { /* Set character set */ - if (!mysql->options.charset_name) + if (!mysql->options.charset_name || + !strcmp(mysql->options.charset_name, + MYSQL_AUTODETECT_CHARSET_NAME)) { - if (!(mysql->options.charset_name= - my_strdup(MYSQL_DEFAULT_CHARSET_NAME,MYF(MY_WME)))) + if (mysql_autodetect_character_set(mysql)) return 1; } - else if (!strcmp(mysql->options.charset_name, - MYSQL_AUTODETECT_CHARSET_NAME) && - mysql_autodetect_character_set(mysql)) - return 1; mysql_set_character_set_with_default_collation(mysql); From 71eea0c3fb87f37f6377c9bdad9339b664b11d0f Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 17 Jun 2019 19:01:15 +0100 Subject: [PATCH 18/22] Fix debug assert to match its intention. Do not check my_errno before it is set, check errno instead. Also, do not check errno, if prior pread() did not fail. --- mysys/my_pread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/my_pread.c b/mysys/my_pread.c index 9713deebbe5..9d3fdb3e0ee 100644 --- a/mysys/my_pread.c +++ b/mysys/my_pread.c @@ -69,7 +69,7 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset, if (readbytes != Count) { /* We should never read with wrong file descriptor! */ - DBUG_ASSERT(my_errno != EBADF); + DBUG_ASSERT(readbytes != (size_t)-1 || errno != EBADF); my_errno= errno; if (errno == 0 || (readbytes != (size_t) -1 && (MyFlags & (MY_NABP | MY_FNABP)))) From 5352e9687a86094d19aaea605970487516e99ab5 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 18 Jun 2019 04:58:15 +0400 Subject: [PATCH 19/22] MDEV-17363 - Compressed columns cannot be restored from dump In collaboration with Sergey Vojtovich The COMPRESSED clause is now a part of the data type and goes immediately after the data type and length, but before the CHARACTER SET clause, and before column attributes such as DEFAULT, COLLATE, ON UPDATE, SYSTEM VERSIONING, engine specific column attributes. In the old reduction, the COMPRESSED clause was a column attribute. New syntax: New syntax examples: VARCHAR(1000) COMPRESSED CHARACTER SET latin1 DEFAULT '' BLOB COMPRESSED DEFAULT '' Deprecate syntax examples: VARCHAR(1000) CHARACTER SET latin1 COMPRESSED DEFAULT '' TEXT CHARACTER SET latin1 DEFAULT '' COMPRESSED VARBINARY(1000) DEFAULT '' COMPRESSED As a side effect: - COMPRESSED is not valid as an SP label name in SQL/PSM routines any more (but it's still valid as an SP label name in sql_mode=ORACLE) - COMPRESSED is now allowed in combination with GENERATED ALWAYS AS: TEXT COMPRESSED GENERATED ALWAYS AS REPEAT('a',1000) --- .../column_compression_syntax_varbinary.inc | 61 + .../column_compression_syntax_varchar.inc | 99 ++ mysql-test/main/column_compression.result | 1203 ++++++++++++++- mysql-test/main/column_compression.test | 90 +- mysql-test/main/keywords.result | 33 + mysql-test/main/keywords.test | 36 + mysql-test/main/mysqldump_restore.result | 38 +- mysql-test/main/mysqldump_restore.test | 24 +- mysql-test/main/sp.result | 27 + mysql-test/main/sp.test | 26 + .../compat/oracle/r/column_compression.result | 1324 +++++++++++++++++ .../suite/compat/oracle/r/keywords.result | 26 + .../compat/oracle/r/mysqldump_restore.result | 38 + .../compat/oracle/t/column_compression.test | 73 + .../suite/compat/oracle/t/keywords.test | 29 + .../compat/oracle/t/mysqldump_restore.test | 30 + sql/field.cc | 46 +- sql/field.h | 4 + sql/sql_yacc.yy | 108 +- sql/sql_yacc_ora.yy | 113 +- 20 files changed, 3324 insertions(+), 104 deletions(-) create mode 100644 mysql-test/include/column_compression_syntax_varbinary.inc create mode 100644 mysql-test/include/column_compression_syntax_varchar.inc create mode 100644 mysql-test/suite/compat/oracle/r/keywords.result create mode 100644 mysql-test/suite/compat/oracle/r/mysqldump_restore.result create mode 100644 mysql-test/suite/compat/oracle/t/keywords.test create mode 100644 mysql-test/suite/compat/oracle/t/mysqldump_restore.test diff --git a/mysql-test/include/column_compression_syntax_varbinary.inc b/mysql-test/include/column_compression_syntax_varbinary.inc new file mode 100644 index 00000000000..b609969fc14 --- /dev/null +++ b/mysql-test/include/column_compression_syntax_varbinary.inc @@ -0,0 +1,61 @@ +--echo # +--echo # The following statements run without warnings. +--echo # + +--eval CREATE TABLE t1 (a $type COMPRESSED) +SHOW CREATE TABLE t1; +DROP TABLE t1; + + +--echo # +--echo # The following statements run without warnings. +--echo # They have extra column attributes (or GENERATED) after COMPRESSED. +--echo # + +--eval CREATE TABLE t1 (a $type COMPRESSED DEFAULT '') +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type COMPRESSED NULL) +SHOW CREATE TABLE t1; +DROP TABLE t1; + +--eval CREATE TABLE t1 (a $type COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10))) +SHOW CREATE TABLE t1; +DROP TABLE t1; + + +--echo # +--echo # The following statements return deprecated syntax warnings +--echo # + +--eval CREATE TABLE t1 (a $type DEFAULT '' COMPRESSED) +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type NULL COMPRESSED) +SHOW CREATE TABLE t1; +DROP TABLE t1; + + +--echo # +--echo # The following statements fail by the grammar, +--echo # because COMPRESSED immediately follows 'field_type'. +--echo # + +--error ER_PARSE_ERROR +--eval CREATE TABLE t1 (a $type COMPRESSED COMPRESSED) + +--echo # +--echo # The following statements are not prohibited by the *.yy grammar, +--echo # because the sequence `field_type attribute COMPRESSED` is allowed +--echo # (notice there is at least one attribute after `field_type`). +--echo # The first COMPRESSED is parsed inside `field_type`. +--echo # The second COMPRESSED passes through the parser but then is caught +--echo # inside Column_definition::set_compressed_deprecated_with_type_check() +--echo # and a syntax error is raised. +--echo # + +--error ER_PARSE_ERROR +--eval CREATE TABLE t1 (a $type COMPRESSED DEFAULT '' COMPRESSED) +--error ER_PARSE_ERROR +--eval CREATE TABLE t1 (a $type COMPRESSED NULL COMPRESSED) +--error ER_PARSE_ERROR diff --git a/mysql-test/include/column_compression_syntax_varchar.inc b/mysql-test/include/column_compression_syntax_varchar.inc new file mode 100644 index 00000000000..6b96440c511 --- /dev/null +++ b/mysql-test/include/column_compression_syntax_varchar.inc @@ -0,0 +1,99 @@ +--echo # +--echo # The following statements run without warnings. +--echo # The `compressed opt_binary` grammar sequence is covered. +--echo # + +--eval CREATE TABLE t1 (a $type COMPRESSED) +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type COMPRESSED BINARY) +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type COMPRESSED BINARY ASCII) +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type COMPRESSED BYTE) +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type COMPRESSED ASCII) +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type COMPRESSED UNICODE) +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type COMPRESSED CHARACTER SET utf8) +SHOW CREATE TABLE t1; +DROP TABLE t1; + + +--echo # +--echo # The following statements run without warnings. +--echo # They have extra column attributes (or GENERATED) after COMPRESSED. +--echo # + +--eval CREATE TABLE t1 (a $type COMPRESSED BYTE DEFAULT '') +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type COMPRESSED BINARY DEFAULT '') +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type COMPRESSED ASCII DEFAULT '') +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type COMPRESSED CHARACTER SET utf8 DEFAULT '') +SHOW CREATE TABLE t1; +DROP TABLE t1; + +--eval CREATE TABLE t1 (a $type COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100))) +SHOW CREATE TABLE t1; +DROP TABLE t1; + + +--echo # +--echo # The following statements return deprecated syntax warnings +--echo # + +--eval CREATE TABLE t1 (a $type BINARY COMPRESSED) +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type ASCII COMPRESSED) +SHOW CREATE TABLE t1; +DROP TABLE t1; +--eval CREATE TABLE t1 (a $type BYTE COMPRESSED) +SHOW CREATE TABLE t1; +DROP TABLE t1; + + +--echo # +--echo # The following statements fail by the grammar, +--echo # because COMPRESSED immediately follows 'field_type'. +--echo # + +--error ER_PARSE_ERROR +--eval CREATE TABLE t1 (a $type COMPRESSED BYTE COMPRESSED) +--error ER_PARSE_ERROR +--eval CREATE TABLE t1 (a $type COMPRESSED BINARY COMPRESSED) +--error ER_PARSE_ERROR +--eval CREATE TABLE t1 (a $type COMPRESSED ASCII COMPRESSED) +--error ER_PARSE_ERROR +--eval CREATE TABLE t1 (a $type COMPRESSED CHARACTER SET utf8 COMPRESSED) + + +--echo # +--echo # The following statements are not prohibited by the *.yy grammar, +--echo # because the sequence `field_type attribute COMPRESSED` is allowed +--echo # (notice there is at least one attribute after `field_type`). +--echo # The first COMPRESSED is parsed inside `field_type`. +--echo # The second COMPRESSED passes through the parser but then is caught +--echo # inside Column_definition::set_compressed_deprecated_with_type_check() +--echo # and a syntax error is raised. +--echo # + +--error ER_PARSE_ERROR +--eval CREATE TABLE t1 (a $type COMPRESSED BYTE DEFAULT '' COMPRESSED) +--error ER_PARSE_ERROR +--eval CREATE TABLE t1 (a $type COMPRESSED BINARY DEFAULT '' COMPRESSED) +--error ER_PARSE_ERROR +--eval CREATE TABLE t1 (a $type COMPRESSED ASCII DEFAULT '' COMPRESSED) +--error ER_PARSE_ERROR +--eval CREATE TABLE t1 (a $type COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED) diff --git a/mysql-test/main/column_compression.result b/mysql-test/main/column_compression.result index c783e7fd1e9..121e74ee5eb 100644 --- a/mysql-test/main/column_compression.result +++ b/mysql-test/main/column_compression.result @@ -860,9 +860,9 @@ foo bar DROP TABLE t1; FLUSH STATUS; -CREATE TABLE t1(a TEXT CHARSET ucs2 COMPRESSED, KEY(a(10))); +CREATE TABLE t1(a TEXT COMPRESSED CHARSET ucs2, KEY(a(10))); ERROR HY000: Compressed column 'a' can't be used in key specification -CREATE TABLE t1(a TEXT CHARSET ucs2 COMPRESSED); +CREATE TABLE t1(a TEXT COMPRESSED CHARSET ucs2); ALTER TABLE t1 ADD KEY(a(10)); ERROR HY000: Compressed column 'a' can't be used in key specification SHOW CREATE TABLE t1; @@ -900,7 +900,7 @@ SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND DATA_LENGTH 1008 # Rebuild back -ALTER TABLE t1 MODIFY COLUMN a TEXT CHARSET ucs2 COMPRESSED; +ALTER TABLE t1 MODIFY COLUMN a TEXT COMPRESSED CHARSET ucs2; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -975,7 +975,7 @@ VARIABLE_NAME VARIABLE_VALUE COLUMN_COMPRESSIONS 2 COLUMN_DECOMPRESSIONS 10 # Make sure online add column works (requires InnoDB) -ALTER TABLE t1 ADD COLUMN b TEXT CHARSET ucs2 COMPRESSED DEFAULT "must be visible"; +ALTER TABLE t1 ADD COLUMN b TEXT COMPRESSED CHARSET ucs2 DEFAULT "must be visible"; SELECT LEFT(a, 10), LENGTH(a), b FROM t1; LEFT(a, 10) LENGTH(a) b aaaaaaaaaa 2000 must be visible @@ -1054,9 +1054,9 @@ DROP TABLE t1; # MDEV-13540 - Server crashes in copy or Assertion `0' failed in virtual # Field* Field_varstring_compressed::new_key_field # -CREATE TABLE t1 (c1 TEXT CHARSET ucs2 COMPRESSED) ENGINE=MyISAM; +CREATE TABLE t1 (c1 TEXT COMPRESSED CHARSET ucs2) ENGINE=MyISAM; INSERT IGNORE INTO t1 VALUES ('foo'),('bar'); -CREATE TABLE t2 (c2 TEXT CHARSET ucs2 COMPRESSED) ENGINE=MyISAM; +CREATE TABLE t2 (c2 TEXT COMPRESSED CHARSET ucs2) ENGINE=MyISAM; INSERT IGNORE INTO t2 VALUES ('qux'),('abc'); SELECT * FROM t1 WHERE c1 NOT IN ( SELECT c2 FROM t2 WHERE c2 = c1 ); c1 @@ -1067,7 +1067,7 @@ DROP TABLE t1, t2; # MDEV-13541 - Server crashes in next_breadth_first_tab or Assertion `0' # failed in Field_varstring_compressed::new_key_field # -CREATE TABLE t1 (c TEXT CHARSET ucs2 COMPRESSED) ENGINE=InnoDB; +CREATE TABLE t1 (c TEXT COMPRESSED CHARSET ucs2) ENGINE=InnoDB; INSERT INTO t1 VALUES ('foo'),('bar'); SELECT DISTINCT c FROM t1; c @@ -1291,19 +1291,23 @@ foo bar DROP TABLE t1; CREATE TABLE t1(a CHAR(100) COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1(a CHAR(100) NOT NULL COMPRESSED); ERROR 42000: Incorrect column specifier for column 'a' CREATE TABLE t1(a INT COMPRESSED); -ERROR 42000: Incorrect column specifier for column 'a' +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 CREATE TABLE t1(a BLOB COMPRESSED=unknown); ERROR HY000: Unknown compression method: unknown CREATE TABLE t1(a BLOB COMPRESSED COMPRESSED); -DROP TABLE t1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 CREATE TABLE t1(a INT); ALTER TABLE t1 MODIFY a INT COMPRESSED; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED' at line 1 +ALTER TABLE t1 MODIFY a INT NOT NULL COMPRESSED; ERROR 42000: Incorrect column specifier for column 'a' DROP TABLE t1; # Test CSV -CREATE TABLE t1(a BLOB NOT NULL COMPRESSED) ENGINE=CSV; +CREATE TABLE t1(a BLOB COMPRESSED NOT NULL) ENGINE=CSV; INSERT INTO t1 VALUES(REPEAT('a', 110)); SELECT LENGTH(a) FROM t1; LENGTH(a) @@ -1452,8 +1456,8 @@ DROP TABLE t1; # CREATE TABLE t1 ( -a VARCHAR(10) CHARACTER SET latin1 COMPRESSED, -b VARCHAR(10) CHARACTER SET utf8 COMPRESSED +a VARCHAR(10) COMPRESSED CHARACTER SET latin1, +b VARCHAR(10) COMPRESSED CHARACTER SET utf8 ); SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH FROM INFORMATION_SCHEMA.COLUMNS @@ -1475,7 +1479,7 @@ DROP TABLE t1; # # MDEV-16729 VARCHAR COMPRESSED is created with a wrong length for multi-byte character sets # -CREATE OR REPLACE TABLE t1 (a VARCHAR(1000) CHARACTER SET utf8 COMPRESSED); +CREATE OR REPLACE TABLE t1 (a VARCHAR(1000) COMPRESSED CHARACTER SET utf8); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1486,3 +1490,1176 @@ WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; COLUMN_TYPE varchar(1000) /*!100301 COMPRESSED*/ DROP TABLE t1; +# +# MDEV-17363 - Compressed columns cannot be restored from dump +# +CREATE TABLE t1(a INT NOT NULL COMPRESSED); +ERROR 42000: Incorrect column specifier for column 'a' +SHOW WARNINGS; +Level Code Message +Error 1063 Incorrect column specifier for column 'a' +CREATE TABLE t1( +a JSON COMPRESSED, +b VARCHAR(1000) COMPRESSED BINARY, +c NVARCHAR(1000) COMPRESSED BINARY, +d TINYTEXT COMPRESSED BINARY +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, + `b` varchar(1000) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `c` varchar(1000) /*!100301 COMPRESSED*/ CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `d` tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# VARCHAR and TEXT variants +# +# +# The following statements run without warnings. +# The `compressed opt_binary` grammar sequence is covered. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BYTE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varbinary(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED UNICODE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BYTE DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varbinary(10) /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED ASCII DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a VARCHAR(10) BINARY COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) ASCII COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) BYTE COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varbinary(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BYTE COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED ASCII COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BYTE DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED ASCII DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# The `compressed opt_binary` grammar sequence is covered. +# +CREATE TABLE t1 (a TINYTEXT COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinytext /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED BYTE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinytext /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED UNICODE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a TINYTEXT COMPRESSED BYTE DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyblob /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED ASCII DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinytext /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a TINYTEXT BINARY COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT ASCII COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinytext /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT BYTE COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a TINYTEXT COMPRESSED BYTE COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYTEXT COMPRESSED ASCII COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a TINYTEXT COMPRESSED BYTE DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYTEXT COMPRESSED ASCII DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# The `compressed opt_binary` grammar sequence is covered. +# +CREATE TABLE t1 (a TEXT COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED BINARY); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED BINARY ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED BYTE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED UNICODE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a TEXT COMPRESSED BYTE DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED BINARY DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED ASCII DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a TEXT BINARY COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT ASCII COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT BYTE COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a TEXT COMPRESSED BYTE COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TEXT COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TEXT COMPRESSED ASCII COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a TEXT COMPRESSED BYTE DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TEXT COMPRESSED BINARY DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TEXT COMPRESSED ASCII DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# The `compressed opt_binary` grammar sequence is covered. +# +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BYTE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED UNICODE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BYTE DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumblob /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED ASCII DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a MEDIUMTEXT BINARY COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT ASCII COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT BYTE COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BYTE COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED ASCII COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BYTE DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED ASCII DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# The `compressed opt_binary` grammar sequence is covered. +# +CREATE TABLE t1 (a LONGTEXT COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED BYTE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED UNICODE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a LONGTEXT COMPRESSED BYTE DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longblob /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED ASCII DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a LONGTEXT BINARY COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT ASCII COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT BYTE COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a LONGTEXT COMPRESSED BYTE COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGTEXT COMPRESSED ASCII COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a LONGTEXT COMPRESSED BYTE DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGTEXT COMPRESSED ASCII DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# VARBINARY and BLOB variables +# +# +# The following statements run without warnings. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a VARCHAR(10) DEFAULT '' COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) NULL COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED NULL COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# +CREATE TABLE t1 (a TINYBLOB COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a TINYBLOB COMPRESSED DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyblob /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYBLOB COMPRESSED NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYBLOB COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyblob /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a TINYBLOB DEFAULT '' COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyblob /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a TINYBLOB NULL COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a TINYBLOB COMPRESSED COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a TINYBLOB COMPRESSED DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYBLOB COMPRESSED NULL COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# +CREATE TABLE t1 (a BLOB COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a BLOB COMPRESSED DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a BLOB COMPRESSED NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a BLOB COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a BLOB DEFAULT '' COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a BLOB NULL COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a BLOB COMPRESSED COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a BLOB COMPRESSED DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a BLOB COMPRESSED NULL COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumblob /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumblob /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a MEDIUMBLOB DEFAULT '' COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumblob /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMBLOB NULL COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED NULL COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# +CREATE TABLE t1 (a LONGBLOB COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a LONGBLOB COMPRESSED DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longblob /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGBLOB COMPRESSED NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGBLOB COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longblob /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a LONGBLOB DEFAULT '' COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longblob /*!100301 COMPRESSED*/ DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGBLOB NULL COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a LONGBLOB COMPRESSED COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a LONGBLOB COMPRESSED DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGBLOB COMPRESSED NULL COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# NVARCHAR +# +CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 diff --git a/mysql-test/main/column_compression.test b/mysql-test/main/column_compression.test index c9d0014ab9e..092125735cf 100644 --- a/mysql-test/main/column_compression.test +++ b/mysql-test/main/column_compression.test @@ -20,7 +20,7 @@ let $typec= VARCHAR(10000) COMPRESSED; let $typeu= VARCHAR(10000); --source column_compression.inc -let $typec= TEXT CHARSET ucs2 COMPRESSED; +let $typec= TEXT COMPRESSED CHARSET ucs2; let $typeu= TEXT; --source column_compression.inc @@ -29,21 +29,25 @@ let $typec= BLOB COMPRESSED; let $typeu= BLOB; --source column_compression.inc ---error ER_WRONG_FIELD_SPEC +--error ER_PARSE_ERROR CREATE TABLE t1(a CHAR(100) COMPRESSED); --error ER_WRONG_FIELD_SPEC +CREATE TABLE t1(a CHAR(100) NOT NULL COMPRESSED); +--error ER_PARSE_ERROR CREATE TABLE t1(a INT COMPRESSED); --error ER_UNKNOWN_COMPRESSION_METHOD CREATE TABLE t1(a BLOB COMPRESSED=unknown); +--error ER_PARSE_ERROR CREATE TABLE t1(a BLOB COMPRESSED COMPRESSED); -DROP TABLE t1; CREATE TABLE t1(a INT); ---error ER_WRONG_FIELD_SPEC +--error ER_PARSE_ERROR ALTER TABLE t1 MODIFY a INT COMPRESSED; +--error ER_WRONG_FIELD_SPEC +ALTER TABLE t1 MODIFY a INT NOT NULL COMPRESSED; DROP TABLE t1; --echo # Test CSV -CREATE TABLE t1(a BLOB NOT NULL COMPRESSED) ENGINE=CSV; +CREATE TABLE t1(a BLOB COMPRESSED NOT NULL) ENGINE=CSV; INSERT INTO t1 VALUES(REPEAT('a', 110)); SELECT LENGTH(a) FROM t1; ALTER TABLE t1 ENGINE=MyISAM; @@ -153,8 +157,8 @@ DROP TABLE t1; CREATE TABLE t1 ( - a VARCHAR(10) CHARACTER SET latin1 COMPRESSED, - b VARCHAR(10) CHARACTER SET utf8 COMPRESSED + a VARCHAR(10) COMPRESSED CHARACTER SET latin1, + b VARCHAR(10) COMPRESSED CHARACTER SET utf8 ); SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH FROM INFORMATION_SCHEMA.COLUMNS @@ -176,8 +180,78 @@ DROP TABLE t1; --echo # MDEV-16729 VARCHAR COMPRESSED is created with a wrong length for multi-byte character sets --echo # -CREATE OR REPLACE TABLE t1 (a VARCHAR(1000) CHARACTER SET utf8 COMPRESSED); +CREATE OR REPLACE TABLE t1 (a VARCHAR(1000) COMPRESSED CHARACTER SET utf8); SHOW CREATE TABLE t1; SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; DROP TABLE t1; + + +--echo # +--echo # MDEV-17363 - Compressed columns cannot be restored from dump +--echo # +--error ER_WRONG_FIELD_SPEC +CREATE TABLE t1(a INT NOT NULL COMPRESSED); +SHOW WARNINGS; + +CREATE TABLE t1( + a JSON COMPRESSED, + b VARCHAR(1000) COMPRESSED BINARY, + c NVARCHAR(1000) COMPRESSED BINARY, + d TINYTEXT COMPRESSED BINARY +); +SHOW CREATE TABLE t1; +DROP TABLE t1; + + +--echo # +--echo # VARCHAR and TEXT variants +--echo # + +--let type=VARCHAR(10) +--source include/column_compression_syntax_varchar.inc + +--let type=TINYTEXT +--source include/column_compression_syntax_varchar.inc + +--let type=TEXT +--source include/column_compression_syntax_varchar.inc + +--let type=MEDIUMTEXT +--source include/column_compression_syntax_varchar.inc + +--let type=LONGTEXT +--source include/column_compression_syntax_varchar.inc + + +--echo # +--echo # VARBINARY and BLOB variables +--echo # + +--let type=VARCHAR(10) +--source include/column_compression_syntax_varbinary.inc + +--let type=TINYBLOB +--source include/column_compression_syntax_varbinary.inc + +--let type=BLOB +--source include/column_compression_syntax_varbinary.inc + +--let type=MEDIUMBLOB +--source include/column_compression_syntax_varbinary.inc + +--let type=LONGBLOB +--source include/column_compression_syntax_varbinary.inc + + +--echo # +--echo # NVARCHAR +--echo # + +CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED); +SHOW CREATE TABLE t1; +DROP TABLE t1; +--error ER_PARSE_ERROR +CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED BINARY COMPRESSED); +--error ER_PARSE_ERROR +CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED DEFAULT '' COMPRESSED); diff --git a/mysql-test/main/keywords.result b/mysql-test/main/keywords.result index e2f29f7cfb5..2765c05b3cb 100644 --- a/mysql-test/main/keywords.result +++ b/mysql-test/main/keywords.result @@ -358,3 +358,36 @@ CREATE TABLE raise (raise int); DROP TABLE raise; CREATE TABLE reuse (reuse int); DROP TABLE reuse; +# +# MDEV-17363 Compressed columns cannot be restored from dump +# COMPRESSED is not valid as an SP label any more +# but is still valid as an SP variable name. +# +BEGIN NOT ATOMIC +compressed: +BEGIN +SELECT 1 AS a; +END; +END +$$ +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'compressed: +BEGIN +SELECT 1 AS a; +END; +END' at line 2 +BEGIN NOT ATOMIC +`compressed`: +BEGIN +SELECT 1 AS a; +END; +END +$$ +a +1 +BEGIN NOT ATOMIC +DECLARE compressed INT DEFAULT 1; +SELECT compressed; +END +$$ +compressed +1 diff --git a/mysql-test/main/keywords.test b/mysql-test/main/keywords.test index 4ac8f56afc5..a745aada106 100644 --- a/mysql-test/main/keywords.test +++ b/mysql-test/main/keywords.test @@ -259,3 +259,39 @@ DROP TABLE raise; CREATE TABLE reuse (reuse int); DROP TABLE reuse; + + +--echo # +--echo # MDEV-17363 Compressed columns cannot be restored from dump +--echo # COMPRESSED is not valid as an SP label any more +--echo # but is still valid as an SP variable name. +--echo # + +DELIMITER $$; +--error ER_PARSE_ERROR +BEGIN NOT ATOMIC +compressed: + BEGIN + SELECT 1 AS a; + END; +END +$$ +DELIMITER ;$$ + +DELIMITER $$; +BEGIN NOT ATOMIC +`compressed`: + BEGIN + SELECT 1 AS a; + END; +END +$$ +DELIMITER ;$$ + +DELIMITER $$; +BEGIN NOT ATOMIC + DECLARE compressed INT DEFAULT 1; + SELECT compressed; +END +$$ +DELIMITER ;$$ diff --git a/mysql-test/main/mysqldump_restore.result b/mysql-test/main/mysqldump_restore.result index 9eac8b253de..cc4a5cd5965 100644 --- a/mysql-test/main/mysqldump_restore.result +++ b/mysql-test/main/mysqldump_restore.result @@ -103,7 +103,43 @@ ALTER TABLE test.t1 RENAME to test.t1_orig; include/diff_tables.inc [test.t1, test.t1_orig] # Cleanup DROP TABLE test.t1, test.t1_orig; -# End tests +# +# Start of 10.3 tests +# +# +# MDEV-17363 Compressed columns cannot be restored from dump +# +CREATE TABLE t1 (a VARCHAR(1000) COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL); +INSERT INTO `t1` VALUES (REPEAT('a', 256)); +# Begin testing mysqldump output + restore +# Create 'original table name - _orig +SET @orig_table_name = CONCAT('test.t1', '_orig'); +# Rename original table +ALTER TABLE test.t1 RENAME to test.t1_orig; +# Recreate table from mysqldump output +# Compare original and recreated tables +# Recreated table: test.t1 +# Original table: test.t1_orig +include/diff_tables.inc [test.t1, test.t1_orig] +# Cleanup +DROP TABLE test.t1, test.t1_orig; +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL); +INSERT INTO `t1` VALUES (REPEAT('a', 256)); +# Begin testing mysqldump output + restore +# Create 'original table name -
_orig +SET @orig_table_name = CONCAT('test.t1', '_orig'); +# Rename original table +ALTER TABLE test.t1 RENAME to test.t1_orig; +# Recreate table from mysqldump output +# Compare original and recreated tables +# Recreated table: test.t1 +# Original table: test.t1_orig +include/diff_tables.inc [test.t1, test.t1_orig] +# Cleanup +DROP TABLE test.t1, test.t1_orig; +# +# End of 10.3 tests +# # Cleanup # Reset concurrent_insert to its original value SET @@global.concurrent_insert = @old_concurrent_insert; diff --git a/mysql-test/main/mysqldump_restore.test b/mysql-test/main/mysqldump_restore.test index 835ee3ee9e9..8d40a4f35f2 100644 --- a/mysql-test/main/mysqldump_restore.test +++ b/mysql-test/main/mysqldump_restore.test @@ -101,7 +101,29 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A); let $table_name = test.t1; --source include/mysqldump.inc ---echo # End tests +--echo # +--echo # Start of 10.3 tests +--echo # + +--echo # +--echo # MDEV-17363 Compressed columns cannot be restored from dump +--echo # + +CREATE TABLE t1 (a VARCHAR(1000) COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL); +INSERT INTO `t1` VALUES (REPEAT('a', 256)); +--exec $MYSQL_DUMP --skip-extended-insert test --skip-comments t1 > $mysqldumpfile +let $table_name = test.t1; +--source include/mysqldump.inc + +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL); +INSERT INTO `t1` VALUES (REPEAT('a', 256)); +--exec $MYSQL_DUMP --skip-extended-insert test --skip-comments t1 > $mysqldumpfile +let $table_name = test.t1; +--source include/mysqldump.inc + +--echo # +--echo # End of 10.3 tests +--echo # --echo # Cleanup --echo # Reset concurrent_insert to its original value diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result index b7022559dc5..2a32be05bb9 100644 --- a/mysql-test/main/sp.result +++ b/mysql-test/main/sp.result @@ -8814,4 +8814,31 @@ Note 1050 Table 't1' already exists drop procedure p4; drop table t1; set @@sql_mode=@save_sql_mode; +# +# MDEV-17363 Compressed columns cannot be restored from dump +# COMPRESSED conflicted between data type and SP label, +# so it's not allowed as an SP label any more. +# +CREATE FUNCTION f1() RETURNS TEXT COMPRESSED +BEGIN +RETURN ''; +END; +$$ +SHOW CREATE FUNCTION f1; +Function sql_mode Create Function character_set_client collation_connection Database Collation +f1 STRICT_ALL_TABLES CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS text COMPRESSED CHARSET latin1 +BEGIN +RETURN ''; +END latin1 latin1_swedish_ci latin1_swedish_ci +DROP FUNCTION f1; +CREATE FUNCTION f1() RETURNS TEXT +COMPRESSED: +BEGIN +RETURN ''; +END; +$$ +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ': +BEGIN +RETURN ''; +END' at line 2 # End of 10.3 tests diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test index 743f0f6781e..e3b62cfadc4 100644 --- a/mysql-test/main/sp.test +++ b/mysql-test/main/sp.test @@ -10335,4 +10335,30 @@ drop procedure p4; drop table t1; set @@sql_mode=@save_sql_mode; +--echo # +--echo # MDEV-17363 Compressed columns cannot be restored from dump +--echo # COMPRESSED conflicted between data type and SP label, +--echo # so it's not allowed as an SP label any more. +--echo # + +DELIMITER $$; +CREATE FUNCTION f1() RETURNS TEXT COMPRESSED +BEGIN + RETURN ''; +END; +$$ +DELIMITER ;$$ +SHOW CREATE FUNCTION f1; +DROP FUNCTION f1; + +DELIMITER $$; +--error ER_PARSE_ERROR +CREATE FUNCTION f1() RETURNS TEXT +COMPRESSED: +BEGIN + RETURN ''; +END; +$$ +DELIMITER ;$$ + --echo # End of 10.3 tests diff --git a/mysql-test/suite/compat/oracle/r/column_compression.result b/mysql-test/suite/compat/oracle/r/column_compression.result index eaa4de002a4..1b828ca17b0 100644 --- a/mysql-test/suite/compat/oracle/r/column_compression.result +++ b/mysql-test/suite/compat/oracle/r/column_compression.result @@ -7,3 +7,1327 @@ WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'; c 1 DROP TABLE t1; +# +# MDEV-17363 - Compressed columns cannot be restored from dump +# +CREATE TABLE t1(a INT NOT NULL COMPRESSED); +ERROR 42000: Incorrect column specifier for column 'a' +SHOW WARNINGS; +Level Code Message +Error 1063 Incorrect column specifier for column 'a' +CREATE TABLE t1( +a JSON COMPRESSED, +b VARCHAR(1000) COMPRESSED BINARY, +c NVARCHAR(1000) COMPRESSED BINARY, +d TINYTEXT COMPRESSED BINARY +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, + "b" varchar(1000) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + "c" varchar(1000) /*!100301 COMPRESSED*/ CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + "d" tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +# +# VARCHAR and TEXT variants +# +# +# The following statements run without warnings. +# The `compressed opt_binary` grammar sequence is covered. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BYTE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varbinary(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED UNICODE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BYTE DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varbinary(10) /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED ASCII DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL +) +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a VARCHAR(10) BINARY COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) ASCII COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) BYTE COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varbinary(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BYTE COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED ASCII COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BYTE DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED BINARY DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED ASCII DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# The `compressed opt_binary` grammar sequence is covered. +# +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BINARY); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BINARY ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BYTE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varbinary(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED UNICODE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BYTE DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varbinary(10) /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BINARY DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED ASCII DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED CHARACTER SET utf8 DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL +) +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a VARCHAR2(10) BINARY COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR2(10) ASCII COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR2(10) BYTE COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varbinary(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BYTE COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED ASCII COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED CHARACTER SET utf8 COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BYTE DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED BINARY DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED ASCII DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR2(10) COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# The `compressed opt_binary` grammar sequence is covered. +# +CREATE TABLE t1 (a TINYTEXT COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinytext /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED BYTE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinytext /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED UNICODE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a TINYTEXT COMPRESSED BYTE DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED ASCII DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinytext /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL +) +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a TINYTEXT BINARY COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinytext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT ASCII COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinytext /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYTEXT BYTE COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a TINYTEXT COMPRESSED BYTE COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYTEXT COMPRESSED ASCII COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a TINYTEXT COMPRESSED BYTE DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYTEXT COMPRESSED BINARY DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYTEXT COMPRESSED ASCII DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# The `compressed opt_binary` grammar sequence is covered. +# +CREATE TABLE t1 (a TEXT COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" text /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED BINARY); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" text /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED BINARY ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" text /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED BYTE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" blob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" text /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED UNICODE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" text /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a TEXT COMPRESSED BYTE DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" blob /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED BINARY DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" text /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED ASCII DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" text /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" text /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" text /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL +) +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a TEXT BINARY COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" text /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TEXT ASCII COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" text /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TEXT BYTE COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" blob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a TEXT COMPRESSED BYTE COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TEXT COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TEXT COMPRESSED ASCII COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a TEXT COMPRESSED BYTE DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TEXT COMPRESSED BINARY DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TEXT COMPRESSED ASCII DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# The `compressed opt_binary` grammar sequence is covered. +# +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumtext /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BYTE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumtext /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED UNICODE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BYTE DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED ASCII DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumtext /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL +) +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a MEDIUMTEXT BINARY COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT ASCII COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumtext /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT BYTE COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BYTE COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED ASCII COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BYTE DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED BINARY DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED ASCII DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# The `compressed opt_binary` grammar sequence is covered. +# +CREATE TABLE t1 (a LONGTEXT COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED BYTE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED ASCII); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED UNICODE); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a LONGTEXT COMPRESSED BYTE DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED ASCII DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8 GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL +) +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a LONGTEXT BINARY COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT ASCII COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longtext /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT BYTE COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a LONGTEXT COMPRESSED BYTE COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGTEXT COMPRESSED ASCII COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a LONGTEXT COMPRESSED BYTE DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGTEXT COMPRESSED BINARY DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGTEXT COMPRESSED ASCII DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# VARBINARY and BLOB variables +# +# +# The following statements run without warnings. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL +) +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a VARCHAR(10) DEFAULT '' COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) NULL COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a VARCHAR(10) COMPRESSED NULL COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# +CREATE TABLE t1 (a TINYBLOB COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a TINYBLOB COMPRESSED DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYBLOB COMPRESSED NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYBLOB COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinyblob /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL +) +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a TINYBLOB DEFAULT '' COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a TINYBLOB NULL COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" tinyblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a TINYBLOB COMPRESSED COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a TINYBLOB COMPRESSED DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a TINYBLOB COMPRESSED NULL COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# +CREATE TABLE t1 (a BLOB COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a BLOB COMPRESSED DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a BLOB COMPRESSED NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a BLOB COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL +) +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a BLOB DEFAULT '' COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a BLOB NULL COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a BLOB COMPRESSED COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a BLOB COMPRESSED DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a BLOB COMPRESSED NULL COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumblob /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL +) +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a MEDIUMBLOB DEFAULT '' COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMBLOB NULL COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" mediumblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a MEDIUMBLOB COMPRESSED NULL COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements run without warnings. +# +CREATE TABLE t1 (a LONGBLOB COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements run without warnings. +# They have extra column attributes (or GENERATED) after COMPRESSED. +# +CREATE TABLE t1 (a LONGBLOB COMPRESSED DEFAULT ''); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGBLOB COMPRESSED NULL); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGBLOB COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ GENERATED ALWAYS AS (repeat('a',10)) VIRTUAL +) +DROP TABLE t1; +# +# The following statements return deprecated syntax warnings +# +CREATE TABLE t1 (a LONGBLOB DEFAULT '' COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT '' +) +DROP TABLE t1; +CREATE TABLE t1 (a LONGBLOB NULL COMPRESSED); +Warnings: +Warning 1287 ' ... COMPRESSED...' is deprecated and will be removed in a future release. Please use ' COMPRESSED... ...' instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" longblob /*!100301 COMPRESSED*/ DEFAULT NULL +) +DROP TABLE t1; +# +# The following statements fail by the grammar, +# because COMPRESSED immediately follows 'field_type'. +# +CREATE TABLE t1 (a LONGBLOB COMPRESSED COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# The following statements are not prohibited by the *.yy grammar, +# because the sequence `field_type attribute COMPRESSED` is allowed +# (notice there is at least one attribute after `field_type`). +# The first COMPRESSED is parsed inside `field_type`. +# The second COMPRESSED passes through the parser but then is caught +# inside Column_definition::set_compressed_deprecated_with_type_check() +# and a syntax error is raised. +# +CREATE TABLE t1 (a LONGBLOB COMPRESSED DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a LONGBLOB COMPRESSED NULL COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +# +# NVARCHAR +# +CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8 DEFAULT NULL +) +DROP TABLE t1; +CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED BINARY COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 +CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED DEFAULT '' COMPRESSED); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COMPRESSED)' at line 1 diff --git a/mysql-test/suite/compat/oracle/r/keywords.result b/mysql-test/suite/compat/oracle/r/keywords.result new file mode 100644 index 00000000000..bc9d3d9b6d6 --- /dev/null +++ b/mysql-test/suite/compat/oracle/r/keywords.result @@ -0,0 +1,26 @@ +SET sql_mode=ORACLE; +# +# MDEV-17363 Compressed columns cannot be restored from dump +# In sql_mode=ORACLE, COMPRESSED is still valid both as an SP label +# and an SP variable name. +# +BEGIN +IF TRUE THEN +GOTO compressed; +END IF; +SELECT 'This should not be reached' AS warn; +<> +BEGIN +SELECT 1 AS a; +END; +END +$$ +a +1 +DECLARE compressed INT DEFAULT 1; +BEGIN +SELECT compressed; +END +$$ +compressed +1 diff --git a/mysql-test/suite/compat/oracle/r/mysqldump_restore.result b/mysql-test/suite/compat/oracle/r/mysqldump_restore.result new file mode 100644 index 00000000000..f73fa3a3639 --- /dev/null +++ b/mysql-test/suite/compat/oracle/r/mysqldump_restore.result @@ -0,0 +1,38 @@ +SET sql_mode=ORACLE; +# +# Start of 10.3 tests +# +# +# MDEV-17363 Compressed columns cannot be restored from dump +# +CREATE TABLE t1 (a VARCHAR(1000) COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL); +INSERT INTO `t1` VALUES (REPEAT('a', 256)); +# Begin testing mysqldump output + restore +# Create 'original table name -
_orig +SET @orig_table_name = CONCAT('test.t1', '_orig'); +# Rename original table +ALTER TABLE test.t1 RENAME to test.t1_orig; +# Recreate table from mysqldump output +# Compare original and recreated tables +# Recreated table: test.t1 +# Original table: test.t1_orig +include/diff_tables.inc [test.t1, test.t1_orig] +# Cleanup +DROP TABLE test.t1, test.t1_orig; +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL); +INSERT INTO `t1` VALUES (REPEAT('a', 256)); +# Begin testing mysqldump output + restore +# Create 'original table name -
_orig +SET @orig_table_name = CONCAT('test.t1', '_orig'); +# Rename original table +ALTER TABLE test.t1 RENAME to test.t1_orig; +# Recreate table from mysqldump output +# Compare original and recreated tables +# Recreated table: test.t1 +# Original table: test.t1_orig +include/diff_tables.inc [test.t1, test.t1_orig] +# Cleanup +DROP TABLE test.t1, test.t1_orig; +# +# End of 10.3 tests +# diff --git a/mysql-test/suite/compat/oracle/t/column_compression.test b/mysql-test/suite/compat/oracle/t/column_compression.test index 5544ff6c0b7..6fcdd119890 100644 --- a/mysql-test/suite/compat/oracle/t/column_compression.test +++ b/mysql-test/suite/compat/oracle/t/column_compression.test @@ -9,3 +9,76 @@ INSERT INTO t1 VALUES (REPEAT('a',10000)); SELECT DATA_LENGTH<100 AS c FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'; DROP TABLE t1; + +--echo # +--echo # MDEV-17363 - Compressed columns cannot be restored from dump +--echo # + +--error ER_WRONG_FIELD_SPEC +CREATE TABLE t1(a INT NOT NULL COMPRESSED); +SHOW WARNINGS; + +CREATE TABLE t1( + a JSON COMPRESSED, + b VARCHAR(1000) COMPRESSED BINARY, + c NVARCHAR(1000) COMPRESSED BINARY, + d TINYTEXT COMPRESSED BINARY +); +SHOW CREATE TABLE t1; +DROP TABLE t1; + + +--echo # +--echo # VARCHAR and TEXT variants +--echo # + +--let type=VARCHAR(10) +--source include/column_compression_syntax_varchar.inc + +--let type=VARCHAR2(10) +--source include/column_compression_syntax_varchar.inc + +--let type=TINYTEXT +--source include/column_compression_syntax_varchar.inc + +--let type=TEXT +--source include/column_compression_syntax_varchar.inc + +--let type=MEDIUMTEXT +--source include/column_compression_syntax_varchar.inc + +--let type=LONGTEXT +--source include/column_compression_syntax_varchar.inc + + +--echo # +--echo # VARBINARY and BLOB variables +--echo # + +--let type=VARCHAR(10) +--source include/column_compression_syntax_varbinary.inc + +--let type=TINYBLOB +--source include/column_compression_syntax_varbinary.inc + +--let type=BLOB +--source include/column_compression_syntax_varbinary.inc + +--let type=MEDIUMBLOB +--source include/column_compression_syntax_varbinary.inc + +--let type=LONGBLOB +--source include/column_compression_syntax_varbinary.inc + + +--echo # +--echo # NVARCHAR +--echo # + +CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED); +SHOW CREATE TABLE t1; +DROP TABLE t1; +--error ER_PARSE_ERROR +CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED BINARY COMPRESSED); +--error ER_PARSE_ERROR +CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED DEFAULT '' COMPRESSED); diff --git a/mysql-test/suite/compat/oracle/t/keywords.test b/mysql-test/suite/compat/oracle/t/keywords.test new file mode 100644 index 00000000000..0768633bf8b --- /dev/null +++ b/mysql-test/suite/compat/oracle/t/keywords.test @@ -0,0 +1,29 @@ +SET sql_mode=ORACLE; + +--echo # +--echo # MDEV-17363 Compressed columns cannot be restored from dump +--echo # In sql_mode=ORACLE, COMPRESSED is still valid both as an SP label +--echo # and an SP variable name. +--echo # + +DELIMITER $$; +BEGIN + IF TRUE THEN + GOTO compressed; + END IF; + SELECT 'This should not be reached' AS warn; +<> + BEGIN + SELECT 1 AS a; + END; +END +$$ +DELIMITER ;$$ + +DELIMITER $$; +DECLARE compressed INT DEFAULT 1; +BEGIN + SELECT compressed; +END +$$ +DELIMITER ;$$ diff --git a/mysql-test/suite/compat/oracle/t/mysqldump_restore.test b/mysql-test/suite/compat/oracle/t/mysqldump_restore.test new file mode 100644 index 00000000000..dd54c2b5636 --- /dev/null +++ b/mysql-test/suite/compat/oracle/t/mysqldump_restore.test @@ -0,0 +1,30 @@ +# See comments in mysql-test/main/mysqldump_restore.test +--source include/not_embedded.inc + +SET sql_mode=ORACLE; + +let $mysqldumpfile = $MYSQLTEST_VARDIR/tmp/mysqldumpfile.sql; + +--echo # +--echo # Start of 10.3 tests +--echo # + +--echo # +--echo # MDEV-17363 Compressed columns cannot be restored from dump +--echo # + +CREATE TABLE t1 (a VARCHAR(1000) COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL); +INSERT INTO `t1` VALUES (REPEAT('a', 256)); +--exec $MYSQL_DUMP --skip-extended-insert test --skip-comments t1 > $mysqldumpfile +let $table_name = test.t1; +--source include/mysqldump.inc + +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL); +INSERT INTO `t1` VALUES (REPEAT('a', 256)); +--exec $MYSQL_DUMP --skip-extended-insert test --skip-comments t1 > $mysqldumpfile +let $table_name = test.t1; +--source include/mysqldump.inc + +--echo # +--echo # End of 10.3 tests +--echo # diff --git a/sql/field.cc b/sql/field.cc index c6bdb013cdf..842f92e858f 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -11105,20 +11105,48 @@ bool Column_definition::has_default_expression() bool Column_definition::set_compressed(const char *method) { + if (!method || !strcmp(method, zlib_compression_method->name)) + { + unireg_check= Field::TMYSQL_COMPRESSED; + compression_method_ptr= zlib_compression_method; + return false; + } + my_error(ER_UNKNOWN_COMPRESSION_METHOD, MYF(0), method); + return true; +} + + +bool Column_definition::set_compressed_deprecated(THD *thd, const char *method) +{ + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_WARN_DEPRECATED_SYNTAX, + ER_THD(thd, ER_WARN_DEPRECATED_SYNTAX), + " ... COMPRESSED...", + "' COMPRESSED... ...'"); + return set_compressed(method); +} + + +bool +Column_definition::set_compressed_deprecated_column_attribute(THD *thd, + const char *pos, + const char *method) +{ + if (compression_method_ptr) + { + /* + Compression method has already been set, e.g.: + a VARCHAR(10) COMPRESSED DEFAULT 10 COMPRESSED + */ + thd->parse_error(ER_SYNTAX_ERROR, pos); + return true; + } enum enum_field_types sql_type= real_field_type(); /* We can't use f_is_blob here as pack_flag is not yet set */ if (sql_type == MYSQL_TYPE_VARCHAR || sql_type == MYSQL_TYPE_TINY_BLOB || sql_type == MYSQL_TYPE_BLOB || sql_type == MYSQL_TYPE_MEDIUM_BLOB || sql_type == MYSQL_TYPE_LONG_BLOB) - { - if (!method || !strcmp(method, zlib_compression_method->name)) - { - unireg_check= Field::TMYSQL_COMPRESSED; - compression_method_ptr= zlib_compression_method; - return false; - } - my_error(ER_UNKNOWN_COMPRESSION_METHOD, MYF(0), method); - } + return set_compressed_deprecated(thd, method); else my_error(ER_WRONG_FIELD_SPEC, MYF(0), field_name.str); return true; diff --git a/sql/field.h b/sql/field.h index 47952a4dfd8..3e5b84f9249 100644 --- a/sql/field.h +++ b/sql/field.h @@ -4559,6 +4559,10 @@ public: *this= *def; } bool set_compressed(const char *method); + bool set_compressed_deprecated(THD *thd, const char *method); + bool set_compressed_deprecated_column_attribute(THD *thd, + const char *pos, + const char *method); void set_compression_method(Compression_method *compression_method_arg) { compression_method_ptr= compression_method_arg; } Compression_method *compression_method() const diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 814017f0231..e844c500b77 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2092,7 +2092,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); ref_list opt_match_clause opt_on_update_delete use opt_delete_options opt_delete_option varchar nchar nvarchar opt_outer table_list table_name table_alias_ref_list table_alias_ref - opt_attribute opt_attribute_list attribute column_list column_list_id + attribute attribute_list + compressed_deprecated_data_type_attribute + compressed_deprecated_column_attribute + column_list column_list_id opt_column_list grant_privileges grant_ident grant_list grant_option object_privilege object_privilege_list user_list user_and_role_list rename_list table_or_tables @@ -6779,7 +6782,10 @@ opt_asrow_attribute_list: ; field_def: - opt_attribute + /* empty */ { } + | attribute_list + | attribute_list compressed_deprecated_column_attribute + | attribute_list compressed_deprecated_column_attribute attribute_list | opt_generated_always AS virtual_column_func { Lex->last_field->vcol_info= $3; @@ -6965,6 +6971,13 @@ field_type_numeric: ; +opt_binary_and_compression: + /* empty */ + | binary + | binary compressed_deprecated_data_type_attribute + | compressed opt_binary + ; + field_type_string: char opt_field_length_default_1 opt_binary { @@ -6980,25 +6993,25 @@ field_type_string: Lex->charset=&my_charset_bin; $$.set(&type_handler_string, $2); } - | varchar field_length opt_binary + | varchar field_length opt_binary_and_compression { $$.set(&type_handler_varchar, $2); } - | VARCHAR2_ORACLE_SYM field_length opt_binary + | VARCHAR2_ORACLE_SYM field_length opt_binary_and_compression { $$.set(&type_handler_varchar, $2); } - | nvarchar field_length opt_bin_mod + | nvarchar field_length opt_compressed opt_bin_mod { $$.set(&type_handler_varchar, $2); - bincmp_collation(national_charset_info, $3); + bincmp_collation(national_charset_info, $4); } - | VARBINARY field_length + | VARBINARY field_length opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_varchar, $2); } - | RAW_ORACLE_SYM field_length + | RAW_ORACLE_SYM field_length opt_compressed { Lex->charset= &my_charset_bin; $$.set(&type_handler_varchar, $2); @@ -7064,17 +7077,17 @@ field_type_temporal: field_type_lob: - TINYBLOB + TINYBLOB opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_tiny_blob); } - | BLOB_MARIADB_SYM opt_field_length + | BLOB_MARIADB_SYM opt_field_length opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_blob, $2); } - | BLOB_ORACLE_SYM opt_field_length + | BLOB_ORACLE_SYM opt_field_length opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_long_blob); @@ -7090,36 +7103,36 @@ field_type_lob: sym_group_geom.needed_define)); #endif } - | MEDIUMBLOB + | MEDIUMBLOB opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_medium_blob); } - | LONGBLOB + | LONGBLOB opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_long_blob); } - | LONG_SYM VARBINARY + | LONG_SYM VARBINARY opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_medium_blob); } - | LONG_SYM varchar opt_binary + | LONG_SYM varchar opt_binary_and_compression { $$.set(&type_handler_medium_blob); } - | TINYTEXT opt_binary + | TINYTEXT opt_binary_and_compression { $$.set(&type_handler_tiny_blob); } - | TEXT_SYM opt_field_length opt_binary + | TEXT_SYM opt_field_length opt_binary_and_compression { $$.set(&type_handler_blob, $2); } - | MEDIUMTEXT opt_binary + | MEDIUMTEXT opt_binary_and_compression { $$.set(&type_handler_medium_blob); } - | LONGTEXT opt_binary + | LONGTEXT opt_binary_and_compression { $$.set(&type_handler_long_blob); } - | CLOB_ORACLE_SYM opt_binary + | CLOB_ORACLE_SYM opt_binary_and_compression { $$.set(&type_handler_long_blob); } - | LONG_SYM opt_binary + | LONG_SYM opt_binary_and_compression { $$.set(&type_handler_medium_blob); } - | JSON_SYM + | JSON_SYM opt_compressed { Lex->charset= &my_charset_utf8mb4_bin; $$.set(&type_handler_long_blob); @@ -7233,13 +7246,9 @@ opt_precision: | precision { $$= $1; } ; -opt_attribute: - /* empty */ {} - | opt_attribute_list {} - ; -opt_attribute_list: - opt_attribute_list attribute {} +attribute_list: + attribute_list attribute {} | attribute ; @@ -7267,11 +7276,6 @@ attribute: $2->name,Lex->charset->csname)); Lex->last_field->charset= $2; } - | COMPRESSED_SYM opt_compression_method - { - if (unlikely(Lex->last_field->set_compressed($2))) - MYSQL_YYABORT; - } | serial_attribute ; @@ -7280,6 +7284,36 @@ opt_compression_method: | equal ident { $$= $2.str; } ; +opt_compressed: + /* empty */ {} + | compressed { } + ; + +compressed: + COMPRESSED_SYM opt_compression_method + { + if (unlikely(Lex->last_field->set_compressed($2))) + MYSQL_YYABORT; + } + ; + +compressed_deprecated_data_type_attribute: + COMPRESSED_SYM opt_compression_method + { + if (unlikely(Lex->last_field->set_compressed_deprecated(thd, $2))) + MYSQL_YYABORT; + } + ; + +compressed_deprecated_column_attribute: + COMPRESSED_SYM opt_compression_method + { + if (unlikely(Lex->last_field-> + set_compressed_deprecated_column_attribute(thd, $1.pos(), $2))) + MYSQL_YYABORT; + } + ; + asrow_attribute: not NULL_SYM { @@ -7438,7 +7472,11 @@ charset_or_alias: opt_binary: /* empty */ { bincmp_collation(NULL, false); } - | BYTE_SYM { bincmp_collation(&my_charset_bin, false); } + | binary {} + ; + +binary: + BYTE_SYM { bincmp_collation(&my_charset_bin, false); } | charset_or_alias opt_bin_mod { bincmp_collation($1, $2); } | BINARY { bincmp_collation(NULL, true); } | BINARY charset_or_alias { bincmp_collation($2, true); } @@ -15713,6 +15751,7 @@ keyword_sp_var_not_label: | COLUMN_DELETE_SYM | COLUMN_GET_SYM | COMMENT_SYM + | COMPRESSED_SYM | DEALLOCATE_SYM | EXAMINED_SYM | EXCLUDE_SYM @@ -15925,7 +15964,6 @@ keyword_sp_var_and_label: | COMMITTED_SYM | COMPACT_SYM | COMPLETION_SYM - | COMPRESSED_SYM | CONCURRENT | CONNECTION_SYM | CONSISTENT_SYM diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index fcf0dc01562..1ba77dcd16e 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -278,10 +278,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %parse-param { THD *thd } %lex-param { THD *thd } /* - Currently there are 53 shift/reduce conflicts. + Currently there are 55 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 53 +%expect 55 /* Comments for TOKENS. @@ -1495,7 +1495,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); ref_list opt_match_clause opt_on_update_delete use opt_delete_options opt_delete_option varchar nchar nvarchar opt_outer table_list table_name table_alias_ref_list table_alias_ref - opt_attribute opt_attribute_list attribute column_list column_list_id + attribute attribute_list + compressed_deprecated_data_type_attribute + compressed_deprecated_column_attribute + column_list column_list_id opt_column_list grant_privileges grant_ident grant_list grant_option object_privilege object_privilege_list user_list user_and_role_list rename_list table_or_tables @@ -6625,7 +6628,10 @@ opt_asrow_attribute_list: ; field_def: - opt_attribute + /* empty */ { } + | attribute_list + | attribute_list compressed_deprecated_column_attribute + | attribute_list compressed_deprecated_column_attribute attribute_list | opt_generated_always AS virtual_column_func { Lex->last_field->vcol_info= $3; @@ -6821,6 +6827,13 @@ field_type_numeric: ; +opt_binary_and_compression: + /* empty */ + | binary + | binary compressed_deprecated_data_type_attribute + | compressed opt_binary + ; + field_type_string: char opt_field_length_default_1 opt_binary { @@ -6836,25 +6849,25 @@ field_type_string: Lex->charset=&my_charset_bin; $$.set(&type_handler_string, $2); } - | varchar field_length opt_binary + | varchar field_length opt_binary_and_compression { $$.set(&type_handler_varchar, $2); } - | VARCHAR2_ORACLE_SYM field_length opt_binary + | VARCHAR2_ORACLE_SYM field_length opt_binary_and_compression { $$.set(&type_handler_varchar, $2); } - | nvarchar field_length opt_bin_mod + | nvarchar field_length opt_compressed opt_bin_mod { $$.set(&type_handler_varchar, $2); - bincmp_collation(national_charset_info, $3); + bincmp_collation(national_charset_info, $4); } - | VARBINARY field_length + | VARBINARY field_length opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_varchar, $2); } - | RAW_ORACLE_SYM field_length + | RAW_ORACLE_SYM field_length opt_compressed { Lex->charset= &my_charset_bin; $$.set(&type_handler_varchar, $2); @@ -6962,17 +6975,17 @@ field_type_temporal: field_type_lob: - TINYBLOB + TINYBLOB opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_tiny_blob); } - | BLOB_MARIADB_SYM opt_field_length + | BLOB_MARIADB_SYM opt_field_length opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_blob, $2); } - | BLOB_ORACLE_SYM opt_field_length + | BLOB_ORACLE_SYM opt_field_length opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_long_blob); @@ -6988,36 +7001,36 @@ field_type_lob: sym_group_geom.needed_define)); #endif } - | MEDIUMBLOB + | MEDIUMBLOB opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_medium_blob); } - | LONGBLOB + | LONGBLOB opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_long_blob); } - | LONG_SYM VARBINARY + | LONG_SYM VARBINARY opt_compressed { Lex->charset=&my_charset_bin; $$.set(&type_handler_medium_blob); } - | LONG_SYM varchar opt_binary + | LONG_SYM varchar opt_binary_and_compression { $$.set(&type_handler_medium_blob); } - | TINYTEXT opt_binary + | TINYTEXT opt_binary_and_compression { $$.set(&type_handler_tiny_blob); } - | TEXT_SYM opt_field_length opt_binary + | TEXT_SYM opt_field_length opt_binary_and_compression { $$.set(&type_handler_blob, $2); } - | MEDIUMTEXT opt_binary + | MEDIUMTEXT opt_binary_and_compression { $$.set(&type_handler_medium_blob); } - | LONGTEXT opt_binary + | LONGTEXT opt_binary_and_compression { $$.set(&type_handler_long_blob); } - | CLOB_ORACLE_SYM opt_binary + | CLOB_ORACLE_SYM opt_binary_and_compression { $$.set(&type_handler_long_blob); } - | LONG_SYM opt_binary + | LONG_SYM opt_binary_and_compression { $$.set(&type_handler_medium_blob); } - | JSON_SYM + | JSON_SYM opt_compressed { Lex->charset= &my_charset_utf8mb4_bin; $$.set(&type_handler_long_blob); @@ -7157,13 +7170,9 @@ opt_precision: | precision { $$= $1; } ; -opt_attribute: - /* empty */ {} - | opt_attribute_list {} - ; -opt_attribute_list: - opt_attribute_list attribute {} +attribute_list: + attribute_list attribute {} | attribute ; @@ -7191,11 +7200,6 @@ attribute: $2->name,Lex->charset->csname)); Lex->last_field->charset= $2; } - | COMPRESSED_SYM opt_compression_method - { - if (unlikely(Lex->last_field->set_compressed($2))) - MYSQL_YYABORT; - } | serial_attribute ; @@ -7204,6 +7208,36 @@ opt_compression_method: | equal ident { $$= $2.str; } ; +opt_compressed: + /* empty */ {} + | compressed { } + ; + +compressed: + COMPRESSED_SYM opt_compression_method + { + if (unlikely(Lex->last_field->set_compressed($2))) + MYSQL_YYABORT; + } + ; + +compressed_deprecated_data_type_attribute: + COMPRESSED_SYM opt_compression_method + { + if (unlikely(Lex->last_field->set_compressed_deprecated(thd, $2))) + MYSQL_YYABORT; + } + ; + +compressed_deprecated_column_attribute: + COMPRESSED_SYM opt_compression_method + { + if (unlikely(Lex->last_field-> + set_compressed_deprecated_column_attribute(thd, $1.pos(), $2))) + MYSQL_YYABORT; + } + ; + asrow_attribute: not NULL_SYM { @@ -7375,7 +7409,11 @@ charset_or_alias: opt_binary: /* empty */ { bincmp_collation(NULL, false); } - | BYTE_SYM { bincmp_collation(&my_charset_bin, false); } + | binary {} + ; + +binary: + BYTE_SYM { bincmp_collation(&my_charset_bin, false); } | charset_or_alias opt_bin_mod { bincmp_collation($1, $2); } | BINARY { bincmp_collation(NULL, true); } | BINARY charset_or_alias { bincmp_collation($2, true); } @@ -15648,6 +15686,7 @@ keyword_label: | keyword_sp_var_and_label | keyword_sysvar_type | FUNCTION_SYM + | COMPRESSED_SYM ; keyword_sysvar_name: @@ -15717,6 +15756,7 @@ keyword_sp_var_not_label: | COLUMN_DELETE_SYM | COLUMN_GET_SYM | COMMENT_SYM + | COMPRESSED_SYM | DEALLOCATE_SYM | EXAMINED_SYM | EXCLUDE_SYM @@ -15929,7 +15969,6 @@ keyword_sp_var_and_label: | COMMITTED_SYM | COMPACT_SYM | COMPLETION_SYM - | COMPRESSED_SYM | CONCURRENT | CONNECTION_SYM | CONSISTENT_SYM From 03f3ba2dcb07a672f9c1d87489b9ec88af62a96f Mon Sep 17 00:00:00 2001 From: mkaruza Date: Tue, 18 Jun 2019 11:29:54 +0200 Subject: [PATCH 20/22] MDEV-18940 Galera: Rolling upgrade: all nodes except upgraded node5 failed with Assertion `meta->gtid.seqno == wsrep_thd_trx_seqno(thd)' with SEQUENCEs (#1342) Empty write sets will not trigger apply callback, and will not update thread wsrep_trx_meta.gtid.seqno. Because of that assert will be triggered when commit callback is called. --- sql/wsrep_applier.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/wsrep_applier.cc b/sql/wsrep_applier.cc index 9d39b36793f..0322c5f6a40 100644 --- a/sql/wsrep_applier.cc +++ b/sql/wsrep_applier.cc @@ -360,7 +360,7 @@ wsrep_cb_status_t wsrep_commit_cb(void* const ctx, { THD* const thd((THD*)ctx); - assert(meta->gtid.seqno == wsrep_thd_trx_seqno(thd)); + assert(meta->gtid.seqno >= wsrep_thd_trx_seqno(thd)); wsrep_cb_status_t rcode; From b23c82fef38839f9f6b758091dfb5064c017f608 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Tue, 18 Jun 2019 14:32:24 +0300 Subject: [PATCH 21/22] MDEV-18078 Assertion `trnman_has_locked_tables(trn) > 0' failed Problem was that in case of implicit rollback for alter table Aria did try to run commit twice. The test case for this is tricky to do in 10.2, so it will be added to 10.4 as part of BACKUP STAGE testing. --- storage/maria/ha_maria.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index f64ea4b1edb..5f0d023f42b 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -2743,7 +2743,8 @@ int ha_maria::external_lock(THD *thd, int lock_type) } else { - TRN *trn= (file->trn != &dummy_transaction_object ? file->trn : 0); + /* We have to test for THD_TRN to protect against implicit commits */ + TRN *trn= (file->trn != &dummy_transaction_object && THD_TRN ? file->trn : 0); /* End of transaction */ /* From 8acbf9c1f961aa1008ef509e059e1a09943f5ed3 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Wed, 19 Jun 2019 00:35:44 +0300 Subject: [PATCH 22/22] MDEV-19595 fixed The test cases for the MDEV found several independent bugs in MariaDB server and Aria: - If a temporary table was marked as crashed, it could never be deleted. - Opening of a crashed temporary table gave an error message but the error was never forwarded to the caller which caused an assert() in my_ok() - init_read_record() did mmap of all temporary tables, which is probably not a good idea as this area can potentially be very big. Changed code to only mmap internal temporary tables. - mmap-ed tables where not unmapped in case of repair/optimize which caused bad data in table and crashes if the original table files where replaced with new ones (as the old mmap was still in place). Fixed by removing the mmap in case of repair. - Cleaned up usage of code that disabled mmap in Aria --- mysql-test/suite/maria/temporary.result | 23 +++++++++++++++++++++++ mysql-test/suite/maria/temporary.test | 20 ++++++++++++++++++++ sql/records.cc | 3 +-- sql/sql_parse.cc | 8 +++++++- sql/temporary_tables.cc | 5 ++++- storage/maria/ha_maria.cc | 4 +++- storage/maria/ma_close.c | 5 +---- storage/maria/ma_delete_all.c | 7 +++++-- storage/maria/ma_packrec.c | 9 +++++++-- storage/maria/maria_def.h | 8 ++++++++ 10 files changed, 79 insertions(+), 13 deletions(-) create mode 100644 mysql-test/suite/maria/temporary.result create mode 100644 mysql-test/suite/maria/temporary.test diff --git a/mysql-test/suite/maria/temporary.result b/mysql-test/suite/maria/temporary.result new file mode 100644 index 00000000000..2592e04be2b --- /dev/null +++ b/mysql-test/suite/maria/temporary.result @@ -0,0 +1,23 @@ +CREATE TABLE t1 (b INT); +INSERT INTO t1 VALUES (5); +CREATE TEMPORARY TABLE t1 (a INT) ENGINE=Aria ROW_FORMAT=DYNAMIC; +INSERT INTO t1 VALUES (1); +DELETE FROM t1 LIMIT 2; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT * FROM t1; +a +INSERT INTO t1 VALUES (1),(2); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +ALTER TABLE t1 CHANGE COLUMN IF EXISTS x x INT; +Warnings: +Note 1054 Unknown column 'x' in 't1' +ALTER TABLE t1; +DROP TEMPORARY TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/suite/maria/temporary.test b/mysql-test/suite/maria/temporary.test new file mode 100644 index 00000000000..76f8e2526a4 --- /dev/null +++ b/mysql-test/suite/maria/temporary.test @@ -0,0 +1,20 @@ +# +# MDEV-19595 +# ER_CRASHED_ON_USAGE and Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' +# failed upon actions on temporary Aria table with ROW_FORMAT DYNAMIC +# + +CREATE TABLE t1 (b INT); +INSERT INTO t1 VALUES (5); +CREATE TEMPORARY TABLE t1 (a INT) ENGINE=Aria ROW_FORMAT=DYNAMIC; +INSERT INTO t1 VALUES (1); +DELETE FROM t1 LIMIT 2; +OPTIMIZE TABLE t1; +CHECK TABLE t1; +SELECT * FROM t1; +INSERT INTO t1 VALUES (1),(2); +CHECK TABLE t1; +ALTER TABLE t1 CHANGE COLUMN IF EXISTS x x INT; +ALTER TABLE t1; +DROP TEMPORARY TABLE t1; +DROP TABLE t1; diff --git a/sql/records.cc b/sql/records.cc index 3db34425e29..6a611d46ca4 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -197,8 +197,7 @@ bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table, info->forms= &info->table; /* Only one table */ info->addon_field= addon_field; - if ((table->s->tmp_table == INTERNAL_TMP_TABLE || - table->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) && + if ((table->s->tmp_table == INTERNAL_TMP_TABLE) && !addon_field) (void) table->file->extra(HA_EXTRA_MMAP); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 976cfe3df03..6e2c38ad053 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -779,7 +779,6 @@ void init_update_queries(void) Note that SQLCOM_RENAME_TABLE should not be in this list! */ sql_command_flags[SQLCOM_CREATE_TABLE]|= CF_PREOPEN_TMP_TABLES; - sql_command_flags[SQLCOM_DROP_TABLE]|= CF_PREOPEN_TMP_TABLES; sql_command_flags[SQLCOM_CREATE_INDEX]|= CF_PREOPEN_TMP_TABLES; sql_command_flags[SQLCOM_ALTER_TABLE]|= CF_PREOPEN_TMP_TABLES; sql_command_flags[SQLCOM_TRUNCATE]|= CF_PREOPEN_TMP_TABLES; @@ -4459,7 +4458,14 @@ mysql_execute_command(THD *thd) } case SQLCOM_DROP_TABLE: { + int result; DBUG_ASSERT(first_table == all_tables && first_table != 0); + + thd->open_options|= HA_OPEN_FOR_REPAIR; + result= thd->open_temporary_tables(all_tables); + thd->open_options&= ~HA_OPEN_FOR_REPAIR; + if (result) + goto error; if (!lex->tmp_table()) { if (check_table_access(thd, DROP_ACL, all_tables, FALSE, UINT_MAX, FALSE)) diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 15a81f4b375..ae7cb274843 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -382,6 +382,9 @@ bool THD::open_temporary_table(TABLE_LIST *tl) rgi_slave->is_parallel_exec && wait_for_prior_commit()) DBUG_RETURN(true); + + if (!table && is_error()) + DBUG_RETURN(true); // Error when opening table } if (!table) @@ -1103,7 +1106,7 @@ TABLE *THD::open_temporary_table(TMP_TABLE_SHARE *share, if (open_table_from_share(this, share, alias, open_in_engine ? (uint)HA_OPEN_KEYFILE : 0, - EXTRA_RECORD, ha_open_options, table, + EXTRA_RECORD, open_options | ha_open_options, table, open_in_engine ? false : true)) { my_free(table); diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 5f0d023f42b..887065ff825 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -1301,6 +1301,7 @@ int ha_maria::check(THD * thd, HA_CHECK_OPT * check_opt) if (!file || !param) return HA_ADMIN_INTERNAL_ERROR; + unmap_file(file); maria_chk_init(param); param->thd= thd; param->op_name= "check"; @@ -1521,6 +1522,7 @@ int ha_maria::zerofill(THD * thd, HA_CHECK_OPT *check_opt) if (!file || !param) return HA_ADMIN_INTERNAL_ERROR; + unmap_file(file); old_trn= file->trn; maria_chk_init(param); param->thd= thd; @@ -1619,6 +1621,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize) param->out_flag= 0; share->state.dupp_key= MI_MAX_KEY; strmov(fixed_name, share->open_file_name.str); + unmap_file(file); /* Don't lock tables if we have used LOCK TABLE or if we come from @@ -1798,7 +1801,6 @@ int ha_maria::assign_to_keycache(THD * thd, HA_CHECK_OPT *check_opt) TABLE_LIST *table_list= table->pos_in_table_list; DBUG_ENTER("ha_maria::assign_to_keycache"); - table->keys_in_use_for_query.clear_all(); if (table_list->process_index_hints(table)) diff --git a/storage/maria/ma_close.c b/storage/maria/ma_close.c index bd0a36c14c8..03501dc49cf 100644 --- a/storage/maria/ma_close.c +++ b/storage/maria/ma_close.c @@ -113,10 +113,7 @@ int maria_close(register MARIA_HA *info) if (flush_pagecache_blocks(share->pagecache, &share->kfile, share->deleting ? FLUSH_IGNORE_CHANGED : FLUSH_RELEASE)) error= my_errno; -#ifdef HAVE_MMAP - if (share->file_map) - _ma_unmap_file(info); -#endif + unmap_file(info); if (((share->changed && share->base.born_transactional) || maria_is_crashed(info) || (share->temporary && !share->deleting))) { diff --git a/storage/maria/ma_delete_all.c b/storage/maria/ma_delete_all.c index 1daf5f3ef80..c1019c01c66 100644 --- a/storage/maria/ma_delete_all.c +++ b/storage/maria/ma_delete_all.c @@ -38,6 +38,9 @@ int maria_delete_all_rows(MARIA_HA *info) MARIA_SHARE *share= info->s; my_bool log_record; LSN lsn; +#ifdef HAVE_MMAP + my_bool mmap_file= share->file_map != 0; +#endif DBUG_ENTER("maria_delete_all_rows"); if (share->options & HA_OPTION_READ_ONLY_DATA) @@ -95,7 +98,7 @@ int maria_delete_all_rows(MARIA_HA *info) */ #ifdef HAVE_MMAP - if (share->file_map) + if (mmap_file) _ma_unmap_file(info); #endif @@ -141,7 +144,7 @@ int maria_delete_all_rows(MARIA_HA *info) _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE); #ifdef HAVE_MMAP /* Map again */ - if (share->file_map) + if (mmap_file) _ma_dynmap_file(info, (my_off_t) 0); #endif DBUG_RETURN(0); diff --git a/storage/maria/ma_packrec.c b/storage/maria/ma_packrec.c index 27c5538e51b..e2c1e353616 100644 --- a/storage/maria/ma_packrec.c +++ b/storage/maria/ma_packrec.c @@ -1564,8 +1564,13 @@ my_bool _ma_memmap_file(MARIA_HA *info) void _ma_unmap_file(MARIA_HA *info) { - my_munmap((char*) info->s->file_map, - (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN); + MARIA_SHARE *share= info->s; + my_munmap((char*) share->file_map, + (size_t) share->mmaped_length + MEMMAP_EXTRA_MARGIN); + share->file_map= 0; + share->file_read= _ma_nommap_pread; + share->file_write= _ma_nommap_pwrite; + info->opt_flag&= ~MEMMAP_USED; } diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h index f2c652c9286..a23e00a24a3 100644 --- a/storage/maria/maria_def.h +++ b/storage/maria/maria_def.h @@ -1431,3 +1431,11 @@ extern my_bool ma_yield_and_check_if_killed(MARIA_HA *info, int inx); extern my_bool ma_killed_standalone(MARIA_HA *); extern uint _ma_file_callback_to_id(void *callback_data); + +static inline void unmap_file(MARIA_HA *info __attribute__((unused))) +{ +#ifdef HAVE_MMAP + if (info->s->file_map) + _ma_unmap_file(info); +#endif +}