Commit d094dc35 authored by heikki@donna.mysql.fi's avatar heikki@donna.mysql.fi
Browse files

ha_innobase.cc:

  Make database and table names always lower case on Windows
parent af2e1348
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -551,7 +551,7 @@ innobase_init(void)

	if (!innobase_data_file_path)
	{
	  fprintf(stderr,
	  fprinf(stderr,
       "Cannot initialize InnoDB as 'innodb_data_file_path' is not set.\n"
       "If you do not want to use transactional InnoDB tables, add a line\n"
       "skip-innodb\n"
@@ -821,7 +821,8 @@ ha_innobase::bas_ext() const
/*********************************************************************
Normalizes a table name string. A normalized name consists of the
database name catenated to '/' and table name. An example:
test/mytable. */
test/mytable. On Windows normalization puts both the database name and the
table name always to lower case. */
static
void
normalize_table_name(
@@ -857,6 +858,17 @@ normalize_table_name(
	memcpy(norm_name, db_ptr, strlen(name) + 1 - (db_ptr - name));

	norm_name[name_ptr - db_ptr - 1] = '/';

#ifdef __WIN__
	/* Put to lower case */

	ptr = norm_name;

	while (*ptr != '\0') {
	        *ptr = tolower(*ptr);
	        ptr++;
	}
#endif
}

/*********************************************************************