mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
After merge fixes
Some bigger code changes was necessary becasue of the multi-table-update and the new HANDLER code
This commit is contained in:
@@ -58,6 +58,17 @@ select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
drop table t1;
|
||||
create table t1 (a int not null auto_increment primary key, b char(32));
|
||||
insert into t1 (b) values ('apple'), ('apple');
|
||||
select * from t1;
|
||||
a b
|
||||
1 apple
|
||||
2 apple
|
||||
delete t1 from t1, t1 as t2 where t1.b = t2.b and t1.a > t2.a;
|
||||
select * from t1;
|
||||
a b
|
||||
1 apple
|
||||
drop table t1;
|
||||
create table t11 (a int NOT NULL, b int, primary key (a));
|
||||
create table t12 (a int NOT NULL, b int, primary key (a));
|
||||
create table t2 (a int NOT NULL, b int, primary key (a));
|
||||
@@ -130,14 +141,3 @@ select * from t1;
|
||||
a b
|
||||
7 7
|
||||
drop table t1;
|
||||
create table t1 (a int not null auto_increment primary key, b char(32));
|
||||
insert into t1 (b) values ('apple'), ('apple');
|
||||
select * from t1;
|
||||
a b
|
||||
1 apple
|
||||
2 apple
|
||||
delete t1 from t1, t1 as t2 where t1.b = t2.b and t1.a > t2.a;
|
||||
select * from t1;
|
||||
a b
|
||||
1 apple
|
||||
drop table t1;
|
||||
|
@@ -42,11 +42,11 @@ table_id
|
||||
test.t2
|
||||
|
||||
handler t1 open as a1;
|
||||
Not unique table/alias: 'a1'
|
||||
ERROR 42000: Not unique table/alias: 'a1'
|
||||
handler t1 open as a2;
|
||||
Not unique table/alias: 'a2'
|
||||
ERROR 42000: Not unique table/alias: 'a2'
|
||||
handler t2 open;
|
||||
Not unique table/alias: 't2'
|
||||
ERROR 42000: Not unique table/alias: 't2'
|
||||
handler a1 read first limit 9;
|
||||
table_id
|
||||
test.t1
|
||||
@@ -74,7 +74,6 @@ test.t2
|
||||
|
||||
flush table t2;
|
||||
handler t2 close;
|
||||
ERROR 42S02: Unknown table 't2' in HANDLER
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
create table t1(table_id char(20) primary key);
|
||||
|
@@ -321,6 +321,7 @@ trim(trailing 'foo' from 'foo')
|
||||
|
||||
select trim(leading 'foo' from 'foo');
|
||||
trim(leading 'foo' from 'foo')
|
||||
|
||||
select 1=_latin1'1';
|
||||
1=_latin1'1'
|
||||
1
|
||||
|
@@ -230,40 +230,36 @@ create table t1(table_id char(20) primary key);
|
||||
insert into t1 values ('test.t1');
|
||||
insert into t1 values ('');
|
||||
handler t1 open;
|
||||
Not unique table/alias: 't1'
|
||||
ERROR 42000: Not unique table/alias: 't1'
|
||||
use test;
|
||||
handler test.t1 read first limit 9;
|
||||
Unknown table 'test.t1' in HANDLER
|
||||
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 'read first limit 9' at line 1
|
||||
handler test_test.t1 read first limit 9;
|
||||
table_id
|
||||
test_test.t1
|
||||
|
||||
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 'read first limit 9' at line 1
|
||||
handler t1 read first limit 9;
|
||||
table_id
|
||||
test_test.t1
|
||||
|
||||
handler test_test.t2 read first limit 9;
|
||||
table_id
|
||||
test_test.t2
|
||||
|
||||
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 'read first limit 9' at line 1
|
||||
handler t2 read first limit 9;
|
||||
table_id
|
||||
test_test.t2
|
||||
|
||||
handler test_test.t1 close;
|
||||
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 'close' at line 1
|
||||
handler t1 close;
|
||||
Unknown table 't1' in HANDLER
|
||||
drop table test_test.t1;
|
||||
handler test_test.t2 close;
|
||||
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 'close' at line 1
|
||||
handler t2 close;
|
||||
Unknown table 't2' in HANDLER
|
||||
drop table test_test.t2;
|
||||
drop database test_test;
|
||||
use test;
|
||||
handler test.t1 close;
|
||||
Unknown table 'test.t1' in HANDLER
|
||||
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 'close' at line 1
|
||||
handler t1 close;
|
||||
Unknown table 't1' in HANDLER
|
||||
ERROR 42S02: Unknown table 't1' in HANDLER
|
||||
drop table test.t1;
|
||||
drop database if exists test_test;
|
||||
drop table if exists t1;
|
||||
@@ -291,20 +287,20 @@ insert into t1 values ('t1');
|
||||
insert into t2 values ('t2');
|
||||
insert into t3 values ('t3');
|
||||
handler t1 open;
|
||||
Not unique table/alias: 't1'
|
||||
ERROR 42000: Not unique table/alias: 't1'
|
||||
handler t2 open t1;
|
||||
Not unique table/alias: 't1'
|
||||
ERROR 42000: Not unique table/alias: 't1'
|
||||
handler t3 open t1;
|
||||
Not unique table/alias: 't1'
|
||||
ERROR 42000: Not unique table/alias: 't1'
|
||||
handler t1 read first limit 9;
|
||||
c1
|
||||
test_test.t1
|
||||
handler test.t1 close;
|
||||
Unknown table 'test.t1' in HANDLER
|
||||
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 'close' at line 1
|
||||
handler test.t1 open h1;
|
||||
Not unique table/alias: 'h1'
|
||||
ERROR 42000: Not unique table/alias: 'h1'
|
||||
handler test_test.t1 open h1;
|
||||
Not unique table/alias: 'h1'
|
||||
ERROR 42000: Not unique table/alias: 'h1'
|
||||
handler test_test.t3 open h3;
|
||||
handler test.t1 open h2;
|
||||
handler t1 read first limit 9;
|
||||
@@ -319,24 +315,24 @@ t1
|
||||
handler h3 read first limit 9;
|
||||
c1
|
||||
test_test.t3
|
||||
handler test.h2 read first limit 9;
|
||||
handler h2 read first limit 9;
|
||||
c1
|
||||
t1
|
||||
handler test.h1 close;
|
||||
Unknown table 'test.h1' in HANDLER
|
||||
handler test_test.t1 close;
|
||||
handler test_test.h1 close;
|
||||
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 'close' at line 1
|
||||
handler t1 close;
|
||||
handler h1 close;
|
||||
handler h2 close;
|
||||
handler t1 read first limit 9;
|
||||
Unknown table 't1' in HANDLER
|
||||
ERROR 42S02: Unknown table 't1' in HANDLER
|
||||
handler h1 read first limit 9;
|
||||
Unknown table 'h1' in HANDLER
|
||||
ERROR 42S02: Unknown table 'h1' in HANDLER
|
||||
handler h2 read first limit 9;
|
||||
Unknown table 'h2' in HANDLER
|
||||
ERROR 42S02: Unknown table 'h2' in HANDLER
|
||||
handler h3 read first limit 9;
|
||||
c1
|
||||
test_test.t3
|
||||
handler test_test.h3 read first limit 9;
|
||||
handler h3 read first limit 9;
|
||||
c1
|
||||
test_test.t3
|
||||
use test_test;
|
||||
@@ -344,8 +340,8 @@ handler h3 read first limit 9;
|
||||
c1
|
||||
test_test.t3
|
||||
handler test.h3 read first limit 9;
|
||||
Unknown table 'test.h3' in HANDLER
|
||||
handler test_test.h3 close;
|
||||
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 'read first limit 9' at line 1
|
||||
handler h3 close;
|
||||
use test;
|
||||
drop table t3;
|
||||
drop table t2;
|
||||
@@ -383,7 +379,7 @@ c1
|
||||
t5
|
||||
alter table t1 engine=MyISAM;
|
||||
handler h1 read first limit 9;
|
||||
Unknown table 'h1' in HANDLER
|
||||
ERROR 42S02: Unknown table 'h1' in HANDLER
|
||||
handler h2 read first limit 9;
|
||||
c1
|
||||
t2
|
||||
@@ -398,7 +394,7 @@ c1
|
||||
t5
|
||||
alter table t5 engine=MyISAM;
|
||||
handler h1 read first limit 9;
|
||||
Unknown table 'h1' in HANDLER
|
||||
ERROR 42S02: Unknown table 'h1' in HANDLER
|
||||
handler h2 read first limit 9;
|
||||
c1
|
||||
t2
|
||||
@@ -409,20 +405,20 @@ handler h4 read first limit 9;
|
||||
c1
|
||||
t4
|
||||
handler h5 read first limit 9;
|
||||
Unknown table 'h5' in HANDLER
|
||||
ERROR 42S02: Unknown table 'h5' in HANDLER
|
||||
alter table t3 engine=MyISAM;
|
||||
handler h1 read first limit 9;
|
||||
Unknown table 'h1' in HANDLER
|
||||
ERROR 42S02: Unknown table 'h1' in HANDLER
|
||||
handler h2 read first limit 9;
|
||||
c1
|
||||
t2
|
||||
handler h3 read first limit 9;
|
||||
Unknown table 'h3' in HANDLER
|
||||
ERROR 42S02: Unknown table 'h3' in HANDLER
|
||||
handler h4 read first limit 9;
|
||||
c1
|
||||
t4
|
||||
handler h5 read first limit 9;
|
||||
Unknown table 'h5' in HANDLER
|
||||
ERROR 42S02: Unknown table 'h5' in HANDLER
|
||||
handler h2 close;
|
||||
handler h4 close;
|
||||
handler t1 open as h1_1;
|
||||
@@ -439,11 +435,11 @@ c1
|
||||
t1
|
||||
alter table t1 engine=MyISAM;
|
||||
handler h1_1 read first limit 9;
|
||||
Unknown table 'h1_1' in HANDLER
|
||||
ERROR 42S02: Unknown table 'h1_1' in HANDLER
|
||||
handler h1_2 read first limit 9;
|
||||
Unknown table 'h1_2' in HANDLER
|
||||
ERROR 42S02: Unknown table 'h1_2' in HANDLER
|
||||
handler h1_3 read first limit 9;
|
||||
Unknown table 'h1_3' in HANDLER
|
||||
ERROR 42S02: Unknown table 'h1_3' in HANDLER
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
|
@@ -1,5 +1,8 @@
|
||||
drop table if exists t1,t2,t3;
|
||||
drop database if exists mysqltest;
|
||||
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
||||
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
|
||||
delete from mysql.user where user=_binary'mysqltest_1';
|
||||
create table t1(id1 int not null auto_increment primary key, t char(12));
|
||||
create table t2(id2 int not null, t char(12));
|
||||
create table t3(id3 int not null, t char(12), index(id3));
|
||||
@@ -152,7 +155,6 @@ ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
|
||||
UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
|
||||
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
|
||||
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
|
||||
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
|
||||
unlock tables;
|
||||
LOCK TABLES t1 write, t2 write;
|
||||
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
drop table if exists t0,t1,t2,t3,t4;
|
||||
drop table if exists t0,t5,t6,t7,t8,t9;
|
||||
drop table if exists t0,t5,t6,t7,t8,t9,t1_1,t1_2,t9_1,t9_2;
|
||||
create table t0 SELECT 1,"table 1";
|
||||
create table t2 SELECT 2,"table 2";
|
||||
create table t3 SELECT 3,"table 3";
|
||||
|
@@ -1,4 +1,5 @@
|
||||
drop table if exists t1,t2,t3,t4;
|
||||
drop table if exists t1_1,t1_2,t9_1,t9_2;
|
||||
CREATE TABLE t1 (
|
||||
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
|
||||
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
|
||||
|
@@ -1,5 +1,8 @@
|
||||
drop table if exists t1,t2;
|
||||
drop database if exists mysqltest;
|
||||
delete from mysql.user where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
||||
delete from mysql.db where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
||||
flush privileges;
|
||||
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
|
||||
insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
|
||||
check table t1 fast;
|
||||
|
@@ -89,7 +89,6 @@ drop table t1;
|
||||
#
|
||||
# Bug #5447 Select does not find records
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (
|
||||
autor varchar(80) NOT NULL default '',
|
||||
PRIMARY KEY (autor)
|
||||
|
@@ -101,7 +101,7 @@ SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1;
|
||||
#
|
||||
# Connect without a database
|
||||
create table t1 select 1 as a;
|
||||
connect (con1,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,master.sock);
|
||||
connect (con1,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connection con1;
|
||||
--error 1046
|
||||
select 2 as a from (select * from t1) b;
|
||||
|
@@ -174,30 +174,34 @@ handler t1 open;
|
||||
# Check accesibility of all the tables.
|
||||
#
|
||||
use test;
|
||||
--error 1109;
|
||||
--error 1064
|
||||
handler test.t1 read first limit 9;
|
||||
--error 1064
|
||||
handler test_test.t1 read first limit 9;
|
||||
handler t1 read first limit 9;
|
||||
--error 1064
|
||||
handler test_test.t2 read first limit 9;
|
||||
handler t2 read first limit 9;
|
||||
|
||||
#
|
||||
# Cleanup.
|
||||
#
|
||||
|
||||
--error 1064
|
||||
handler test_test.t1 close;
|
||||
--error 1109;
|
||||
handler t1 close;
|
||||
drop table test_test.t1;
|
||||
--error 1064
|
||||
handler test_test.t2 close;
|
||||
--error 1109;
|
||||
handler t2 close;
|
||||
drop table test_test.t2;
|
||||
drop database test_test;
|
||||
|
||||
#
|
||||
use test;
|
||||
--error 1109;
|
||||
--error 1064
|
||||
handler test.t1 close;
|
||||
--error 1109;
|
||||
--error 1109
|
||||
handler t1 close;
|
||||
drop table test.t1;
|
||||
|
||||
@@ -234,7 +238,7 @@ handler t2 open t1;
|
||||
--error 1066
|
||||
handler t3 open t1;
|
||||
handler t1 read first limit 9;
|
||||
--error 1109
|
||||
--error 1064
|
||||
handler test.t1 close;
|
||||
--error 1066
|
||||
handler test.t1 open h1;
|
||||
@@ -246,11 +250,11 @@ handler t1 read first limit 9;
|
||||
handler h1 read first limit 9;
|
||||
handler h2 read first limit 9;
|
||||
handler h3 read first limit 9;
|
||||
handler test.h2 read first limit 9;
|
||||
--error 1109
|
||||
handler h2 read first limit 9;
|
||||
--error 1064
|
||||
handler test.h1 close;
|
||||
handler test_test.t1 close;
|
||||
handler test_test.h1 close;
|
||||
handler t1 close;
|
||||
handler h1 close;
|
||||
handler h2 close;
|
||||
--error 1109
|
||||
handler t1 read first limit 9;
|
||||
@@ -259,12 +263,12 @@ handler h1 read first limit 9;
|
||||
--error 1109
|
||||
handler h2 read first limit 9;
|
||||
handler h3 read first limit 9;
|
||||
handler test_test.h3 read first limit 9;
|
||||
handler h3 read first limit 9;
|
||||
use test_test;
|
||||
handler h3 read first limit 9;
|
||||
--error 1109
|
||||
--error 1064
|
||||
handler test.h3 read first limit 9;
|
||||
handler test_test.h3 close;
|
||||
handler h3 close;
|
||||
use test;
|
||||
drop table t3;
|
||||
drop table t2;
|
||||
|
@@ -5,6 +5,11 @@
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3;
|
||||
drop database if exists mysqltest;
|
||||
--error 0,1141
|
||||
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
||||
--error 0,1141
|
||||
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
|
||||
delete from mysql.user where user=_binary'mysqltest_1';
|
||||
--enable_warnings
|
||||
|
||||
create table t1(id1 int not null auto_increment primary key, t char(12));
|
||||
@@ -383,10 +388,10 @@ select * from t2;
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# prevelege chexk for multiupdate with other tables
|
||||
# privilege check for multiupdate with other tables
|
||||
#
|
||||
|
||||
connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
|
||||
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connection root;
|
||||
--disable_warnings
|
||||
create database mysqltest;
|
||||
@@ -396,7 +401,7 @@ create table mysqltest.t2 (a int, b int, primary key (a));
|
||||
create table mysqltest.t3 (a int, b int, primary key (a));
|
||||
grant select on mysqltest.* to mysqltest_1@localhost;
|
||||
grant update on mysqltest.t1 to mysqltest_1@localhost;
|
||||
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock);
|
||||
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connection user1;
|
||||
update t1, t2 set t1.b=1 where t1.a=t2.a;
|
||||
update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a;
|
||||
|
@@ -423,6 +423,9 @@ select count(*) from t1 where x=0;
|
||||
select count(*) from t1 where x<0;
|
||||
select count(*) from t1 where x < -16;
|
||||
select count(*) from t1 where x = -16;
|
||||
# The following query returns wrong value because the range optimizer can't
|
||||
# handle search on a signed value for an unsigned parameter. This will be fixed in
|
||||
# 5.0
|
||||
select count(*) from t1 where x > -16;
|
||||
select count(*) from t1 where x = 18446744073709551601;
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
--disable_warnings
|
||||
drop table if exists t0,t1,t2,t3,t4;
|
||||
# Clear up from other tests (to ensure that SHOW TABLES below is right)
|
||||
drop table if exists t0,t5,t6,t7,t8,t9;
|
||||
drop table if exists t0,t5,t6,t7,t8,t9,t1_1,t1_2,t9_1,t9_2;
|
||||
--enable_warnings
|
||||
|
||||
create table t0 SELECT 1,"table 1";
|
||||
|
@@ -8,6 +8,8 @@
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3,t4;
|
||||
# The following may be left from older tests
|
||||
drop table if exists t1_1,t1_2,t9_1,t9_2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (
|
||||
|
@@ -5,6 +5,10 @@
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
drop database if exists mysqltest;
|
||||
|
||||
delete from mysql.user where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
||||
delete from mysql.db where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
||||
flush privileges;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
|
||||
|
@@ -62,6 +62,17 @@ INSERT INTO t1 VALUES ("2030-01-01","2030-01-01 00:00:00",20300101000000);
|
||||
SELECT * FROM t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6),
|
||||
t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
|
||||
t14 timestamp(14));
|
||||
insert t1 values (0,0,0,0,0,0,0),
|
||||
("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
|
||||
"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
|
||||
"1997-12-31 23:47:59");
|
||||
select * from t1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Let us check if we properly treat wrong datetimes and produce proper warnings
|
||||
# (for both strings and numbers)
|
||||
@@ -270,7 +281,6 @@ drop table t1;
|
||||
# Test for bug #4131, TIMESTAMP columns missing minutes and seconds when
|
||||
# using GROUP BY in @@new=1 mode.
|
||||
#
|
||||
set new=1;
|
||||
create table t1 (a char(2), t timestamp);
|
||||
insert into t1 values ('a', '2004-01-01 00:00:00'), ('a', '2004-01-01 01:00:00'),
|
||||
('b', '2004-02-01 00:00:00');
|
||||
|
Reference in New Issue
Block a user