mariadb/mysql-test/suite/sys_vars/r/collation_database_func.result
Monty 9cba6c5aa3 Updated mtr files to support different compiled in options
This allows one to run the test suite even if any of the following
options are changed:
- character-set-server
- collation-server
- join-cache-level
- log-basename
- max-allowed-packet
- optimizer-switch
- query-cache-size and query-cache-type
- skip-name-resolve
- table-definition-cache
- table-open-cache
- Some innodb options
etc

Changes:
- Don't print out the value of system variables as one can't depend on
  them to being constants.
- Don't set global variables to 'default' as the default may not
  be the same as the test was started with if there was an additional
  option file. Instead save original value and reset it at end of test.
- Test that depends on the latin1 character set should include
  default_charset.inc or set the character set to latin1
- Test that depends on the original optimizer switch, should include
  default_optimizer_switch.inc
- Test that depends on the value of a specific system variable should
  set it in the test (like optimizer_use_condition_selectivity)
- Split subselect3.test into subselect3.test and subselect3.inc to
  make it easier to set and reset system variables.
- Added .opt files for test that required specfic options that could
  be changed by external configuration files.
- Fixed result files in rockdsb & tokudb that had not been updated for
  a while.
2019-09-01 19:17:35 +03:00

107 lines
3.6 KiB
Text
Raw Blame History

'#--------------------FN_DYNVARS_011_01-------------------------#'
SET @global_collation_database = @@global.collation_database;
SET @session_collation_database = @@session.collation_database;
SET @session_collation_server = @@session.collation_server;
SET @@global.collation_database = latin1_danish_ci;
connect con1,localhost,root,,,,;
connection con1;
SELECT @@global.collation_database;
@@global.collation_database
latin1_danish_ci
SELECT @@session.collation_database;
@@session.collation_database
latin1_swedish_ci
disconnect con1;
'#--------------------FN_DYNVARS_011_02-------------------------#'
connection default;
DROP TABLE IF EXISTS t1,t2;
'--check if setting collation_database update character_set_database--'
SET @@session.collation_database = utf8_spanish_ci;
SELECT @@collation_database, @@character_set_database;
@@collation_database @@character_set_database
utf8_spanish_ci utf8
'--check if collation_database effects database/tables charset/collation'
SET @@session.collation_server = utf8_roman_ci;
SET @@session.collation_database = latin2_croatian_ci;
CREATE DATABASE db1;
USE db1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_roman_ci */
CREATE TABLE t1(a CHAR(20));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(20) COLLATE utf8_roman_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_roman_ci
'---check if updating collation_database effects new table/column---'
SET @@session.collation_database = latin7_general_cs;
CREATE TABLE t2(a CHAR(10));
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` char(10) COLLATE utf8_roman_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_roman_ci
DROP TABLE t1,t2;
'--check value of collation and character set when current db is dropped'
DROP DATABASE db1;
SELECT @@collation_database,@@collation_server,@@character_set_database,@@character_set_server;
@@collation_database @@collation_server @@character_set_database @@character_set_server
utf8_roman_ci utf8_roman_ci utf8 utf8
USE test;
SELECT @@collation_database,@@collation_server,@@character_set_database,@@character_set_server;
@@collation_database @@collation_server @@character_set_database @@character_set_server
latin1_swedish_ci utf8_roman_ci latin1 utf8
'fill table with some test data';
CREATE TABLE t1(a CHAR(20))CHARACTER SET=latin1;
INSERT INTO t1 VALUES('Muffler'),('M<>ller'),('MX Systems');
'---check if collation_database effects results sort order---'
SET @@session.collation_database = latin1_swedish_ci;
SELECT * FROM t1 ORDER BY a;
a
Muffler
MX Systems
M<EFBFBD>ller
SET @@session.collation_database = latin1_german1_ci;
SELECT * FROM t1 ORDER BY a;
a
Muffler
MX Systems
M<EFBFBD>ller
'explicit Collate clause should effects results sort order';
SELECT * FROM t1 ORDER BY a COLLATE latin1_swedish_ci;
a
Muffler
MX Systems
M<EFBFBD>ller
SELECT * FROM t1 ORDER BY a COLLATE latin1_german1_ci;
a
Muffler
M<EFBFBD>ller
MX Systems
'----check if indexing is effected by collation_database---'
SET @@session.collation_database = latin1_swedish_ci;
ALTER TABLE t1 ADD PRIMARY KEY (a);
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
SELECT * FROM t1 ORDER BY a;
a
Muffler
MX Systems
M<EFBFBD>ller
ALTER TABLE t1 DROP PRIMARY KEY;
SET @@session.collation_database = latin1_german1_ci;
ALTER TABLE t1 ADD PRIMARY KEY (a);
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
SELECT * FROM t1 ORDER BY a;
a
Muffler
MX Systems
M<EFBFBD>ller
DROP TABLE t1;
SET @@global.collation_database = @global_collation_database;
SET @@session.collation_database = @session_collation_database;
SET @@session.collation_server = @session_collation_server;