mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
This commit is contained in:
@@ -115,3 +115,29 @@ select * from t1 procedure analyse (1,1);
|
||||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||
test.t1.d 100000 100000 6 6 0 0 100000 0 MEDIUMINT(6) UNSIGNED NOT NULL
|
||||
drop table t1;
|
||||
create table t1 (product varchar(32), country_id int not null, year int,
|
||||
profit int);
|
||||
insert into t1 values ( 'Computer', 2,2000, 1200),
|
||||
( 'TV', 1, 1999, 150),
|
||||
( 'Calculator', 1, 1999,50),
|
||||
( 'Computer', 1, 1999,1500),
|
||||
( 'Computer', 1, 2000,1500),
|
||||
( 'TV', 1, 2000, 150),
|
||||
( 'TV', 2, 2000, 100),
|
||||
( 'TV', 2, 2000, 100),
|
||||
( 'Calculator', 1, 2000,75),
|
||||
( 'Calculator', 2, 2000,75),
|
||||
( 'TV', 1, 1999, 100),
|
||||
( 'Computer', 1, 1999,1200),
|
||||
( 'Computer', 2, 2000,1500),
|
||||
( 'Calculator', 2, 2000,75),
|
||||
( 'Phone', 3, 2003,10)
|
||||
;
|
||||
create table t2 (country_id int primary key, country char(20) not null);
|
||||
insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland');
|
||||
select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse();
|
||||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||
test.t1.product Computer TV 2 8 0 0 4.2500 NULL ENUM('Computer','Phone','TV') NOT NULL
|
||||
sum(profit) 10 6900 2 4 0 0 1946 2868 ENUM('10','275','600','6900') NOT NULL
|
||||
avg(profit) 10.0000 1380.0000 7 9 0 0 394.6875 570.2003 ENUM('10.0000','68.7500','120.0000','1380.0000') NOT NULL
|
||||
drop table t1,t2;
|
||||
|
@@ -641,3 +641,16 @@ create table if not exists t1 (a int);
|
||||
Warnings:
|
||||
Note 1050 Table 't1' already exists
|
||||
drop table t1;
|
||||
create table t1 (
|
||||
a varchar(112) charset utf8 collate utf8_bin not null,
|
||||
primary key (a)
|
||||
) select 'test' as a ;
|
||||
Warnings:
|
||||
Warning 1364 Field 'a' doesn't have a default value
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(112) character set utf8 collate utf8_bin NOT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
|
@@ -170,6 +170,12 @@ insert into t1 values (1);
|
||||
select rand(i) from t1;
|
||||
ERROR HY000: Incorrect arguments to RAND
|
||||
drop table t1;
|
||||
create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8;
|
||||
insert into t1 values ('http://www.foo.com/', now());
|
||||
select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0));
|
||||
a
|
||||
http://www.foo.com/
|
||||
drop table t1;
|
||||
set sql_mode='traditional';
|
||||
select ln(-1);
|
||||
ln(-1)
|
||||
|
@@ -176,7 +176,7 @@ Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`round(15.4,-1)` decimal(3,0) unsigned NOT NULL default '0',
|
||||
`truncate(-5678.123451,-3)` decimal(4,0) NOT NULL default '0',
|
||||
`abs(-1.1)` decimal(2,1) NOT NULL default '0.0',
|
||||
`abs(-1.1)` decimal(2,1) default NULL,
|
||||
`-(-1.1)` decimal(2,1) NOT NULL default '0.0'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
|
@@ -65,5 +65,30 @@ insert into t1 values (100000);
|
||||
select * from t1 procedure analyse (1,1);
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #14138 ROLLUP and PROCEDURE ANALYSE() hang server
|
||||
#
|
||||
create table t1 (product varchar(32), country_id int not null, year int,
|
||||
profit int);
|
||||
insert into t1 values ( 'Computer', 2,2000, 1200),
|
||||
( 'TV', 1, 1999, 150),
|
||||
( 'Calculator', 1, 1999,50),
|
||||
( 'Computer', 1, 1999,1500),
|
||||
( 'Computer', 1, 2000,1500),
|
||||
( 'TV', 1, 2000, 150),
|
||||
( 'TV', 2, 2000, 100),
|
||||
( 'TV', 2, 2000, 100),
|
||||
( 'Calculator', 1, 2000,75),
|
||||
( 'Calculator', 2, 2000,75),
|
||||
( 'TV', 1, 1999, 100),
|
||||
( 'Computer', 1, 1999,1200),
|
||||
( 'Computer', 2, 2000,1500),
|
||||
( 'Calculator', 2, 2000,75),
|
||||
( 'Phone', 3, 2003,10)
|
||||
;
|
||||
create table t2 (country_id int primary key, country char(20) not null);
|
||||
insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland');
|
||||
select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse();
|
||||
drop table t1,t2;
|
||||
# End of 4.1 tests
|
||||
|
||||
|
@@ -545,4 +545,13 @@ create table t1 (a int);
|
||||
create table if not exists t1 (a int);
|
||||
drop table t1;
|
||||
|
||||
# BUG#14139
|
||||
create table t1 (
|
||||
a varchar(112) charset utf8 collate utf8_bin not null,
|
||||
primary key (a)
|
||||
) select 'test' as a ;
|
||||
--warning 1364
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
@@ -15,5 +15,4 @@ rpl_relayrotate : Unstable test case, bug#12429
|
||||
rpl_until : Unstable test case, bug#12429
|
||||
rpl_deadlock : Unstable test case, bug#12429
|
||||
kill : Unstable test case, bug#9712
|
||||
federated : Broken test case, bug#14272
|
||||
archive_gis : The test fails on 32bit Linux
|
||||
|
@@ -116,6 +116,16 @@ insert into t1 values (1);
|
||||
select rand(i) from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #14009: use of abs() on null value causes problems with filesort
|
||||
#
|
||||
# InnoDB is required to reproduce the fault, but it is okay if we default to
|
||||
# MyISAM when testing.
|
||||
create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8;
|
||||
insert into t1 values ('http://www.foo.com/', now());
|
||||
select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0));
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
|
Reference in New Issue
Block a user