[Commits] da479cf: Fix Windows compiler errors.

Jan Lindström jan.lindstrom at mariadb.com
Wed Sep 7 11:32:33 EEST 2016


revision-id: da479cf7c1c4fd27335115c8a094a37ae781ec57 (mariadb-10.2.1-6-gda479cf)
parent(s): bc4abb5e08b87cdcc3b41a1f98a4c248147dfd73
committer: Jan Lindström
timestamp: 2016-09-07 11:32:22 +0300
message:

Fix Windows compiler errors.

---
 include/my_base.h                     |  3 +-
 include/my_handler_errors.h           |  3 +-
 sql/handler.cc                        |  1 +
 storage/innobase/fil/fil0fil.cc       |  3 +-
 storage/innobase/handler/ha_innodb.cc | 74 ++++++++++++-----------------------
 storage/innobase/include/row0ftsort.h |  2 +-
 6 files changed, 32 insertions(+), 54 deletions(-)

diff --git a/include/my_base.h b/include/my_base.h
index f73da78..af05336 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -509,7 +509,8 @@ enum ha_base_keytype {
 #define HA_ERR_WRONG_FILE_NAME         200  /* Invalid Filename */
 #define HA_ERR_NOT_ALLOWED_COMMAND     201  /* Operation is not allowed */
 #define HA_ERR_COMPUTE_FAILED          202  /* Compute generated column value failed */
-#define HA_ERR_LAST                    202  /* Copy of last error nr * */
+#define HA_ERR_INNODB_READ_ONLY        203  /* InnoDB is in read only mode */
+#define HA_ERR_LAST                    203  /* Copy of last error nr * */
 
 /* Number of different errors */
 #define HA_ERR_ERRORS            (HA_ERR_LAST - HA_ERR_FIRST + 1)
diff --git a/include/my_handler_errors.h b/include/my_handler_errors.h
index bc92779..3d05fb7 100644
--- a/include/my_handler_errors.h
+++ b/include/my_handler_errors.h
@@ -105,7 +105,8 @@ static const char *handler_error_messages[]=
   "Tablespace is not empty",
   "Incorrect File Name",
   "Table storage engine found required create option missing",
-  "Compute virtual column value failed"
+  "Compute virtual column value failed",
+  "InnoDB is in read only mode"
 };
 
 #endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */
diff --git a/sql/handler.cc b/sql/handler.cc
index 4a7f10f..875e3d5 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -380,6 +380,7 @@ int ha_init_errors(void)
   SETMSG(HA_ERR_WRONG_FILE_NAME,        ER_DEFAULT(ER_WRONG_FILE_NAME));
   SETMSG(HA_ERR_NOT_ALLOWED_COMMAND,    ER_DEFAULT(ER_NOT_ALLOWED_COMMAND));
   SETMSG(HA_ERR_COMPUTE_FAILED,         "Compute virtual column value failed");
+  SETMSG(HA_ERR_INNODB_READ_ONLY,       ER_DEFAULT(ER_INNODB_READ_ONLY));
 
   /* Register the error messages for use with my_error(). */
   return my_error_register(get_handler_errmsgs, HA_ERR_FIRST, HA_ERR_LAST);
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index b176bbf..3d34de6 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -5025,13 +5025,12 @@ fil_space_extend(
 
 		len = ((node->size + n_node_extend) * page_size) - node_start;
 		ut_ad(len > 0);
+		const char* name = node->name == NULL ? space->name : node->name;
 
 #if !defined(NO_FALLOCATE) && defined(UNIV_LINUX)
 		/* This is required by FusionIO HW/Firmware */
 		int	ret = posix_fallocate(node->handle, node_start, len);
 
-		const char* name = node->name == NULL ? space->name : node->name;
-
 		/* We already pass the valid offset and len in, if EINVAL
 		is returned, it could only mean that the file system doesn't
 		support fallocate(), currently one known case is
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 2fa98b3..e1e4262 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -2252,10 +2252,7 @@ convert_error_code_to_mysql(
 		return(HA_ERR_DECRYPTION_FAILED);
 
 	case DB_TABLESPACE_NOT_FOUND:
-		/* JAN: TODO: MySQL 5.7
 		return(HA_ERR_TABLESPACE_MISSING);
-		*/
-		return(HA_ERR_NO_SUCH_TABLE);
 
 	case DB_TOO_BIG_RECORD: {
 		/* If prefix is true then a 768-byte prefix is stored
@@ -2317,29 +2314,17 @@ convert_error_code_to_mysql(
 	case DB_TABLESPACE_EXISTS:
 		return(HA_ERR_TABLESPACE_EXISTS);
 	case DB_TABLESPACE_DELETED:
-		/* JAN: TODO: MySQL 5.7
 		return(HA_ERR_TABLESPACE_MISSING);
-		*/
-		return(HA_ERR_NO_SUCH_TABLE);
 	case DB_IDENTIFIER_TOO_LONG:
 		return(HA_ERR_INTERNAL_ERROR);
 	case DB_TABLE_CORRUPT:
-		/* JAN: TODO: MySQL 5.7
 		return(HA_ERR_TABLE_CORRUPT);
-		*/
-		return(HA_ERR_INTERNAL_ERROR);
 	case DB_FTS_TOO_MANY_WORDS_IN_PHRASE:
 		return(HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE);
 	case DB_WRONG_FILE_NAME:
-		/* JAN: TODO: MySQL 5.7
 		return(HA_ERR_WRONG_FILE_NAME);
-		*/
-		return(HA_ERR_INTERNAL_ERROR);
 	case DB_COMPUTE_VALUE_FAILED:
-		/* JAN: TODO: MySQL 5.7
 		return(HA_ERR_COMPUTE_FAILED);
-		*/
-		return(HA_ERR_INTERNAL_ERROR);
 	}
 }
 
@@ -4453,7 +4438,7 @@ innobase_init(
 
 			sql_print_error("InnoDB: wrong innodb_file_format.");
 
-		DBUG_RETURN(innobase_init_abort());
+			DBUG_RETURN(innobase_init_abort());
 		}
 	} else {
 		/* Set it to the default file format id. Though this
@@ -5097,7 +5082,7 @@ innobase_commit_ordered(
 	have an assert here.*/
 	ut_ad(!trx->has_search_latch);
 
-        if (!trx_is_registered_for_2pc(trx) && trx_is_started(trx)) {
+	if (!trx_is_registered_for_2pc(trx) && trx_is_started(trx)) {
 		/* We cannot throw error here; instead we will catch this error
 		again in innobase_commit() and report it from there. */
 		DBUG_VOID_RETURN;
@@ -5766,10 +5751,10 @@ Cancel any pending lock request associated with the current THD. */
 static
 void
 innobase_kill_query(
-/*======================*/
-        handlerton*	hton,	    /*!< in: innobase handlerton */
-	THD*	thd,	            /*!< in: MySQL thread being killed */
-        enum thd_kill_levels level) /*!< in: kill level */
+/*================*/
+	handlerton*	hton,		/*!< in: innobase handlerton */
+	THD*		thd,		/*!< in: MySQL thread being killed */
+	enum thd_kill_levels level)	/*!< in: kill level */
 {
 	trx_t*	trx;
 
@@ -5799,7 +5784,7 @@ innobase_kill_query(
 		bool trx_mutex_taken = false;
 		bool already_have_lock_mutex = false;
 		bool already_have_trx_mutex = false;
-		dberr_t err __attribute__((unused));
+		dberr_t err = DB_SUCCESS;
 
 		if (trx->lock.wait_lock) {
 			WSREP_DEBUG("Killing victim trx %p BF %d trx BF %d trx_id " IB_ID_FMT " ABORT %d thd %p"
@@ -7049,7 +7034,7 @@ ha_innobase::open(
 		is_part = NULL;
 	}
 
-#ifdef MYSQL_ENCRYPTION // JAN: TODO: Not needed
+#ifdef MYSQL_ENCRYPTION
 	/* For encrypted table, check if the encryption info in data
 	file can't be retrieved properly, mark it as corrupted. */
 	if (ib_table != NULL
@@ -7578,7 +7563,7 @@ get_field_offset(
 UNIV_INTERN
 int
 wsrep_innobase_mysql_sort(
-/*===============*/
+/*======================*/
 					/* out: str contains sort string */
 	int		mysql_type,	/* in: MySQL type */
 	uint		charset_number,	/* in: number of the charset */
@@ -8591,7 +8576,8 @@ ha_innobase::build_template(
 	/* Below we check column by column if we need to access
 	the clustered index. */
 
-        n_stored_fields= (ulint)table->s->stored_fields; /* number of stored columns */
+	/* number of stored columns */
+	n_stored_fields= (ulint)table->s->stored_fields;
 
 	if (!m_prebuilt->mysql_template) {
 		m_prebuilt->mysql_template = (mysql_row_templ_t*)
@@ -9397,8 +9383,7 @@ ha_innobase::write_row(
 	    wsrep_thd_exec_mode(m_user_thd) == LOCAL_STATE &&
 	    wsrep_on(m_user_thd)                           &&
 	    !wsrep_consistency_check(m_user_thd)           &&
-	    !wsrep_thd_ignore_table(m_user_thd))
-	{
+	    !wsrep_thd_ignore_table(m_user_thd)) {
 		if (wsrep_append_keys(m_user_thd, false, record, NULL))
 		{
 			DBUG_PRINT("wsrep", ("row key failed"));
@@ -9625,8 +9610,8 @@ calc_row_difference(
 					online_ord_part = true;
 #endif
 				} else {
-				       num_v++;
-				       continue;
+					num_v++;
+					continue;
 				}
 			}
 
@@ -10114,8 +10099,7 @@ ha_innobase::update_row(
 	if (error == DB_SUCCESS                            &&
 	    wsrep_thd_exec_mode(m_user_thd) == LOCAL_STATE &&
 	    wsrep_on(m_user_thd)                           &&
-	    !wsrep_thd_ignore_table(m_user_thd))
-        {
+	    !wsrep_thd_ignore_table(m_user_thd)) {
 		DBUG_PRINT("wsrep", ("update row key"));
 
 		if (wsrep_append_keys(m_user_thd, false, old_row, new_row)) {
@@ -10190,8 +10174,7 @@ ha_innobase::delete_row(
 	if (error == DB_SUCCESS                            &&
 	    wsrep_thd_exec_mode(m_user_thd) == LOCAL_STATE &&
 	    wsrep_on(m_user_thd)                           &&
-	    !wsrep_thd_ignore_table(m_user_thd))
-        {
+	    !wsrep_thd_ignore_table(m_user_thd)) {
 		if (wsrep_append_keys(m_user_thd, false, record, NULL)) {
 			DBUG_PRINT("wsrep", ("delete fail"));
 			error = (dberr_t) HA_ERR_INTERNAL_ERROR;
@@ -10953,9 +10936,7 @@ ha_innobase::general_fetch(
 			table->s->table_name.str);
 
 		table->status = STATUS_NOT_FOUND;
-		error = HA_ERR_NO_SUCH_TABLE;
-		// JAN: TODO: MySQL 5.7
-		//error = HA_ERR_TABLESPACE_MISSING;
+		error = HA_ERR_TABLESPACE_MISSING;
 		break;
 	default:
 		error = convert_error_code_to_mysql(
@@ -11354,7 +11335,7 @@ ha_innobase::ft_init_ext_with_hints(
 /*================================*/
 	uint			keynr,		/* in: key num */
 	String*			key,		/* in: key */
-        void*			hints)		/* in: hints  */
+	void*			hints)		/* in: hints  */
 {
 	/* TODO Implement function properly working with FT hint. */
 #ifdef MYSQL_FT_INIT_EXT
@@ -11551,9 +11532,7 @@ ha_innobase::ft_read(
 				table->s->table_name.str);
 
 			table->status = STATUS_NOT_FOUND;
-			error = HA_ERR_NO_SUCH_TABLE;
-			// JAN: TODO: MySQL 5.7
-			// error = HA_ERR_TABLESPACE_MISSING;
+			error = HA_ERR_TABLESPACE_MISSING;
 			break;
 		default:
 			error = convert_error_code_to_mysql(
@@ -13512,7 +13491,7 @@ create_table_info_t::check_table_options()
 		return "ENCRYPTED";
  	}
 
-        if (encrypt == FIL_SPACE_ENCRYPTION_OFF && srv_encrypt_tables == 2) {
+	if (encrypt == FIL_SPACE_ENCRYPTION_OFF && srv_encrypt_tables == 2) {
 		push_warning(
 			m_thd, Sql_condition::WARN_LEVEL_WARN,
 			HA_WRONG_CREATE_OPTION,
@@ -13594,7 +13573,7 @@ create_table_info_t::check_table_options()
 
 	/* If encryption is set up make sure that used key_id is found */
 	if (encrypt == FIL_SPACE_ENCRYPTION_ON ||
-            (encrypt == FIL_SPACE_ENCRYPTION_DEFAULT && srv_encrypt_tables)) {
+		(encrypt == FIL_SPACE_ENCRYPTION_DEFAULT && srv_encrypt_tables)) {
 		if (!encryption_key_id_exists((unsigned int)options->encryption_key_id)) {
 			push_warning_printf(
 				m_thd, Sql_condition::WARN_LEVEL_WARN,
@@ -14385,8 +14364,7 @@ create_table_info_t::prepare_create_table(
 	}
 
 	if (high_level_read_only && !is_intrinsic_temp_table()) {
-		DBUG_RETURN(HA_ERR_TABLE_READONLY);
-		// DBUG_RETURN(HA_ERR_INNODB_READ_ONLY);
+		DBUG_RETURN(HA_ERR_INNODB_READ_ONLY);
 	}
 
 	DBUG_RETURN(parse_table_name(name));
@@ -15152,7 +15130,7 @@ ha_innobase::delete_table(
 			whether there exists table name in
 			system table whose name is
 			not being normalized to lower case */
-			normalize_table_name_low(
+			normalize_table_name_c_low(
 				par_case_name, name, FALSE);
 #endif
 			err = row_drop_table_for_mysql(
@@ -15269,8 +15247,7 @@ validate_create_tablespace_info(
 	ut_a(alter_info->data_file_name);
 
 	if (high_level_read_only) {
-		return (HA_ERR_TABLE_READONLY);
-		// return(HA_ERR_INNODB_READ_ONLY);
+		return(HA_ERR_INNODB_READ_ONLY);
 	}
 
 	/* From this point forward, push a warning for each problem found
@@ -15515,8 +15492,7 @@ innobase_drop_tablespace(
 	DBUG_ASSERT(hton == innodb_hton_ptr);
 
 	if (srv_read_only_mode) {
-		DBUG_RETURN(HA_ERR_TABLE_READONLY);
-		// DBUG_RETURN(HA_ERR_INNODB_READ_ONLY);
+		DBUG_RETURN(HA_ERR_INNODB_READ_ONLY);
 	}
 
 	error = validate_tablespace_name(alter_info->tablespace_name, false);
diff --git a/storage/innobase/include/row0ftsort.h b/storage/innobase/include/row0ftsort.h
index c06327c..7e39fe3 100644
--- a/storage/innobase/include/row0ftsort.h
+++ b/storage/innobase/include/row0ftsort.h
@@ -94,7 +94,7 @@ struct fts_psort_t {
 	ulint			state;		/*!< parent thread state */
 	fts_doc_list_t		fts_doc_list;	/*!< doc list to process */
 	fts_psort_common_t*	psort_common;	/*!< ptr to all psort info */
-	os_thread_id_t		thread_hdl;	/*!< thread handler */
+	os_thread_t		thread_hdl;	/*!< thread handler */
 	dberr_t			error;		/*!< db error during psort */
 	ulint			memory_used;	/*!< memory used by fts_doc_list */
 	ib_mutex_t		mutex;		/*!< mutex for fts_doc_list */


More information about the commits mailing list