1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge next-mr -> next-4284.

This commit is contained in:
Konstantin Osipov
2009-12-15 22:59:07 +03:00
69 changed files with 951 additions and 215 deletions

View File

@ -47,4 +47,14 @@ insert into t1 (a) values ('air'),
select * from t1 where a like 'we_%';
drop table t1;
#
# Bug#158 ENUM and SET types does not accept valid cp1251 character
#
CREATE TABLE t1 (
e1 enum('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),
e2 enum('<27><><EFBFBD><EFBFBD><EFBFBD>')
) ENGINE=MYISAM character set cp1251;
SHOW CREATE TABLE t1;
DROP TABLE t1;
# End of 4.1 tests

View File

@ -4,11 +4,30 @@
drop table if exists t1;
--enable_warnings
--echo In the following tests we change the order of letter "b"
--echo making it equal to letter "a", and check that it works
--echo with all Unicode character sets
set names utf8;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
show variables like 'character_sets_dir%';
show collation like 'utf8_phone_ci';
CREATE TABLE t1 (
name VARCHAR(64),
phone VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_phone_ci
);
INSERT INTO t1 VALUES ('Svoj','+7 912 800 80 02');
INSERT INTO t1 VALUES ('Hf','+7 (912) 800 80 04');
INSERT INTO t1 VALUES ('Bar','+7-912-800-80-01');
INSERT INTO t1 VALUES ('Ramil','(7912) 800 80 03');
INSERT INTO t1 VALUES ('Sanja','+380 (912) 8008005');
SELECT * FROM t1 ORDER BY phone;
SELECT * FROM t1 WHERE phone='+7(912)800-80-01';
SELECT * FROM t1 WHERE phone='79128008001';
SELECT * FROM t1 WHERE phone='7 9 1 2 8 0 0 8 0 0 1';
DROP TABLE t1;
show collation like 'utf8_test_ci';
create table t1 (c1 char(1) character set utf8 collate utf8_test_ci);
insert into t1 values ('a');

View File

@ -1430,6 +1430,19 @@ DROP TABLE t1;
--echo Start of 5.4 tests
#
# Bug#26180: Can't add columns to tables created with utf8 text indexes
#
CREATE TABLE t1 (
clipid INT NOT NULL,
Tape TINYTEXT,
PRIMARY KEY (clipid),
KEY tape(Tape(255))
) CHARACTER SET=utf8;
ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid;
SHOW CREATE TABLE t1;
DROP TABLE t1;
#
# Bug#26474: Add Sinhala script (Sri Lanka) collation to MySQL
#

View File

@ -13,3 +13,15 @@ select * from t1 where isnull(to_days(mydate));
drop table t1;
# End of 4.1 tests
#
# Bug #41371 Select returns 1 row with condition "col is not null and col is null"
#
CREATE TABLE t1 (id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY(id));
INSERT INTO t1( id ) VALUES ( NULL );
SELECT t1.id FROM t1 WHERE (id is not null and id is null );
DROP TABLE t1;
# End of 5.1 tests

View File

@ -3,6 +3,8 @@
drop table if exists t1;
--enable_warnings
set @@session.sql_auto_is_null=1;
#
# Test some ODBC compatibility
#
@ -32,3 +34,5 @@ SELECT sql_no_cache a, last_insert_id() FROM t1;
DROP TABLE t1;
# End of 4.1 tests
set @@session.sql_auto_is_null=default;

View File

@ -25,4 +25,124 @@ drop function bug17615|
drop table t3|
#
# Testing COLLATE clause in
# - IN parameter
# - RETURNS
# - DELCARE
#
CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci)
RETURNS VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_danish_ci
BEGIN
DECLARE f2 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_swedish_ci;
DECLARE f3 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_bin;
SET f1= concat(collation(f1), ' ', collation(f2), ' ', collation(f3));
RETURN f1;
END|
SELECT f('a')|
SELECT collation(f('a'))|
DROP FUNCTION f|
#
# Testing keywords UNICODE + BINARY
#
CREATE FUNCTION f()
RETURNS VARCHAR(64) UNICODE BINARY
BEGIN
RETURN '';
END|
SHOW CREATE FUNCTION f;
DROP FUNCTION f;
CREATE FUNCTION f()
RETURNS VARCHAR(64) BINARY UNICODE
BEGIN
RETURN '';
END|
SHOW CREATE FUNCTION f;
DROP FUNCTION f;
#
# Testing keywords ASCII + BINARY
#
CREATE FUNCTION f()
RETURNS VARCHAR(64) ASCII BINARY
BEGIN
RETURN '';
END|
SHOW CREATE FUNCTION f;
DROP FUNCTION f;
CREATE FUNCTION f()
RETURNS VARCHAR(64) BINARY ASCII
BEGIN
RETURN '';
END|
SHOW CREATE FUNCTION f;
DROP FUNCTION f;
#
# Testing COLLATE in OUT parameter
#
CREATE PROCEDURE p1(IN f1 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_czech_ci,
OUT f2 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_polish_ci)
BEGIN
SET f2= f1;
SET f2= concat(collation(f1), ' ', collation(f2));
END|
CREATE FUNCTION f1()
RETURNS VARCHAR(64) CHARACTER SET ucs2
BEGIN
DECLARE f1 VARCHAR(64) CHARACTER SET ucs2;
DECLARE f2 VARCHAR(64) CHARACTER SET ucs2;
SET f1='str';
CALL p1(f1, f2);
RETURN f2;
END|
SELECT f1()|
DROP PROCEDURE p1|
DROP FUNCTION f1|
#
# COLLATE with no CHARACTER SET in IN param
#
--error ER_NOT_SUPPORTED_YET
CREATE FUNCTION f(f1 VARCHAR(64) COLLATE ucs2_unicode_ci)
RETURNS VARCHAR(64) CHARACTER SET ucs2
BEGIN
RETURN 'str';
END|
#
# COLLATE with no CHARACTER SET in RETURNS
#
--error ER_NOT_SUPPORTED_YET
CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2)
RETURNS VARCHAR(64) COLLATE ucs2_unicode_ci
BEGIN
RETURN 'str';
END|
#
# COLLATE with no CHARACTER SET in DECLARE
#
--error ER_NOT_SUPPORTED_YET
CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2)
RETURNS VARCHAR(64) CHARACTER SET ucs2
BEGIN
DECLARE f2 VARCHAR(64) COLLATE ucs2_unicode_ci;
RETURN 'str';
END|
delimiter ;|

View File

@ -3908,6 +3908,31 @@ DROP TABLE t1;
--echo # -- End of 5.1 tests.
--echo # -----------------------------------------------------------------
#
# Bug#9801 (Views: imperfect error message)
#
--disable_warnings
drop table if exists t_9801;
drop view if exists v_9801;
--enable_warnings
create table t_9801 (s1 int);
--error ER_VIEW_NONUPD_CHECK
create view v_9801 as
select sum(s1) from t_9801 with check option;
--error ER_VIEW_NONUPD_CHECK
create view v_9801 as
select sum(s1) from t_9801 group by s1 with check option;
--error ER_VIEW_NONUPD_CHECK
create view v_9801 as
select sum(s1) from t_9801 group by s1 with rollup with check option;
drop table t_9801;
--echo #
--echo # Bug #47335 assert in get_table_share
--echo #