1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Automatic conversion from CHAR(length) to BLOB when length > 255

New operators MOD and DIV
SELECT ... FROM DUAL
TRUE = 1 and FALSE = 0
This commit is contained in:
monty@mashka.mysql.fi
2002-11-21 02:07:14 +02:00
parent f86d328927
commit 305d16a7cb
39 changed files with 223 additions and 41 deletions

View File

@ -4,3 +4,6 @@ test 1
select version()>="3.23.29";
version()>="3.23.29"
1
select TRUE,FALSE,NULL;
TRUE FALSE NULL
1 0 NULL

View File

@ -46,6 +46,9 @@ select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL
0 1 1 0 NULL NULL NULL
select 10 % 7, 10 mod 7, 10 div 3;
10 % 7 10 mod 7 10 div 3
3 3 3
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
0 1

View File

@ -1,4 +1,36 @@
drop table if exists t1,t2,t3,t4,t5,t6,t7;
CREATE TABLE t1 (a blob, b text, c blob(250), d text(70000), e text(70000000));
show columns from t1;
Field Type Null Key Default Extra
a blob YES NULL
b text character set latin1 YES NULL
c blob YES NULL
d mediumtext character set latin1 YES NULL
e longtext character set latin1 YES NULL
CREATE TABLE t2 (a char(257), b varchar(70000) binary, c varchar(70000000));
Warnings:
Warning 1244 Converting column 'a' from CHAR to TEXT
Warning 1244 Converting column 'b' from CHAR to BLOB
Warning 1244 Converting column 'c' from CHAR to TEXT
show columns from t2;
Field Type Null Key Default Extra
a text character set latin1 YES NULL
b mediumblob YES NULL
c longtext character set latin1 YES NULL
create table t3 (a long, b long byte);
show create TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` mediumtext character set latin1,
`b` mediumblob
) TYPE=MyISAM CHARSET=latin1
drop table t1,t2,t3
#;
CREATE TABLE t1 (a char(257) default "hello");
Too big column length for column 'a' (max = 255). Use BLOB instead
CREATE TABLE t2 (a blob default "hello");
BLOB column 'a' can't have a default value
drop table if exists t1,t2;
create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary key (nr));
insert into t1 values (null,"a","A");
insert into t1 values (null,"bbb","BBB");

View File

@ -4,3 +4,4 @@
select database(),user() like "%@%";
select version()>="3.23.29";
select TRUE,FALSE,NULL;

View File

@ -17,6 +17,7 @@ select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,
select -1.49 or -1.49,0.6 or 0.6;
select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
select 10 % 7, 10 mod 7, 10 div 3;
#
# Wrong usage of functions

View File

@ -1,8 +1,34 @@
#
# Basic cleanup
#
drop table if exists t1,t2,t3,t4,t5,t6,t7;
#
# Check syntax for creating BLOB/TEXT
#
CREATE TABLE t1 (a blob, b text, c blob(250), d text(70000), e text(70000000));
show columns from t1;
CREATE TABLE t2 (a char(257), b varchar(70000) binary, c varchar(70000000));
show columns from t2;
create table t3 (a long, b long byte);
show create TABLE t3;
drop table t1,t2,t3
#
# Check errors with blob
#
--error 1074
CREATE TABLE t1 (a char(257) default "hello");
--error 1101
CREATE TABLE t2 (a blob default "hello");
drop table if exists t1,t2;
#
# test of full join with blob
#
drop table if exists t1,t2,t3,t4,t5,t6,t7;
create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary key (nr));
insert into t1 values (null,"a","A");
insert into t1 values (null,"bbb","BBB");