mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
118 lines
3.6 KiB
Text
118 lines
3.6 KiB
Text
drop table if exists t1;
|
|
set sql_mode="MySQL40";
|
|
select @@sql_mode;
|
|
@@sql_mode
|
|
MYSQL40,HIGH_NOT_PRECEDENCE
|
|
set @@sql_mode="ANSI";
|
|
select @@sql_mode;
|
|
@@sql_mode
|
|
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
|
|
SELECT 'A' || 'B';
|
|
'A' || 'B'
|
|
AB
|
|
CREATE TABLE t1 (id INT, id2 int);
|
|
SELECT id,NULL,1,1.1,'a' FROM t1 GROUP BY id;
|
|
id NULL 1 1.1 a
|
|
SELECT id FROM t1 GROUP BY id2;
|
|
id
|
|
drop table t1;
|
|
SET @@SQL_MODE="";
|
|
CREATE TABLE t1 (i int auto_increment NOT NULL, PRIMARY KEY (i));
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`i` int(11) NOT NULL AUTO_INCREMENT,
|
|
PRIMARY KEY (`i`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
|
SET @@SQL_MODE="MYSQL323";
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`i` int(11) NOT NULL AUTO_INCREMENT,
|
|
PRIMARY KEY (`i`)
|
|
) TYPE=MyISAM
|
|
SET @@SQL_MODE="MYSQL40";
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`i` int(11) NOT NULL AUTO_INCREMENT,
|
|
PRIMARY KEY (`i`)
|
|
) TYPE=MyISAM
|
|
SET @@SQL_MODE="NO_FIELD_OPTIONS";
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`i` int(11) NOT NULL,
|
|
PRIMARY KEY (`i`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
|
DROP TABLE t1;
|
|
#
|
|
# MDEV-16186 Concatenation operator || returns wrong results in sql_mode=ORACLE
|
|
#
|
|
SET sql_mode=ANSI;
|
|
SELECT -1<<1||1 AS a FROM DUAL;
|
|
a
|
|
18446744073709549568
|
|
SELECT -1||0<<1 AS a FROM DUAL;
|
|
a
|
|
18446744073709551596
|
|
EXPLAIN EXTENDED SELECT -1<<1||1 AS a FROM DUAL;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
Warnings:
|
|
Note 1003 select -1 << concat(1,1) AS "a"
|
|
EXPLAIN EXTENDED SELECT -1||0<<1 AS a FROM DUAL;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
Warnings:
|
|
Note 1003 select concat(-1,0) << 1 AS "a"
|
|
SELECT -1+1||1 AS a FROM DUAL;
|
|
a
|
|
10
|
|
SELECT -1||0+1 AS a FROM DUAL;
|
|
a
|
|
-9
|
|
EXPLAIN EXTENDED SELECT -1+1||1 AS a FROM DUAL;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
Warnings:
|
|
Note 1003 select -1 + concat(1,1) AS "a"
|
|
EXPLAIN EXTENDED SELECT -1||0+1 AS a FROM DUAL;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
Warnings:
|
|
Note 1003 select concat(-1,0) + 1 AS "a"
|
|
SELECT 1*1||-1 AS a FROM DUAL;
|
|
a
|
|
1
|
|
Warnings:
|
|
Warning 1292 Truncated incorrect DOUBLE value: '1-1'
|
|
SELECT 1||1*-1 AS a FROM DUAL;
|
|
a
|
|
-11
|
|
EXPLAIN EXTENDED SELECT 1*1||-1 AS a FROM DUAL;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
Warnings:
|
|
Note 1003 select 1 * concat(1,-1) AS "a"
|
|
EXPLAIN EXTENDED SELECT 1||1*-1 AS a FROM DUAL;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
Warnings:
|
|
Note 1003 select concat(1,1) * -1 AS "a"
|
|
SELECT -1^1||1 AS a FROM DUAL;
|
|
a
|
|
18446744073709551604
|
|
SELECT -1||0^1 AS a FROM DUAL;
|
|
a
|
|
18446744073709551607
|
|
EXPLAIN EXTENDED SELECT -1^1||1 AS a FROM DUAL;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
Warnings:
|
|
Note 1003 select -1 ^ concat(1,1) AS "a"
|
|
EXPLAIN EXTENDED SELECT -1||0^1 AS a FROM DUAL;
|
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
Warnings:
|
|
Note 1003 select concat(-1,0) ^ 1 AS "a"
|