1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
This commit is contained in:
bell@sanja.is.com.ua
2003-07-22 11:18:51 +03:00
63 changed files with 561 additions and 366 deletions

View File

@ -1,4 +1,4 @@
-- require r/have_openssl_2.require
disable_query_log;
SHOW STATUS LIKE "SSL_get_cipher";
SHOW STATUS LIKE "Ssl_cipher";
enable_query_log;

View File

@ -203,7 +203,7 @@ a
2
check table t1;
Table Op Msg_type Msg_text
test.t1 check error The storage enginge for the table doesn't support check
test.t1 check error The storage engine for the table doesn't support check
drop table t1;
create table t1 (a int,b varchar(20)) type=bdb;
insert into t1 values (1,""), (2,"testing");

View File

@ -1,12 +1,12 @@
drop table if exists t1;
select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296
0 256 00000000000000065536 2147483647 -2147483648 2147483648 4294967296
0 256 65536 2147483647 -2147483648 2147483648 4294967296
select 9223372036854775807,-009223372036854775808;
9223372036854775807 -009223372036854775808
9223372036854775807 -9223372036854775808
select +9999999999999999999,-9999999999999999999;
+9999999999999999999 -9999999999999999999
9999999999999999999 -9999999999999999999
9999999999999999999 -10000000000000000000
select cast(9223372036854775808 as unsigned)+1;
cast(9223372036854775808 as unsigned)+1
@ -14,6 +14,9 @@ cast(9223372036854775808 as unsigned)+1
select 9223372036854775808+1;
9223372036854775808+1
9223372036854775809
select -(0-3),round(-(0-3)), round(9999999999999999999);
-(0-3) round(-(0-3)) round(9999999999999999999)
3 3 10000000000000000000
create table t1 (a bigint unsigned not null, primary key(a));
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
select * from t1;

View File

@ -10,10 +10,10 @@ CASE "c" when "a" then 1 when "b" then 2 ELSE 3 END
3
select CASE BINARY "b" when "a" then 1 when "B" then 2 WHEN "b" then "ok" END;
CASE BINARY "b" when "a" then 1 when "B" then 2 WHEN "b" then "ok" END
0
ok
select CASE "b" when "a" then 1 when binary "B" then 2 WHEN "b" then "ok" END;
CASE "b" when "a" then 1 when binary "B" then 2 WHEN "b" then "ok" END
0
ok
select CASE concat("a","b") when concat("ab","") then "a" when "b" then "b" end;
CASE concat("a","b") when concat("ab","") then "a" when "b" then "b" end
a
@ -72,6 +72,48 @@ yellow
green
drop table t1;
SET NAMES latin1;
CREATE TABLE t1 SELECT
CASE WHEN 1 THEN _latin1'a' COLLATE latin1_danish_ci ELSE _latin1'a' END AS c1,
CASE WHEN 1 THEN _latin1'a' ELSE _latin1'a' COLLATE latin1_danish_ci END AS c2,
CASE WHEN 1 THEN 'a' ELSE 1 END AS c3,
CASE WHEN 1 THEN 1 ELSE 'a' END AS c4,
CASE WHEN 1 THEN 'a' ELSE 1.0 END AS c5,
CASE WHEN 1 THEN 1.0 ELSE 'a' END AS c6,
CASE WHEN 1 THEN 1 ELSE 1.0 END AS c7,
CASE WHEN 1 THEN 1.0 ELSE 1 END AS c8
;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` char(1) character set latin1 collate latin1_danish_ci default NULL,
`c2` char(1) character set latin1 collate latin1_danish_ci default NULL,
`c3` char(1) default NULL,
`c4` char(1) default NULL,
`c5` char(3) default NULL,
`c6` char(3) default NULL,
`c7` double(3,1) default NULL,
`c8` double(3,1) default NULL
) TYPE=MyISAM CHARSET=latin1
DROP TABLE t1;
SELECT CASE
WHEN 1
THEN _latin1'a' COLLATE latin1_danish_ci
ELSE _latin1'a' COLLATE latin1_swedish_ci
END;
ERROR HY000: Illegal mix of collations (latin1_danish_ci,EXPLICIT) and (latin1_swedish_ci,EXPLICIT) for operation 'case'
SELECT CASE _latin1'a' COLLATE latin1_general_ci
WHEN _latin1'a' COLLATE latin1_danish_ci THEN 1
WHEN _latin1'a' COLLATE latin1_swedish_ci THEN 2
END;
ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT), (latin1_danish_ci,EXPLICIT), (latin1_swedish_ci,EXPLICIT) for operation 'case'
SELECT
CASE _latin1'a' COLLATE latin1_general_ci WHEN _latin1'A' THEN '1' ELSE 2 END,
CASE _latin1'a' COLLATE latin1_bin WHEN _latin1'A' THEN '1' ELSE 2 END,
CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_swedish_ci THEN '1' ELSE 2 END,
CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_bin THEN '1' ELSE 2 END
;
CASE _latin1'a' COLLATE latin1_general_ci WHEN _latin1'A' THEN '1' ELSE 2 END CASE _latin1'a' COLLATE latin1_bin WHEN _latin1'A' THEN '1' ELSE 2 END CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_swedish_ci THEN '1' ELSE 2 END CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_bin THEN '1' ELSE 2 END
1 2 1 2
CREATE TABLE t1 SELECT COALESCE(_latin1'a',_latin2'a');
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'coalesce'
CREATE TABLE t1 SELECT COALESCE('a' COLLATE latin1_swedish_ci,'b' COLLATE latin1_bin);

View File

@ -143,3 +143,24 @@ select * from t1 where 'a' in (a,b,c collate latin1_bin);
a b c
a c c
drop table t1;
select '1.0' in (1,2);
'1.0' in (1,2)
1
select 1 in ('1.0',2);
1 in ('1.0',2)
1
select 1 in (1,'2.0');
1 in (1,'2.0')
1
select 1 in ('1.0',2.0);
1 in ('1.0',2.0)
1
select 1 in (1.0,'2.0');
1 in (1.0,'2.0')
1
select 1 in ('1.1',2);
1 in ('1.1',2)
0
select 1 in ('1.1',2.0);
1 in ('1.1',2.0)
0

View File

@ -1,2 +1,2 @@
Variable_name Value
jkhjkhfs
Ssl_cipher EDH-RSA-DES-CBC3-SHA

View File

@ -156,7 +156,7 @@ level id parent_id
1 1007 101
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize error The storage enginge for the table doesn't support optimize
test.t1 optimize error The storage engine for the table doesn't support optimize
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 id A # NULL NULL BTREE
@ -180,7 +180,7 @@ create table t1 (a int) type=innodb;
insert into t1 values (1), (2);
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize error The storage enginge for the table doesn't support optimize
test.t1 optimize error The storage engine for the table doesn't support optimize
delete from t1 where a = 1;
select * from t1;
a
@ -712,7 +712,7 @@ world 2
hello 1
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize error The storage enginge for the table doesn't support optimize
test.t1 optimize error The storage engine for the table doesn't support optimize
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 a A 2 NULL NULL BTREE
@ -788,7 +788,7 @@ id id3
UNLOCK TABLES;
DROP TABLE t1;
create table t1 (a char(20), unique (a(5))) type=innodb;
ERROR HY000: Incorrect sub part key. The used key part isn't a string, the used length is longer than the key part or the store engine doesn't support unique sub keys
ERROR HY000: Incorrect sub part key. The used key part isn't a string, the used length is longer than the key part or the storage engine doesn't support unique sub keys
create table t1 (a char(20), index (a(5))) type=innodb;
show create table t1;
Table Create Table
@ -1289,7 +1289,7 @@ a b
111 100
drop table t1;
CREATE TABLE t1 (col1 int(1))TYPE=InnoDB;
CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP(+0),INDEX stamp_idx
CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx
(stamp))TYPE=InnoDB;
insert into t1 values (1),(2),(3);
insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 );

View File

@ -57,14 +57,14 @@ test.t1 optimize status OK
check table t1,t2;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t2 check error The storage enginge for the table doesn't support check
test.t2 check error The storage engine for the table doesn't support check
repair table t1,t2;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t2 repair error The storage enginge for the table doesn't support repair
test.t2 repair error The storage engine for the table doesn't support repair
check table t2,t1;
Table Op Msg_type Msg_text
test.t2 check error The storage enginge for the table doesn't support check
test.t2 check error The storage engine for the table doesn't support check
test.t1 check status OK
lock tables t1 write;
check table t2,t1;

View File

@ -178,9 +178,9 @@ t3 CREATE TABLE `t3` (
) TYPE=MRG_MyISAM CHARSET=latin1 UNION=(`t1`,`t2`)
create table t4 (a int not null, b char(10), key(a)) type=MERGE UNION=(t1,t2);
select * from t4;
ERROR HY000: Can't open file: 't4.MRG'. (errno: 143)
ERROR HY000: Can't open file: 't4.MRG' (errno: 143)
alter table t4 add column c int;
ERROR HY000: Can't open file: 't4.MRG'. (errno: 143)
ERROR HY000: Can't open file: 't4.MRG' (errno: 143)
create database mysqltest;
create table mysqltest.t6 (a int not null primary key auto_increment, message char(20));
create table t5 (a int not null, b char(20), key(a)) type=MERGE UNION=(test.t1,mysqltest.t6);

View File

@ -7,7 +7,7 @@ select 1 | NULL,1 & NULL,1+NULL,1-NULL;
NULL NULL NULL NULL
select NULL=NULL,NULL<>NULL,IFNULL(NULL,1.1)+0,IFNULL(NULL,1) | 0;
NULL=NULL NULL<>NULL IFNULL(NULL,1.1)+0 IFNULL(NULL,1) | 0
NULL NULL 1 1
NULL NULL 1.1 1
select strcmp("a",NULL),(1<NULL)+0.0,NULL regexp "a",null like "a%","a%" like null;
strcmp("a",NULL) (1<NULL)+0.0 NULL regexp "a" null like "a%" "a%" like null
NULL NULL NULL NULL NULL

View File

@ -1,2 +1,25 @@
SHOW STATUS LIKE 'SSL%';
SHOW STATUS LIKE 'Ssl%';
Variable_name Value
Ssl_accepts 1
Ssl_finished_accepts 1
Ssl_finished_connects 0
Ssl_accept_renegotiates 0
Ssl_connect_renegotiates 0
Ssl_callback_cache_hits 0
Ssl_session_cache_hits 0
Ssl_session_cache_misses 0
Ssl_session_cache_timeouts 0
Ssl_used_session_cache_entries 1
Ssl_client_connects 0
Ssl_session_cache_overflows 0
Ssl_session_cache_size 128
Ssl_session_cache_mode SERVER
Ssl_sessions_reused 0
Ssl_ctx_verify_mode 7
Ssl_ctx_verify_depth 4294967295
Ssl_verify_mode 7
Ssl_verify_depth 4294967295
Ssl_version TLSv1
Ssl_cipher EDH-RSA-DES-CBC3-SHA
Ssl_cipher_list
Ssl_default_timeout 7200

View File

@ -7,7 +7,7 @@ test.t1 repair status OK
alter table t1 TYPE=HEAP;
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair error The storage enginge for the table doesn't support repair
test.t1 repair error The storage engine for the table doesn't support repair
drop table t1;
repair table t1 use_frm;
Table Op Msg_type Msg_text

View File

@ -1,6 +1,6 @@
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair error Can't open file: 't1.MYI'. (errno: 130)
test.t1 repair error Can't open file: 't1.MYI' (errno: 130)
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair warning Number of rows changed from 0 to 1

View File

@ -347,7 +347,7 @@ a 1
hello 1
drop table t1;
create table t1 (a text, key (a(300)));
ERROR HY000: Incorrect sub part key. The used key part isn't a string, the used length is longer than the key part or the store engine doesn't support unique sub keys
ERROR HY000: Incorrect sub part key. The used key part isn't a string, the used length is longer than the key part or the storage engine doesn't support unique sub keys
create table t1 (a text, key (a(255)));
drop table t1;
CREATE TABLE t1 (

View File

@ -436,8 +436,8 @@ a
99999999999
drop table t1;
CREATE TABLE t1 (a_dec DECIMAL(-1,0));
ERROR 42000: Too big column length for column 'a_dec' (max = 255). Use BLOB instead
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,0))' at line 1
CREATE TABLE t1 (a_dec DECIMAL(-2,1));
ERROR 42000: Too big column length for column 'a_dec' (max = 255). Use BLOB instead
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-2,1))' at line 1
CREATE TABLE t1 (a_dec DECIMAL(-1,1));
ERROR 42000: Too big column length for column 'a_dec' (max = 255). Use BLOB instead
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,1))' at line 1

View File

@ -90,6 +90,12 @@ Warning 1263 Data truncated for column 'b' at row 2
Warning 1263 Data truncated for column 'b' at row 3
Warning 1261 Data truncated, NULL supplied to NOT NULL column 'a' at row 4
Warning 1263 Data truncated for column 'b' at row 4
insert into t2(b) values('mysqlab');
set sql_warnings=1;
insert into t2(b) values('mysqlab');
Warnings:
Warning 1263 Data truncated for column 'b' at row 1
set sql_warnings=0;
drop table t1, t2;
create table t1(a char(10));
alter table t1 add b char;

View File

@ -13,6 +13,8 @@ select 9223372036854775807,-009223372036854775808;
select +9999999999999999999,-9999999999999999999;
select cast(9223372036854775808 as unsigned)+1;
select 9223372036854775808+1;
select -(0-3),round(-(0-3)), round(9999999999999999999);
#
# In 3.23 we have to disable the test of column to bigint as
# this fails on AIX powerpc (the resolution for double is not good enough)

View File

@ -42,6 +42,44 @@ insert into t1 values (1,1,'orange'),(1,2,'large'),(2,1,'yellow'),(2,2,'medium')
select max(case col when 1 then val else null end) as color from t1 group by row;
drop table t1;
SET NAMES latin1;
#
# CASE and argument types/collations aggregation into result
#
CREATE TABLE t1 SELECT
CASE WHEN 1 THEN _latin1'a' COLLATE latin1_danish_ci ELSE _latin1'a' END AS c1,
CASE WHEN 1 THEN _latin1'a' ELSE _latin1'a' COLLATE latin1_danish_ci END AS c2,
CASE WHEN 1 THEN 'a' ELSE 1 END AS c3,
CASE WHEN 1 THEN 1 ELSE 'a' END AS c4,
CASE WHEN 1 THEN 'a' ELSE 1.0 END AS c5,
CASE WHEN 1 THEN 1.0 ELSE 'a' END AS c6,
CASE WHEN 1 THEN 1 ELSE 1.0 END AS c7,
CASE WHEN 1 THEN 1.0 ELSE 1 END AS c8
;
SHOW CREATE TABLE t1;
DROP TABLE t1;
--error 1265
SELECT CASE
WHEN 1
THEN _latin1'a' COLLATE latin1_danish_ci
ELSE _latin1'a' COLLATE latin1_swedish_ci
END;
--error 1268
SELECT CASE _latin1'a' COLLATE latin1_general_ci
WHEN _latin1'a' COLLATE latin1_danish_ci THEN 1
WHEN _latin1'a' COLLATE latin1_swedish_ci THEN 2
END;
SELECT
CASE _latin1'a' COLLATE latin1_general_ci WHEN _latin1'A' THEN '1' ELSE 2 END,
CASE _latin1'a' COLLATE latin1_bin WHEN _latin1'A' THEN '1' ELSE 2 END,
CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_swedish_ci THEN '1' ELSE 2 END,
CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_bin THEN '1' ELSE 2 END
;
#
# COALESCE is a CASE abbrevation:
#
@ -52,7 +90,6 @@ drop table t1;
#
# Check COALESCE argument types aggregation
SET NAMES latin1;
--error 1265
CREATE TABLE t1 SELECT COALESCE(_latin1'a',_latin2'a');
--error 1265

View File

@ -73,3 +73,11 @@ select * from t1 where 'a' collate latin1_general_ci in (a,b,c);
select * from t1 where 'a' collate latin1_bin in (a,b,c);
select * from t1 where 'a' in (a,b,c collate latin1_bin);
drop table t1;
select '1.0' in (1,2);
select 1 in ('1.0',2);
select 1 in (1,'2.0');
select 1 in ('1.0',2.0);
select 1 in (1.0,'2.0');
select 1 in ('1.1',2);
select 1 in ('1.1',2.0);

View File

@ -868,7 +868,7 @@ drop table t1;
CREATE TABLE t1 (col1 int(1))TYPE=InnoDB;
CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP(+0),INDEX stamp_idx
CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx
(stamp))TYPE=InnoDB;
insert into t1 values (1),(2),(3);
insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 );

View File

@ -1,5 +1,5 @@
# We want to test everything with SSL turned on.
-- source include/have_openssl_2.inc
SHOW STATUS LIKE 'SSL%';
SHOW STATUS LIKE 'Ssl%';

View File

@ -237,9 +237,9 @@ drop table t1;
# Test of wrong decimal type
#
--error 1074
--error 1064
CREATE TABLE t1 (a_dec DECIMAL(-1,0));
--error 1074
--error 1064
CREATE TABLE t1 (a_dec DECIMAL(-2,1));
--error 1074
--error 1064
CREATE TABLE t1 (a_dec DECIMAL(-1,1));

View File

@ -51,6 +51,10 @@ update t1 set c='mysql ab' where c='test';
update t1 set d=c;
create table t2(a tinyint NOT NULL, b char(3));
insert into t2 select b,c from t1;
insert into t2(b) values('mysqlab');
set sql_warnings=1;
insert into t2(b) values('mysqlab');
set sql_warnings=0;
drop table t1, t2;
#