mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for Bug#2151:
"USE db" affected the character set of further CREATE DATABASEs, which should have not happened. mysys/charset2html.c: It's earier to operate hex values when editing charset configuration file BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
This commit is contained in:
20
mysql-test/r/ctype_create.result
Normal file
20
mysql-test/r/ctype_create.result
Normal file
@ -0,0 +1,20 @@
|
||||
SET @@character_set_server=latin5;
|
||||
CREATE DATABASE db1 DEFAULT CHARACTER SET cp1251;
|
||||
USE db1;
|
||||
CREATE DATABASE db2;
|
||||
SHOW CREATE DATABASE db1;
|
||||
Database Create Database
|
||||
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET cp1251 */
|
||||
SHOW CREATE DATABASE db2;
|
||||
Database Create Database
|
||||
db2 CREATE DATABASE `db2` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||||
DROP DATABASE db2;
|
||||
USE db1;
|
||||
CREATE TABLE t1 (a char(10));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(10) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=cp1251
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE db1;
|
39
mysql-test/t/ctype_create.test
Normal file
39
mysql-test/t/ctype_create.test
Normal file
@ -0,0 +1,39 @@
|
||||
#
|
||||
# Test for various CREATE statements and character sets
|
||||
#
|
||||
|
||||
|
||||
# Check that the database charset is taken from server charset by default:
|
||||
# - Change local character_set_server variable to latin5.
|
||||
# - Create database with and without CHARACTER SET specification.
|
||||
# At the same time check fix for the
|
||||
# Bug#2151:
|
||||
# "USE db" with non-default character set should never affect
|
||||
# further CREATE DATABASEs.
|
||||
|
||||
|
||||
SET @@character_set_server=latin5;
|
||||
CREATE DATABASE db1 DEFAULT CHARACTER SET cp1251;
|
||||
USE db1;
|
||||
CREATE DATABASE db2;
|
||||
|
||||
#
|
||||
# This should be cp1251
|
||||
#
|
||||
SHOW CREATE DATABASE db1;
|
||||
|
||||
#
|
||||
# This should take the default latin5 value from server level.
|
||||
#
|
||||
SHOW CREATE DATABASE db2;
|
||||
DROP DATABASE db2;
|
||||
|
||||
#
|
||||
# Check that table value uses database level by default
|
||||
#
|
||||
USE db1;
|
||||
CREATE TABLE t1 (a char(10));
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE db1;
|
Reference in New Issue
Block a user