Commit graph

33 commits

Author SHA1 Message Date
Michael Widenius
a7abddeffa Create 'main' test directory and move 't' and 'r' there 2018-03-29 13:59:44 +03:00
Sergei Golubchik
4a5d25c338 Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
Sergei Golubchik
7f2fd34500 MDEV-11231 Server crashes in check_duplicate_key on CREATE TABLE ... SELECT
be consistent and don't include the table name into the error message,
no other CREATE TABLE error does it.

(the crash happened, because thd->lex->query_tables was NULL)
2016-12-04 01:59:35 +01:00
Monty
af7490f95d Remove end . from error messages to get them consistent
Fixed a few failing tests
2016-10-05 01:11:08 +03:00
Michael Widenius
b18a1b0e6c MDEV-5850: MySQL Bug#21317: SHOW CREATE DATABASE does not obey to lower_case_table_names
Bug #3329 Incomplete lower_case_table_names=2 implementation

The problem was that check_db_name() converted database names to lower case also in case of lower_case_table_names=2.

Fixed by removing the conversion in check_db_name for lower_case_table_names = 2 and instead converting db name to
lower case at same places as table names are converted.

Fixed bug that SHOW CREATE DATABASE FOO showed information for database 'foo'.

I also removed some checks of lower_case_table_names when it was enough to use table_alias_charset.


mysql-test/mysql-test-run.pl:
  Added --use-copy argument to force mysql-test-run to copy files instead of doing symlinks. This is needed when you run
  with test directory on another file system
mysql-test/r/lowercase_table.result:
  Updated results
mysql-test/r/lowercase_table2.result:
  Updated results
mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result:
  Updated results
mysql-test/suite/parts/r/partition_mgm_lc2_memory.result:
  Updated results
mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result:
  Updated results
mysql-test/t/lowercase_table.test:
  Added tests with mixed case databases
mysql-test/t/lowercase_table2.test:
  Added tests with mixed case databases
sql/log.cc:
  Don't check lower_case_table_names when we can use table_alias_charset
sql/sql_base.cc:
  Don't check lower_case_table_names when we can use table_alias_charset
sql/sql_db.cc:
  Use cmp_db_names() for checking if current database changed.
  mysql_rm_db() now converts db to lower case if lower_case_table_names was used.
  Changed database options cache to use table_alias_charset. This fixed a bug where SHOW CREATE DATABASE showed wrong information.
sql/sql_parse.cc:
  Change also db name to lower case when file names are changed.
  Don't need to story copy of database name anymore when lower_case_table_names == 2 as check_db_name() don't convert in this case.
  Updated arguments to mysqld_show_create_db().
  When adding table to TABLE_LIST also convert db name to lower case if needed (same way as we do with table names).
sql/sql_show.cc:
  mysqld_show_create_db() now also takes original name as argument for output to user.
sql/sql_show.h:
  Updated prototype for mysqld_show_create_db()
sql/sql_table.cc:
  In mysql_rename_table(), do same conversions to database name as we do for the file name
2014-03-23 15:43:57 +02:00
Michael Widenius
313f18be5a Fixed errors and warnings found by buildbot
mysql-test/r/lowercase_table2.result:
  Updated result
  (The change happend because we don't try to open the table anymore as part of create table)
mysql-test/suite/rpl/r/create_or_replace_mix.result:
  Fixed result file
mysql-test/suite/rpl/r/create_or_replace_row.result:
  Fixed result file
mysql-test/suite/rpl/r/create_or_replace_statement.result:
  Fixed result file
mysql-test/suite/rpl/t/create_or_replace.inc:
  Drop open temporary table
mysys/my_delete.c:
  Added missing newline
plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/user_lock.result:
  Fixed result
  (Lock names was before off by one. Was corrected by my previous patch)
sql/sql_select.cc:
  Fixed compiler warnings by adding missing casts
storage/connect/ha_connect.cc:
  Fixed compiler warnings
storage/innobase/os/os0file.cc:
  Fixed compiler warnings
storage/xtradb/btr/btr0btr.cc:
  Fixed compiler warnings
storage/xtradb/handler/ha_innodb.cc:
  removed not used function
strings/ctype-uca.c:
  Fixed compiler warnings
support-files/compiler_warnings.supp:
  Added suppression for warnings that are wrong or are not serious andthat we don't plan to fix.
2014-02-06 16:14:09 +02:00
unknown
ab81cd4aba The test result fixed (duplicate undex check). 2013-09-30 08:19:58 +03:00
Sergei Golubchik
3a8e1a2205 mysql-test fixes 2013-04-09 16:19:22 +02:00
Michael Widenius
5a86a61219 Fixed wrong error codes from InnoDB/XtraDB that caused %M to give system dependent error messages (for unknown error code)
- InnoDB now returns handler specific HA_WRONG_CREATE_OPTION instead of MySQL specific ER_ILLEGAL_HA_CREATE_OPTION
- This changes the user level error message from "Unknown error" to "Wrong create options"


mysql-test/r/lowercase_table2.result:
  Updated result file
mysql-test/r/partition_innodb_plugin.result:
  Updated to new error message
mysql-test/r/partition_open_files_limit.result:
  Updated result file
mysql-test/r/row-checksum-old.result:
  Updated to new error message
mysql-test/r/row-checksum.result:
  Updated to new error message
mysql-test/r/symlink.result:
  Updated result file
mysql-test/suite/innodb/r/innodb-create-options.result:
  Updated to new error message
mysql-test/suite/innodb/r/innodb-zip.result:
  Updated to new error message
mysql-test/suite/innodb/r/innodb.result:
  Updated to new error message
storage/innobase/handler/ha_innodb.cc:
  Return HA_WRONG_CREATE_OPTION instead of ER_ILLEGAL_HA_CREATE_OPTION
  This gives more clear and OS indepedent error messages
storage/xtradb/handler/ha_innodb.cc:
  Return HA_WRONG_CREATE_OPTION instead of ER_ILLEGAL_HA_CREATE_OPTION
  This gives more clear and OS indepedent error messages
2012-07-06 19:10:18 +03:00
Georgi Kodinov
c04a6bcbde merge mysql-5.1->mysql-5.5 2011-04-06 18:11:43 +03:00
Georgi Kodinov
5321b3a57a Bug #11758687: 50924: object names not resolved correctly
on lctn2 systems

There was a local variable in get_all_tables() to store the 
"original" value of the database name as it can get lowercased
depending on the lower_case_table_name value.
get_all_tables() iterates over database names and for each 
database iterates over the tables in it.
The "original" db name was assigned in the table names loop.
Thus the first table is ok, but the second and subsequent tables
get the lowercased name from processing the first table.
Fixed by moving the assignment of the original database name
from the inner (table name) to the outer (database name) loop.
Test suite added.
2011-04-04 16:04:15 +03:00
Georgi Kodinov
bbe3e4bdb6 merge 2010-07-21 18:20:29 +03:00
Georgi Kodinov
e24abd9091 Addendum #4 to bug #53095
SHOW DATABASES LIKE ... was not converting to lowercase on comparison as the
documentation is suggesting. 
Fixed it to behave similarly to SHOW TABLES LIKE ... and updated the failing
on MacOSX lowercase_table2 test case.
2010-07-21 18:05:57 +03:00
Magne Mahre
e564e35d06 Bug#54846 main.lowercase_table2 on Mac OSX
This bug is a consequence of WL#5349, as the
default storage engine was changed.

The fix was to explicitly add an ENGINE
clause to a CREATE TABLE statement, to
ensure that we test case preservement on
MyISAM.
2010-06-28 11:23:50 +02:00
Jon Olav Hauglid
84e35f5e1c Backport of revno: 2617.68.3
Followup to Bug#42546 Backup: RESTORE fails, thinking it finds an existing table

This patch updates lowercase_table2.test with the changed error message
CREATE TABLE produces if it fails because it finds an matching TABLE_SHARE 
in the TDC even if the .FRM/.MYD has been removed from disk.

With the changes introduced in Bug#42546, CREATE TABLE uses open_tables()
which will find the TDC entry and fail in open_table_from_share() with
ER_FILE_NOT_FOUND. Before, CREATE TABLE would not use open_tables() and
fail with ER_TABLE_EXISTS_ERROR upon finding the TDC entry in
mysql_create_table_no_lock().
2009-12-10 12:46:16 +01:00
Dmitry Lenev
b20a4f01c3 Fix for bug #44738 "fill_schema_table_from_frm() opens tables without
lowercasing table name".

In lower_case_table_names > 0 mode some queries to I_S left entries
with incorrect key in table definition cache. This wasted memory and
caused some of the further queries to I_S to produce stale results
in cases when table definition was changed by a DDL statement.
Also in combination with similar problem in CREATE TABLE (which also
has peeked into table definition cache using non-normalized key) this
issue led to to spurious ER_TABLE_EXISTS_ERROR errors when one tried
to create a table with the same name as a previously existing but
dropped table (assuming that table name contained characters in upper
case).

This problem occured due to fact that fill_schema_table_from_frm()
was not properly normalizing (lowercasing) database and table names
which it used for lookups in table definition cache.

This fix adds proper normalization to this function. It also solves
similar problem in CREATE TABLE's code by ensuring that it uses
properly normalized version of table name when it peeks into table
definition cache instead of non-normalized one.

mysql-test/r/lowercase_table2.result:
  Added test for #44738 "fill_schema_table_from_frm() opens tables
  without lowercasing table name".
mysql-test/t/lowercase_table2.test:
  Added test for #44738 "fill_schema_table_from_frm() opens tables
  without lowercasing table name".
sql/sql_show.cc:
  Normalize database and table name before using them for looking
  up entry in table definition cache.
sql/sql_table.cc:
  Ensure that CREATE TABLE uses properly normalized version of table
  name when it peeks into table definition cache.
2009-10-09 13:00:18 +04:00
unknown
e30a2aea74 post-merge fix
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/lowercase_table2.result:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/sql_show.cc:
  Auto merged
mysql-test/t/information_schema.test:
  manual merge
2006-06-14 10:54:56 +05:00
unknown
6c431a5ecd Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
fix: return db name for I_S.TABLES(and others) in original letter case.
if mysql starts with lower_case_table_names=1 | 2 then original db name is converted
to lower case(for I_S tables). It happens when we perform add_table_to_list. 
to avoid this we make a copy of original db name and use the copy hereafter.


mysql-test/r/lowercase_table2.result:
  Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
  test case
mysql-test/t/lowercase_table2.test:
  Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
  test case
2006-06-06 11:25:31 +05:00
unknown
7388e0bda1 Update test result
mysql-test/r/lowercase_table2.result:
  Update test result for "lowercase_tabe2" after push of fix for bug10460
2006-03-06 20:06:56 +01:00
unknown
d211910984 lowercase_table2.test, lowercase_table2.result:
Use IF EXISTS in initiation section


mysql-test/r/lowercase_table2.result:
  Use IF EXISTS in initiation section
mysql-test/t/lowercase_table2.test:
  Use IF EXISTS in initiation section
2005-07-05 17:27:37 +02:00
unknown
280b1c33e3 Cleanup during review of new code
Fixed wrong allocation that could cause buffer overrun when using join cache


myisam/mi_open.c:
  Fixed indentation
mysql-test/r/lowercase_table2.result:
  Drop tables and databases used in the test
mysql-test/t/lowercase_table2.test:
  Drop tables and databases used in the test
mysys/my_fopen.c:
  Cleanup of comments and parameter names
  Simple optimization
  Removed compiler warnings
sql/field.cc:
  Fixed wrong allocation that could cause buffer overrun
sql/mysqld.cc:
  Removed not needed code
sql/set_var.cc:
  Simply code
sql/sql_select.cc:
  Use int2store/int2korr to store length of cached VARCHAR fields
  (Not dependent on type and faster code as we avoid one possible call)
2005-06-21 18:18:58 +03:00
unknown
c23ef5e1f3 Fix problem with handling of lower_case_table_name == 2 when
the case in the FROM and WHERE clauses didn't agree. (Bug #9500)


mysql-test/r/lowercase_table2.result:
  Update results
mysql-test/t/lowercase_table2.test:
  Fix 'DROP TABLE' to not drop tables with the same name.
sql/mysqld.cc:
  Move initialization of table_alias_charset to after we
  have decided what lower_case_table_names should be.
2005-06-08 14:35:16 -07:00
unknown
8ac75806e2 Fix table renaming to not lowercase table names for all storage
engines when lower_case_table_names == 2, as it did previously
for InnoDB and MEMORY. (Bug #9660)


mysql-test/r/lowercase_table2.result:
  Fix results
sql/sql_table.cc:
  Add build_table_path() function to construct the path to
  a table, and use it to replace nearly all of the places
  where this was done with similar code.
  
  Fix mysql_rename_table() to not lowercase the .frm file
  name when lower_case_table_names == 2 and the storage
  engine does not set the HA_FILE_BASED flag (such as InnoDB).
2005-05-25 20:26:40 -07:00
unknown
1de817e9c4 Fix removal of tables from cache when the database they are contained
within is dropped and lower_case_table_names is set. (Bug #8355)


mysql-test/t/lowercase_table2.test:
  Add new regression test
mysql-test/r/lowercase_table2.result:
  Add results for regression test
sql/mysql_priv.h:
  Change remove_db_from_cache() to use char* instead of my_string
sql/sql_base.cc:
  Lowercase database name in remove_db_from_cache so
  that all of the correct entries are removed.
2005-02-08 15:14:14 -08:00
unknown
f332605b1f tT replaced with T1 to be more predictable. 2005-01-25 16:42:16 +04:00
unknown
b7b042689c Test case (bug #7261: Alter table loses temp table with lower_case_table_names=2). 2005-01-25 10:58:30 +04:00
unknown
404730a123 after merge fix
mysql-test/r/lowercase_table2.result:
  results updated
2004-06-27 13:16:19 +02:00
unknown
c6e23c8549 Merge with 4.0 to get the latest bug patches to 4.1
BitKeeper/etc/ignore:
  added sql/mysql_tzinfo_to_sql
BitKeeper/etc/logging_ok:
  auto-union
acinclude.m4:
  Auto merged
extra/perror.c:
  Auto merged
include/mysql.h:
  Auto merged
innobase/include/mach0data.ic:
  Auto merged
innobase/include/mtr0log.h:
  Auto merged
innobase/include/mtr0log.ic:
  Auto merged
innobase/mem/mem0dbg.c:
  Auto merged
innobase/pars/lexyy.c:
  Auto merged
BitKeeper/deleted/.del-4.0.XX-gpl.ipr~f5909a9e9bd8094:
  Auto merged
BitKeeper/deleted/.del-Clients and Tools.fgl~bf0f776883577f02:
  Auto merged
BitKeeper/deleted/.del-Development.fgl~6392ce285e73f5fc:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/r/innodb_cache.result:
  Auto merged
mysql-test/r/lowercase_table2.result:
  Auto merged
mysql-test/t/innodb_cache.test:
  Auto merged
mysql-test/t/lowercase_table2.test:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/handler.cc:
  Auto merged
scripts/make_win_src_distribution.sh:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
libmysql/libmysql.c:
  Merge with 4.0
mysql-test/r/bdb.result:
  Merge with 4.0
mysql-test/r/range.result:
  Merge with 4.0
mysql-test/t/bdb.test:
  Merge with 4.0
mysys/hash.c:
  Merge with 4.0
scripts/mysql_install_db.sh:
  Merge with 4.0
sql/field.cc:
  Merge with 4.0
sql/field.h:
  Merge with 4.0
sql/mysql_priv.h:
  Merge with 4.0
sql/sql_handler.cc:
  Merge with 4.0
sql/sql_select.cc:
  Merge with 4.0
sql/sql_table.cc:
  Merge with 4.0
2004-06-25 20:13:05 +03:00
unknown
3db93f8086 lower_case_table_names=2 (Keep case for table names) was not honored
with ALTER TABLE and CREATE/DROP INDEX. (Bug #3109)
Make net_buffer_length visible for mysql clients (Bug #4206)


include/mysql.h:
  Make net_buffer_length visible for mysql clients
libmysql/libmysql.c:
  Make net_buffer_length visible for mysql clients
mysql-test/mysql-test-run.sh:
  Don't give warning for some common 'safe' warnings
mysql-test/r/lowercase_table2.result:
  Test name conversion with ALTER TABLE / CREATE INDEX (Bug #3109)
mysql-test/t/lowercase_table2.test:
  Test name conversion with ALTER TABLE / CREATE INDEX (Bug #3109)
scripts/mysql_install_db.sh:
  Removed not used variable
sql/sql_table.cc:
  lower_case_table_names=2 (Keep case for table names) was not honored
  with ALTER TABLE and CREATE/DROP INDEX. (Bug #3109)
2004-06-23 16:44:34 +03:00
unknown
1bbca272a9 Fixed problems noticed with last build
mysql-test/r/lowercase_table2.result:
  Fixed typo
mysql-test/r/repair.result:
  Portability fix (For OpenBSD)
mysql-test/t/repair.test:
  Portability fix (For OpenBSD)
mysys/my_thr_init.c:
  Fixed crasch with some tests on OpenBSD.
sql/field.cc:
  Don't truncate big values (Caused a core dump on Linux-Alpha for big values)
sql/log.cc:
  More DBUG
2004-04-09 07:12:41 +03:00
unknown
6a868cca91 Fixed warnings from valgrind (not a bug)
Don't add -debug to server version if MYSQL_SERVER_PREFIX is used
Indentation cleanups


myisam/mi_write.c:
  Indentation cleanup
mysql-test/r/lowercase_table2.result:
  Fixed test results
sql/filesort.cc:
  Fixed warnings from valgrind (not a bug)
sql/ha_myisam.cc:
  Indentation cleanup
sql/mysqld.cc:
  Don't add -debug to server if MYSQL_SERVER_PREFIX is used
sql/sql_base.cc:
  Indentation cleanup
sql/sql_show.cc:
  Fixed typo in comment
sql/sql_table.cc:
  Indentation cleanup
2004-04-06 12:13:43 +03:00
unknown
221397cdbe Fixed memory leak in DROP DATABASE when using RAID tables (Bug #2882)
BUILD/compile-pentium-debug-max:
  Added --with-raid
configure.in:
  Removed -DFN_NO_CASE_SENCE for Mac OS X as this is not always true
mysql-test/install_test_db.sh:
  Added --skip-warnings
mysql-test/mysql-test-run.sh:
  Fixes to get --gdb and --ddd to work
mysql-test/r/lowercase_table2.result:
  Test for lower_case_table_names=2 and temporary tables
mysql-test/r/lowercase_table3.result:
  Fixed error message
mysql-test/r/multi_update.result:
  Test of behaviour of multi-table-delete and alias
mysql-test/t/lowercase_table2.test:
  Test for lower_case_table_names=2 and temporary tables
mysql-test/t/lowercase_table3.test:
  Fixed error
mysql-test/t/multi_update.test:
  Test of behaviour of multi-table-delete and alias (Bug #2940)
mysys/mf_iocache.c:
  Renamed _flush_io_cache to my_b_flush_io_cache
sql/ha_myisam.cc:
  Added comment
sql/lock.cc:
  Extra debugging
sql/log.cc:
  New parameter to flush_relay_log_info
sql/log_event.cc:
  New parameter to flush_relay_log_info
sql/mf_iocache.cc:
  Removed not used header files
sql/mysqld.cc:
  More debugging info
  Less warnings when run with --skip-warnings
sql/opt_range.cc:
  More debug information
sql/repl_failsafe.cc:
  New parameter to flush_relay_log_info
sql/slave.cc:
  First start SQL thread, then start IO thread. This fixed a raze condition in SLAVE START (Bug #2921)
  Ensure that we have a lock on the IO thread before flushing a relay log file that. The original code could core dump when a relay log rotated.
sql/slave.h:
  New parameter to flush_relay_log_info
sql/sql_base.cc:
  Added warning
sql/sql_handler.cc:
  Indentation fix
sql/sql_repl.cc:
  New parameter to flush_relay_log_info
sql/sql_select.cc:
  Fixed problem with deleting temporary tables when using lower_case_table_names=2. (Bug #2858)
sql/sql_table.cc:
  Fixed comment
sql/sql_yacc.yy:
  Removed compiler warning
include/my_sys.h:
  Fixed usage of unpack_filename
mysys/mf_pack.c:
  Changed unpack_filename() to return length of result string.
mysys/test_fn.c:
  Fixed usage of unpack_filename
sql/sql_db.cc:
  Fixed memory leak with raid tables
sql/table.cc:
  Fixed usage of unpack_filename
2004-03-10 13:46:11 +02:00
unknown
376fb08072 Some small portability fixes.
Added support for lower_case_table_names=2, which is to be used on case insensitive file systems.
This tells MySQL to preserve the used case of filenames and database names to make it esier to move files between cases sensitive can case insensitive file systems (like Windows and Linux)


client/mysqltest.c:
  Indentation cleanup
include/myisam.h:
  Made some pointers 'const'
mysql-test/mysql-test-run.sh:
  Portability fix for OSX
sql/filesort.cc:
  Safety fix (not needed for current code but needed for 5.0)
sql/ha_berkeley.cc:
  More debugging
  Changed 'create' to return error number
sql/ha_berkeley.h:
  Added HA_FILE_BASED
sql/ha_innodb.cc:
  Added missing DBUG_RETURN
sql/ha_isam.cc:
  Changed create to return error number
sql/ha_isam.h:
  Added HA_FILE_BASED
sql/ha_isammrg.h:
  Added HA_FILE_BASED
sql/ha_myisam.cc:
  Changed create to return error number
sql/ha_myisam.h:
  Added HA_FILE_BASED
sql/ha_myisammrg.cc:
  Changed create to return error number
sql/ha_myisammrg.h:
  Added HA_FILE_BASED
sql/handler.cc:
  Ensure that table engines gets table names in lower case even if we are using lower_case_table_names
  Removed test for DB_TYPE_INNODB by ensuring that create method returns error number.
sql/handler.h:
  Added HA_FILE_BASED
  Made some struct entries 'const'
  Added 'alias' for create to be able to create tables in mixed case on case insensitive file systems
sql/mysql_priv.h:
  Support for lower_case_table_names=2
sql/mysqld.cc:
  Support for lower_case_table_names=2
  Moved test of case insenstive file system after all mutex are created
sql/set_var.cc:
  Support for lower_case_table_names=2
sql/sql_class.h:
  Indentation change
sql/sql_db.cc:
  Support for lower_case_table_names=2
sql/sql_insert.cc:
  Indentation change
sql/sql_parse.cc:
  Support for lower_case_table_names=2
sql/sql_rename.cc:
  Support for lower_case_table_names=2
  Added missing 'unpack_filename' to RENAME which may fix a bug in RENAME TABLE on windows
sql/sql_show.cc:
  If lower_case_table_name=2 is given, show original case in SHOW CREATE TABLE
sql/sql_table.cc:
  Support for lower_case_table_names=2 for DROP TABLE, RENAME TABLE, ALTER TABLE and CREATE TABLE
2003-12-30 13:14:21 +02:00