[Commits] a1cd421: Fix test cases.

Jan Lindström jan.lindstrom at mariadb.com
Tue Sep 6 14:17:47 EEST 2016


revision-id: a1cd421751bd77f41cc13f194f83aa4ff290d2f9 (mariadb-10.2.1-6-ga1cd421)
parent(s): 7812ec231718a45d948cba350d00a181444ccddf
committer: Jan Lindström
timestamp: 2016-09-06 14:17:41 +0300
message:

Fix test cases.

---
 .../sys_vars/r/innodb_strict_mode_basic.result     |  16 +--
 .../sys_vars/r/innodb_support_xa_basic.result      |  78 ++++++++++--
 .../suite/sys_vars/r/innodb_support_xa_func.result |  16 ++-
 storage/innobase/handler/ha_innodb.cc              |  22 +++-
 storage/innobase/handler/handler0alter.cc          | 134 +++++++++++----------
 storage/innobase/sync/sync0debug.cc                |   5 -
 6 files changed, 175 insertions(+), 96 deletions(-)

diff --git a/mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result b/mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result
index 9c5e62d..8bddb6a 100644
--- a/mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result
@@ -1,32 +1,32 @@
 SET @start_global_value = @@global.innodb_strict_mode;
 SELECT @start_global_value;
 @start_global_value
-0
+1
 Valid values are 'ON' and 'OFF' 
 select @@global.innodb_strict_mode in (0, 1);
 @@global.innodb_strict_mode in (0, 1)
 1
 select @@global.innodb_strict_mode;
 @@global.innodb_strict_mode
-0
+1
 select @@session.innodb_strict_mode in (0, 1);
 @@session.innodb_strict_mode in (0, 1)
 1
 select @@session.innodb_strict_mode;
 @@session.innodb_strict_mode
-0
+1
 show global variables like 'innodb_strict_mode';
 Variable_name	Value
-innodb_strict_mode	OFF
+innodb_strict_mode	ON
 show session variables like 'innodb_strict_mode';
 Variable_name	Value
-innodb_strict_mode	OFF
+innodb_strict_mode	ON
 select * from information_schema.global_variables where variable_name='innodb_strict_mode';
 VARIABLE_NAME	VARIABLE_VALUE
-INNODB_STRICT_MODE	OFF
+INNODB_STRICT_MODE	ON
 select * from information_schema.session_variables where variable_name='innodb_strict_mode';
 VARIABLE_NAME	VARIABLE_VALUE
-INNODB_STRICT_MODE	OFF
+INNODB_STRICT_MODE	ON
 set global innodb_strict_mode='OFF';
 set session innodb_strict_mode='OFF';
 select @@global.innodb_strict_mode;
@@ -118,4 +118,4 @@ INNODB_STRICT_MODE	ON
 SET @@global.innodb_strict_mode = @start_global_value;
 SELECT @@global.innodb_strict_mode;
 @@global.innodb_strict_mode
-0
+1
diff --git a/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result b/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
index 754b093..8384ee3 100644
--- a/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result
@@ -8,17 +8,27 @@ SELECT @global_start_value;
 1
 '#--------------------FN_DYNVARS_046_01------------------------#'
 SET @@session.innodb_support_xa = 0;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SET @@session.innodb_support_xa = DEFAULT;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SELECT @@session.innodb_support_xa;
 @@session.innodb_support_xa
 1
 SET @@global.innodb_support_xa = 0;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SET @@global.innodb_support_xa = DEFAULT;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SELECT @@global.innodb_support_xa;
 @@global.innodb_support_xa
 1
 '#---------------------FN_DYNVARS_046_02-------------------------#'
 SET innodb_support_xa = 1;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SELECT @@innodb_support_xa;
 @@innodb_support_xa
 1
@@ -29,27 +39,39 @@ ERROR 42S02: Unknown table 'local' in field list
 SELECT global.innodb_support_xa;
 ERROR 42S02: Unknown table 'global' in field list
 SET session innodb_support_xa = 0;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SELECT @@session.innodb_support_xa;
 @@session.innodb_support_xa
-0
+1
 SET global innodb_support_xa = 0;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SELECT @@global.innodb_support_xa;
 @@global.innodb_support_xa
-0
+1
 '#--------------------FN_DYNVARS_046_03------------------------#'
 SET @@session.innodb_support_xa = 0;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SELECT @@session.innodb_support_xa;
 @@session.innodb_support_xa
-0
+1
 SET @@session.innodb_support_xa = 1;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SELECT @@session.innodb_support_xa;
 @@session.innodb_support_xa
 1
 SET @@global.innodb_support_xa = 0;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SELECT @@global.innodb_support_xa;
 @@global.innodb_support_xa
-0
+1
 SET @@global.innodb_support_xa = 1;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SELECT @@global.innodb_support_xa;
 @@global.innodb_support_xa
 1
@@ -67,9 +89,11 @@ ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'TR
 SET @@session.innodb_support_xa = ÕN;
 ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÕN'
 SET @@session.innodb_support_xa = OF;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SELECT @@session.innodb_support_xa;
 @@session.innodb_support_xa
-0
+1
 SET @@session.innodb_support_xa = ÓFF;
 ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÓFF'
 SET @@global.innodb_support_xa = -1;
@@ -88,18 +112,26 @@ ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'TR
 SET @@global.innodb_support_xa = ÕN;
 ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÕN'
 SET @@global.innodb_support_xa = OF;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SELECT @@global.innodb_support_xa;
 @@global.innodb_support_xa
-0
+1
 SET @@global.innodb_support_xa = ÓFF;
 ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÓFF'
 '#-------------------FN_DYNVARS_046_05----------------------------#'
 SET @@global.innodb_support_xa = 0;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SET @@session.innodb_support_xa = 1;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SELECT @@global.innodb_support_xa AS res_is_0;
 res_is_0
-0
+1
 SET @@global.innodb_support_xa = 0;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SELECT @@session.innodb_support_xa AS res_is_1;
 res_is_1
 1
@@ -112,11 +144,11 @@ VARIABLE_VALUE
 1
 SELECT @@global.innodb_support_xa;
 @@global.innodb_support_xa
-0
+1
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_support_xa';
 VARIABLE_VALUE
-OFF
+ON
 '#----------------------FN_DYNVARS_046_07------------------------#'
 SELECT IF(@@session.innodb_support_xa, "ON", "OFF") =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
@@ -133,43 +165,63 @@ VARIABLE_VALUE
 ON
 '#---------------------FN_DYNVARS_046_08-------------------------#'
 SET @@session.innodb_support_xa = OFF;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SELECT @@session.innodb_support_xa;
 @@session.innodb_support_xa
-0
+1
 SET @@session.innodb_support_xa = ON;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SELECT @@session.innodb_support_xa;
 @@session.innodb_support_xa
 1
 SET @@global.innodb_support_xa = OFF;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SELECT @@global.innodb_support_xa;
 @@global.innodb_support_xa
-0
+1
 SET @@global.innodb_support_xa = ON;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SELECT @@global.innodb_support_xa;
 @@global.innodb_support_xa
 1
 '#---------------------FN_DYNVARS_046_09----------------------#'
 SET @@session.innodb_support_xa = TRUE;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SELECT @@session.innodb_support_xa;
 @@session.innodb_support_xa
 1
 SET @@session.innodb_support_xa = FALSE;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SELECT @@session.innodb_support_xa;
 @@session.innodb_support_xa
-0
+1
 SET @@global.innodb_support_xa = TRUE;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SELECT @@global.innodb_support_xa;
 @@global.innodb_support_xa
 1
 SET @@global.innodb_support_xa = FALSE;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 SELECT @@global.innodb_support_xa;
 @@global.innodb_support_xa
-0
+1
 SET @@session.innodb_support_xa = @session_start_value;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SELECT @@session.innodb_support_xa;
 @@session.innodb_support_xa
 1
 SET @@global.innodb_support_xa = @global_start_value;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SELECT @@global.innodb_support_xa;
 @@global.innodb_support_xa
 1
diff --git a/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result b/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result
index 7291b60..d86cf89 100644
--- a/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result
+++ b/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result
@@ -1,21 +1,27 @@
 '#--------------------FN_DYNVARS_046_01-------------------------#'
 SET @@global.innodb_support_xa = OFF;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 connect  con1,localhost,root,,,,;
 connection con1;
 SELECT @@global.innodb_support_xa;
 @@global.innodb_support_xa
-0
+1
 SELECT @@session.innodb_support_xa;
 @@session.innodb_support_xa
-0
+1
 disconnect con1;
 '#--------------------FN_DYNVARS_046_01-------------------------#'
 connection default;
 SET @@global.innodb_support_xa = 1;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 drop table if exists t1, t2;
 create table t1 (a int) engine=innodb;
 '---check when innodb_support_xa is 1---'
 SET @@innodb_support_xa = 1;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 xa start 'test1';
 INSERT t1 values (10);
 xa end 'test1';
@@ -25,6 +31,8 @@ SELECT * from t1;
 a
 '---check when innodb_support_xa is 0---'
 SET @@innodb_support_xa = 0;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases. Only innodb_support_xa=ON is allowed.
 xa start 'test1';
 INSERT t1 values (10);
 xa end 'test1';
@@ -34,7 +42,11 @@ SELECT * from t1;
 a
 '------general xa testing--------'
 SET @@global.innodb_support_xa = 1;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 SET @@innodb_support_xa = 1;
+Warnings:
+Warning	131	Using innodb_support_xa is deprecated and the parameter may be removed in future releases.
 xa start 'testa','testb';
 INSERT t1 values (30);
 COMMIT;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 5557da7..2fa98b3 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -2811,6 +2811,7 @@ innobase_raw_format(
 	return(ut_str_sql_format(buf_tmp, buf_tmp_used, buf, buf_size));
 }
 
+#ifdef MYSQL_COMPRESSION
 /** Check if the string is "empty" or "none".
 @param[in]      algorithm       Compression algorithm to check
 @return true if no algorithm requested */
@@ -2866,7 +2867,9 @@ Compression::validate(const char* algorithm)
 
 	return(check(algorithm, &compression));
 }
+#endif /* MYSQL_COMPRESSION */
 
+#ifdef MYSQL_ENCRYPTION
 /** Check if the string is "" or "n".
 @param[in]      algorithm       Encryption algorithm to check
 @return true if no algorithm requested */
@@ -2918,6 +2921,7 @@ Encryption::validate(const char* option)
 
 	return(encryption.set_algorithm(option, &encryption));
 }
+#endif /* MYSQL_ENCRYPTION */
 
 /*********************************************************************//**
 Compute the next autoinc value.
@@ -4682,7 +4686,7 @@ innobase_init(
 
 		/* Force O_DIRECT on Unixes (on Windows writes are always unbuffered)*/
 #ifndef _WIN32
-		if(!innobase_file_flush_method ||
+		if (!innobase_file_flush_method ||
 			!strstr(innobase_file_flush_method, "O_DIRECT")) {
 			innobase_file_flush_method =
 				srv_file_flush_method_str = (char*)"O_DIRECT";
@@ -6382,6 +6386,7 @@ innobase_match_index_columns(
 	DBUG_RETURN(TRUE);
 }
 
+#ifdef MYSQL_VIRTUAL_COLUMNS
 /** Build a template for a base column for a virtual column
 @param[in]	table		MySQL TABLE
 @param[in]	clust_index	InnoDB clustered index
@@ -6617,6 +6622,7 @@ innobase_build_v_templ(
 		s_templ->share_name = share_tbl_name;
 	}
 }
+#endif /* MYSQL_VIRTUAL_COLUMNS */
 
 /*******************************************************************//**
 This function builds a translation table in INNOBASE_SHARE
@@ -7029,7 +7035,7 @@ ha_innobase::open(
 
 		ib::warn() << "Table " << norm_name << " contains "
 			<< dict_table_get_n_user_cols(ib_table) << " user"
-			" defined columns in InnoDB, but " << table->s->fields
+			" defined columns in InnoDB, but " << table->s->stored_fields
 			<< " columns in MySQL. Please check"
 			" INFORMATION_SCHEMA.INNODB_SYS_COLUMNS and " REFMAN
 			"innodb-troubleshooting.html for how to resolve the"
@@ -7187,6 +7193,7 @@ ha_innobase::open(
 
 	key_used_on_scan = m_primary_key;
 
+#ifdef MYSQL_VIRTUAL_COLUMNS
 	if (ib_table->n_v_cols) {
 		mutex_enter(&dict_sys->mutex);
 		if (ib_table->vc_templ == NULL) {
@@ -7207,6 +7214,7 @@ ha_innobase::open(
 
 		mutex_exit(&dict_sys->mutex);
 	}
+#endif /* MYSQL_VIRTUAL_COLUMNS */
 
 	if (!innobase_build_index_translation(table, ib_table, m_share)) {
 		  sql_print_error("Build InnoDB index translation table for"
@@ -12194,6 +12202,7 @@ create_table_info_t::create_table_def()
 {
 	dict_table_t*	table;
 	ulint		n_cols;
+	ulint		s_cols;
 	ulint		col_type;
 	ulint		col_len;
 	ulint		nulls_allowed;
@@ -12239,6 +12248,7 @@ create_table_info_t::create_table_def()
 	}
 
 	n_cols = m_form->s->fields;
+	s_cols = m_form->s->stored_fields;
 
 #ifdef MYSQL_VIRTUAL_COLUMNS
 	/* Find out any virtual column */
@@ -12287,7 +12297,7 @@ create_table_info_t::create_table_def()
 	/* Set the hidden doc_id column. */
 	if (m_flags2 & DICT_TF2_FTS) {
 		table->fts->doc_col = has_doc_id_col
-				      ? doc_id_col : n_cols - num_v;
+				      ? doc_id_col : s_cols;
 	}
 
 	if (strlen(m_temp_path) != 0) {
@@ -14356,7 +14366,7 @@ create_table_info_t::prepare_create_table(
 	normalize_table_name(m_table_name, name);
 
 	/* Validate table options not handled by the SQL-parser */
-	if(check_table_options()) {
+	if (check_table_options()) {
 		DBUG_RETURN(HA_WRONG_CREATE_OPTION);
 	}
 
@@ -17171,7 +17181,7 @@ ha_innobase::optimize(
 				"InnoDB: Cannot defragment table %s: returned error code %d\n",
 				m_prebuilt->table->name, err);
 
-			if(err == ER_SP_ALREADY_EXISTS) {
+			if (err == ER_SP_ALREADY_EXISTS) {
 				return (HA_ADMIN_OK);
 			} else {
 				return (HA_ADMIN_TRY_ALTER);
@@ -19339,7 +19349,7 @@ ha_innobase::store_lock(
 	}
 
 #ifdef UNIV_DEBUG
-	if(trx->is_dd_trx) {
+	if (trx->is_dd_trx) {
 		ut_ad(trx->will_lock == 0
 		      && m_prebuilt->select_lock_type == LOCK_NONE);
 	}
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 449df9c..79eaabd 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -82,14 +82,14 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ALTER_REBUILD
 	| Alter_inplace_info::ALTER_COLUMN_ORDER
 	| Alter_inplace_info::DROP_COLUMN
 	| Alter_inplace_info::ADD_COLUMN
-	/* JAN: TODO: MySQL 5.7
+#ifdef MYSQL_STORED_COLUMNS
 	| Alter_inplace_info::ALTER_STORED_COLUMN_ORDER
 	| Alter_inplace_info::DROP_STORED_COLUMN
 	| Alter_inplace_info::ADD_STORED_BASE_COLUMN
-	*/
+	| Alter_inplace_info::ALTER_STORED_COLUMN_TYPE
+#endif
 	| Alter_inplace_info::RECREATE_TABLE
 	/*
-	| Alter_inplace_info::ALTER_STORED_COLUMN_TYPE
 	*/
 	;
 
@@ -103,8 +103,9 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_INPLACE_IGNORE
 	| Alter_inplace_info::ALTER_PARTITIONED
 	| Alter_inplace_info::ALTER_COLUMN_COLUMN_FORMAT
 	| Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE
-	// JAN: TODO: MySQL 5.7
-	// | Alter_inplace_info::ALTER_VIRTUAL_GCOL_EXPR
+#ifdef MYSQL_VIRTUAL_COLUMNS
+	| Alter_inplace_info::ALTER_VIRTUAL_GCOL_EXPR
+#endif
 	| Alter_inplace_info::ALTER_RENAME;
 
 /** Operations on foreign key definitions (changing the schema only) */
@@ -118,19 +119,19 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ALTER_NOREBUILD
 	| INNOBASE_FOREIGN_OPERATIONS
 	| Alter_inplace_info::DROP_INDEX
 	| Alter_inplace_info::DROP_UNIQUE_INDEX
-	/* JAN: TODO: MySQL 5.7
+#ifdef MYSQL_RENAME_INDEX
 	| Alter_inplace_info::RENAME_INDEX
-	*/
+#endif
 	| Alter_inplace_info::ALTER_COLUMN_NAME
 	| Alter_inplace_info::ALTER_COLUMN_EQUAL_PACK_LENGTH;
-	/* JAN: TODO: MySQL 5.7
+#ifdef MYSQL_VIRTUAL_COLUMNS
 	| Alter_inplace_info::ALTER_INDEX_COMMENT
 	| Alter_inplace_info::ADD_VIRTUAL_COLUMN
 	| Alter_inplace_info::DROP_VIRTUAL_COLUMN
-	| Alter_inplace_info::ALTER_VIRTUAL_COLUMN_ORDER;
-	*/
-	/* | Alter_inplace_info::ALTER_VIRTUAL_COLUMN_TYPE; */
-
+	| Alter_inplace_info::ALTER_VIRTUAL_COLUMN_ORDER
+	| Alter_inplace_info::ALTER_VIRTUAL_COLUMN_TYPE
+#endif
+	;
 struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
 {
 	/** Dummy query graph */
@@ -966,15 +967,14 @@ ha_innobase::check_if_supported_inplace_alter(
 	DBUG_ASSERT(!m_prebuilt->table->fts || m_prebuilt->table->fts->doc_col
 		    < dict_table_get_n_user_cols(m_prebuilt->table));
 
-	/*
+#ifdef MYSQL_SPATIAL_INDEX
 	if (ha_alter_info->handler_flags
 	    & Alter_inplace_info::ADD_SPATIAL_INDEX) {
 		ha_alter_info->unsupported_reason = innobase_get_err_msg(
 			ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS);
 		online = false;
 	}
-
-	*/
+#endif
 
 	if (m_prebuilt->table->fts
 	    && innobase_fulltext_exist(altered_table)) {
@@ -1034,17 +1034,20 @@ ha_innobase::check_if_supported_inplace_alter(
 			DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
 		}
 
-		/*
 		if (innobase_spatial_exist(altered_table)) {
+#ifdef MYSQL_SPATIAL_INDEX
 			ha_alter_info->unsupported_reason =
 				innobase_get_err_msg(
 				ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS);
+#endif
+			ha_alter_info->unsupported_reason = innobase_get_err_msg(
+				ER_INNODB_FT_LIMIT);
+			DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
 		} else {
-		*/
 			ha_alter_info->unsupported_reason =
 				innobase_get_err_msg(
 				ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS);
-			//}
+		}
 	} else if ((ha_alter_info->handler_flags
 		    & Alter_inplace_info::ADD_INDEX)) {
 		/* Building a full-text index requires a lock.
@@ -1532,7 +1535,7 @@ innobase_get_foreign_key_info(
 		add_fk[num_fk] = dict_mem_foreign_create();
 
 #ifndef _WIN32
-		if(fk_key->ref_db.str) {
+		if (fk_key->ref_db.str) {
 			tablename_to_filename(fk_key->ref_db.str, db_name,
 					      MAX_DATABASE_NAME_LEN);
 			db_namep = db_name;
@@ -2033,6 +2036,7 @@ innobase_check_index_keys(
 				}
 			}
 
+#ifdef MYSQL_RENAME_INDEX
 			/* If a key by the same name is being created and
 			renamed, the name clash is OK. E.g.
 			ALTER TABLE t ADD INDEX i (col), RENAME INDEX i TO x
@@ -2040,7 +2044,6 @@ innobase_check_index_keys(
 			In this case we:
 			1. rename the existing index from "i" to "x"
 			2. add the new index "i" */
-			/* JAN: TODO: MySQL 5.7
 			for (uint i = 0; i < info->index_rename_count; i++) {
 				const KEY_PAIR*	pair
 					= &info->index_rename_buffer[i];
@@ -2049,7 +2052,8 @@ innobase_check_index_keys(
 					goto name_ok;
 				}
 			}
-			*/
+#endif /* MYSQL_RENAME_INDEX */
+
 			my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key.name);
 
 			return(ER_WRONG_NAME_FOR_INDEX);
@@ -2162,19 +2166,21 @@ innobase_create_index_field_def(
 	col_type = get_innobase_type_from_mysql_type(
 		&is_unsigned, field);
 
-	// JAN: TODO: MySQL 5.7 Virtual columns
-	//if (!field->stored_in_db && field->gcol_info) {
-	// if (!field->stored_in_db() && false) {
-	//	index_field->is_v_col = true;
-	//	index_field->col_no = num_v;
-	// } else {
-	//      index_field->is_v_col = false;
-	//	index_field->col_no = key_part->fieldnr - num_v;
-	//}
-
+#ifdef MYSQL_VIRTUAL_COLUMNS
+	if (!field->stored_in_db && field->gcol_info) {
+		if (!field->stored_in_db && false) {
+			index_field->is_v_col = true;
+			index_field->col_no = num_v;
+		} else {
+			index_field->is_v_col = false;
+			index_field->col_no = key_part->fieldnr - num_v;
+		}
+	}
+#else
 	index_field->is_v_col = false;
 	index_field->col_no = key_part->fieldnr - num_m_v;
 	index_field->col_name = altered_table ? field->field_name : fields[key_part->fieldnr]->field_name;
+#endif /* MYSQL_VIRTUAL_COLUMNS */
 
 	if (DATA_LARGE_MTYPE(col_type)
 	    || (key_part->length < field->pack_length()
@@ -2290,20 +2296,22 @@ innobase_create_index_def(
 		index->fields[0].col_no = key->key_part[0].fieldnr - num_v;
 		index->fields[0].prefix_len = 0;
 		index->fields[0].is_v_col = false;
-		/* JAN: TODO: MySQL 5.7 Virtual columns & spatial indexes
-		if (!key->key_part[0].field->stored_in_db()
+
+ #ifdef MYSQL_VIRTUAL_COLUMNS
+		if (!key->key_part[0].field->stored_in_db
 		    && key->key_part[0].field->gcol_info) {
-		*/
+
 			/* Currently, the spatial index cannot be created
 			on virtual columns. It is blocked in server
 			layer */
-		/*
+
 			ut_ad(0);
 			index->fields[0].is_v_col = true;
 		} else {
-		*/
+
 			index->fields[0].is_v_col = false;
-		//}
+		}
+#endif /* MYSQL_VIRTUAL_COLUMNS */
 	} else {
 		index->ind_type = (key->flags & HA_NOSAME) ? DICT_UNIQUE : 0;
 	}
@@ -3728,10 +3736,8 @@ prepare_inplace_add_virtual(
 				= get_innobase_type_from_mysql_type(
 					&is_unsigned, field);
 
-		/* JAN: TODO: MySQL 5.7
+
 		if (!field->gcol_info || field->stored_in_db) {
-		*/
-		if (field->stored_in_db()) {
 			my_error(ER_WRONG_KEY_COLUMN, MYF(0),
 				 field->field_name);
 			return(true);
@@ -3874,10 +3880,8 @@ prepare_inplace_drop_virtual(
                                 = get_innobase_type_from_mysql_type(
                                         &is_unsigned, field);
 
-		/* JAN: TODO: MySQL 5.7
+
 		if (!field->gcol_info || field->stored_in_db) {
-		*/
-		if (field->stored_in_db()) {
 			my_error(ER_WRONG_KEY_COLUMN, MYF(0),
 				 field->field_name);
 			return(true);
@@ -4658,7 +4662,6 @@ prepare_inplace_alter_table_dict(
 		ulint		n_mv_cols = 0;
 		dtuple_t*	add_cols;
 		ulint		space_id = 0;
-		ulint		z = 0;
 		ulint		key_id = FIL_DEFAULT_ENCRYPTION_KEY;
 		fil_encryption_t mode = FIL_SPACE_ENCRYPTION_DEFAULT;
 		const char*	compression=NULL;
@@ -4823,7 +4826,7 @@ prepare_inplace_alter_table_dict(
 			}
 
 			if (is_virtual) {
-				/* JAN: TODO: MySQL 5.7 virtual columns
+#ifdef MYSQL_VIRTUAL_COLUMNS
 				dict_mem_table_add_v_col(
 					ctx->new_table, ctx->heap,
 					field->field_name,
@@ -4833,7 +4836,7 @@ prepare_inplace_alter_table_dict(
 					| DATA_VIRTUAL,
 					col_len, i,
 					field->gcol_info->non_virtual_base_columns());
-				*/
+#endif /* MYSQL_VIRTUAL_COLUMNS */
 			} else {
 				dict_mem_table_add_col(
 					ctx->new_table, ctx->heap,
@@ -4846,6 +4849,8 @@ prepare_inplace_alter_table_dict(
 		}
 
 #ifdef MYSQL_VIRTUAL_COLUMNS
+		ulint		z = 0;
+
 		if (n_v_cols) {
 			for (uint i = 0; i < altered_table->s->fields; i++) {
 				dict_v_col_t*	v_col;
@@ -4866,23 +4871,22 @@ prepare_inplace_alter_table_dict(
 		if (add_fts_doc_id) {
 			fts_add_doc_id_column(ctx->new_table, ctx->heap);
 			ctx->new_table->fts->doc_col = fts_doc_id_col;
-			// JAN: TODO: MySQL 5.7 Virtual columns
-			// ut_ad(fts_doc_id_col
-			//      == altered_table->s->fields - n_v_cols);
-			// ut_ad(fts_doc_id_col == altered_table->s->stored_fields);
+			ut_ad(fts_doc_id_col
+			      == altered_table->s->stored_fields - n_v_cols);
+			ut_ad(fts_doc_id_col == altered_table->s->stored_fields);
 
 		} else if (ctx->new_table->fts) {
 			ctx->new_table->fts->doc_col = fts_doc_id_col;
 		}
 
-		/* JAN: TODO: MySQL 5.7 Compression
+#ifdef MYSQL_COMPRESSION
 		compression = ha_alter_info->create_info->compress.str;
 
 		if (Compression::validate(compression) != DB_SUCCESS) {
 
 			compression = NULL;
 		}
-		*/
+#endif /* MYSQL_COMPRESSION */
 
 		error = row_create_table_for_mysql(
 			ctx->new_table, compression, ctx->trx, false, mode, key_id);
@@ -6181,10 +6185,12 @@ ha_innobase::prepare_inplace_alter_table(
 	}
 
 	n_rename_index = 0;
-	// JAN: TODO: MySQL 5.7
-	//n_rename_index = ha_alter_info->index_rename_count;
 	rename_index = NULL;
 
+#ifdef MYSQL_RENAME_INDEX
+
+	n_rename_index = ha_alter_info->index_rename_count;
+
 	/* Create a list of dict_index_t objects that are to be renamed,
 	also checking for requests to rename nonexistent indexes. If
 	the table is going to be rebuilt (new_clustered == true in
@@ -6200,13 +6206,12 @@ ha_innobase::prepare_inplace_alter_table(
 			dict_index_t*	index = NULL;
 			const char*	old_name = NULL;
 
-			/* JAN: TODO: MySQL 5.7
 			const char*	old_name = ha_alter_info
 				->index_rename_buffer[i].old_key->name;
 
 			index = dict_table_get_index_on_name(indexed_table,
 							     old_name);
-			*/
+
 			if (index == NULL) {
 				my_error(ER_KEY_DOES_NOT_EXITS, MYF(0),
 					 old_name,
@@ -6217,6 +6222,7 @@ ha_innobase::prepare_inplace_alter_table(
 			rename_index[i] = index;
 		}
 	}
+#endif /* MYSQL_RENAME_INDEX */
 
 	n_add_fk = 0;
 
@@ -6298,7 +6304,7 @@ ha_innobase::prepare_inplace_alter_table(
 
 		}
 
-		/* JAN: TODO: MySQL 5.7
+#ifdef MYSQL_VIRTUAL_COLUMNS
 		if ((ha_alter_info->handler_flags
 		     & Alter_inplace_info::DROP_VIRTUAL_COLUMN)
 		    && prepare_inplace_drop_virtual(
@@ -6312,7 +6318,7 @@ ha_innobase::prepare_inplace_alter_table(
 			    ha_alter_info, altered_table, table)) {
 			DBUG_RETURN(true);
 		}
-		*/
+#endif /* MYSQL_VIRTUAL_COLUMNS */
 
 		DBUG_RETURN(false);
 	}
@@ -6597,6 +6603,7 @@ ha_innobase::inplace_alter_table(
 		&& alter_templ_needs_rebuild(
 		   altered_table, ha_alter_info, ctx->new_table));
 
+#ifdef MYSQL_VIRTUAL_COLUMNS
 	if ((ctx->new_table->n_v_cols > 0) && rebuild_templ) {
 		/* Save the templ if isn't NULL so as to restore the
 		original state in case of alter operation failures. */
@@ -6640,6 +6647,7 @@ ha_innobase::inplace_alter_table(
 	if (!ctx->need_rebuild() && ctx->num_to_drop_vcol > 0) {
 		eval_table = table;
 	}
+#endif /* MYSQL_VIRTUAL_COLUMNS */
 
 	/* Read the clustered index of the table and build
 	indexes based on this information using temporary
@@ -8197,13 +8205,15 @@ commit_try_norebuild(
 		DBUG_RETURN(true);
 	}
 
-	/* JAN: TODO: MySQL 5.7
+#ifdef MYSQL_RENAME_INDEX
 	if ((ha_alter_info->handler_flags
 	     & Alter_inplace_info::RENAME_INDEX)
 	    && rename_indexes_in_data_dictionary(ctx, ha_alter_info, trx)) {
 		DBUG_RETURN(true);
 	}
+#endif /* MYSQL_RENAME_INDEX */
 
+#ifdef MYSQL_VIRTUAL_COLUMNS
 	if ((ha_alter_info->handler_flags
 	     & Alter_inplace_info::DROP_VIRTUAL_COLUMN)
 	    && innobase_drop_virtual_try(
@@ -8219,7 +8229,7 @@ commit_try_norebuild(
 		    ctx->old_table, trx)) {
 		DBUG_RETURN(true);
 	}
-	*/
+#endif /* MYSQL_VIRTUAL_COLUMNS */
 
 	DBUG_RETURN(false);
 }
@@ -8404,7 +8414,7 @@ alter_stats_norebuild(
 		}
 	}
 
-	/* JAN: TODO: MySQL 5.7
+#ifdef MYSQL_RENAME_INDEX
 	for (i = 0; i < ha_alter_info->index_rename_count; i++) {
 		KEY_PAIR*	pair = &ha_alter_info->index_rename_buffer[i];
 		dberr_t		err;
@@ -8427,7 +8437,7 @@ alter_stats_norebuild(
 				ut_strerr(err));
 		}
 	}
-	*/
+#endif /* MYSQL_RENAME_INDEX */
 
 	for (i = 0; i < ctx->num_to_add_index; i++) {
 		dict_index_t*	index = ctx->add_index[i];
diff --git a/storage/innobase/sync/sync0debug.cc b/storage/innobase/sync/sync0debug.cc
index dbdb4c0..accc931 100644
--- a/storage/innobase/sync/sync0debug.cc
+++ b/storage/innobase/sync/sync0debug.cc
@@ -1569,11 +1569,6 @@ sync_latch_meta_init()
 
 		const latch_meta_t*	meta = *it;
 
-		if (meta) {
-			ib::info() << "LatchMetaData id " << meta->get_id()
-				   << " string " << meta->get_name()
-				   << " level " << meta->get_level();
-		}
 
 		/* Skip blank entries */
 		if (meta == NULL || meta->get_id() == LATCH_ID_NONE) {


More information about the commits mailing list