mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 11:27:39 +02:00
Merge bk-internal:/home/bk/mysql-5.1-maint
into siva.hindu.god:/usr/home/tim/m/bk/tmp/51-mrg50 sql/item_func.h: Auto merged sql/item_strfunc.cc: Auto merged sql/sql_class.h: Auto merged
This commit is contained in:
commit
3c6ca775e2
37 changed files with 610 additions and 341 deletions
|
|
@ -1340,6 +1340,19 @@ select a from t1 group by a;
|
|||
a
|
||||
e
|
||||
drop table t1;
|
||||
set names utf8;
|
||||
grant select on test.* to юзер_юзер@localhost;
|
||||
user()
|
||||
юзер_юзер@localhost
|
||||
revoke all on test.* from юзер_юзер@localhost;
|
||||
drop user юзер_юзер@localhost;
|
||||
create database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
|
||||
use имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
|
||||
select database();
|
||||
database()
|
||||
имя_базы_в_кодировке_утф8_длиной_больше_чем_45
|
||||
drop database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
|
||||
use test;
|
||||
CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8;
|
||||
INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa');
|
||||
SELECT id FROM t1;
|
||||
|
|
|
|||
|
|
@ -76,3 +76,17 @@ a
|
|||
a
|
||||
1
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
|
||||
explain select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using temporary
|
||||
select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
|
||||
c
|
||||
7
|
||||
explain select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using temporary
|
||||
select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
|
||||
c
|
||||
28
|
||||
|
|
|
|||
21
mysql-test/r/loaddata_autocom_innodb.result
Normal file
21
mysql-test/r/loaddata_autocom_innodb.result
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
SET SESSION STORAGE_ENGINE = InnoDB;
|
||||
drop table if exists t1;
|
||||
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
|
||||
start transaction;
|
||||
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
Warnings:
|
||||
Warning 1261 Row 3 doesn't contain data for all columns
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
4
|
||||
truncate table t1;
|
||||
start transaction;
|
||||
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
Warnings:
|
||||
Warning 1261 Row 3 doesn't contain data for all columns
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
drop table t1;
|
||||
23
mysql-test/r/loaddata_autocom_ndb.result
Normal file
23
mysql-test/r/loaddata_autocom_ndb.result
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
SET SESSION STORAGE_ENGINE = ndbcluster;
|
||||
drop table if exists t1;
|
||||
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
|
||||
start transaction;
|
||||
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
Warnings:
|
||||
Warning 1261 Row 3 doesn't contain data for all columns
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
4
|
||||
truncate table t1;
|
||||
start transaction;
|
||||
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
Warnings:
|
||||
Warning 1261 Row 3 doesn't contain data for all columns
|
||||
rollback;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
4
|
||||
drop table t1;
|
||||
|
|
@ -949,18 +949,24 @@ COUNT(*)
|
|||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
|
||||
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '20050327 invalid'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '20050327 invalid'
|
||||
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 invalid';
|
||||
COUNT(*)
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
|
||||
Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '20050328 invalid'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '20050328 invalid'
|
||||
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid';
|
||||
COUNT(*)
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
|
||||
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '20050327 invalid'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '20050327 invalid'
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
|
|
|
|||
|
|
@ -896,3 +896,48 @@ EXPLAIN SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge idx1,idx2 idx1,idx2 4,4 NULL 4 Using sort_union(idx1,idx2); Using where
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
item char(20) NOT NULL default '',
|
||||
started datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
price decimal(16,3) NOT NULL default '0.000',
|
||||
PRIMARY KEY (item,started)
|
||||
) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES
|
||||
('A1','2005-11-01 08:00:00',1000),
|
||||
('A1','2005-11-15 00:00:00',2000),
|
||||
('A1','2005-12-12 08:00:00',3000),
|
||||
('A2','2005-12-01 08:00:00',1000);
|
||||
EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref PRIMARY PRIMARY 20 const 2 Using where
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
|
||||
Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
|
||||
SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
|
||||
item started price
|
||||
A1 2005-11-01 08:00:00 1000.000
|
||||
A1 2005-11-15 00:00:00 2000.000
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
|
||||
Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
|
||||
SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00';
|
||||
item started price
|
||||
A1 2005-11-01 08:00:00 1000.000
|
||||
A1 2005-11-15 00:00:00 2000.000
|
||||
DROP INDEX `PRIMARY` ON t1;
|
||||
EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
|
||||
SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
|
||||
item started price
|
||||
A1 2005-11-01 08:00:00 1000.000
|
||||
A1 2005-11-15 00:00:00 2000.000
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
|
||||
SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00';
|
||||
item started price
|
||||
A1 2005-11-01 08:00:00 1000.000
|
||||
A1 2005-11-15 00:00:00 2000.000
|
||||
DROP TABLE t1;
|
||||
|
|
|
|||
103
mysql-test/r/rpl_ndb_innodb_trans.result
Normal file
103
mysql-test/r/rpl_ndb_innodb_trans.result
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
create table t1 (a int, unique(a)) engine=ndbcluster;
|
||||
create table t2 (a int, unique(a)) engine=innodb;
|
||||
begin;
|
||||
insert into t1 values(1);
|
||||
insert into t2 values(1);
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
begin;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
|
||||
Warnings:
|
||||
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
|
||||
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
Warnings:
|
||||
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
|
||||
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
|
||||
rollback;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
begin;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
|
||||
Warnings:
|
||||
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
|
||||
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
Warnings:
|
||||
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
|
||||
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
|
||||
rollback;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
begin;
|
||||
insert into t2 values(3),(4);
|
||||
insert into t1 values(3),(4);
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
|
||||
Warnings:
|
||||
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
|
||||
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
Warnings:
|
||||
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
|
||||
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
|
||||
rollback;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
4
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
4
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
drop table t1,t2;
|
||||
Loading…
Add table
Add a link
Reference in a new issue