Commit 8972b0bf authored by unknown's avatar unknown
Browse files

Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt

into  rurik.mysql.com:/home/igor/mysql-5.0-opt


mysql-test/r/subselect.result:
  Manual merge
mysql-test/t/subselect.test:
  Manual merge
parents 30bc19c7 ddde1432
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -36,19 +36,19 @@ Tables_in_test
t1
t2
t3

_
Test delimiter : from command line
a
1

_
Test delimiter :; from command line
a
1

_
Test 'go' command(vertical output) G
*************************** 1. row ***************************
a: 1

_
Test  'go' command g
a
1
+4 −3
Original line number Diff line number Diff line
@@ -3398,8 +3398,9 @@ drop table t1,t2;
SELECT 0.9888889889 * 1.011111411911;
0.9888889889 * 1.011111411911
0.9998769417899202067879
select 1 as ' a ';
a 
1
prepare stmt from 'select 1 as " a "';
Warnings:
Warning	1466	Leading spaces are removed from name ' a '
execute stmt;
a 
1
+44 −0
Original line number Diff line number Diff line
@@ -3239,6 +3239,50 @@ i
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (
id bigint(20) unsigned NOT NULL auto_increment,
name varchar(255) NOT NULL,
PRIMARY KEY  (id)
);
INSERT INTO t1 VALUES
(1, 'Balazs'), (2, 'Joe'), (3, 'Frank');
CREATE TABLE t2 (
id bigint(20) unsigned NOT NULL auto_increment,
mid bigint(20) unsigned NOT NULL,
date date NOT NULL,
PRIMARY KEY  (id)
);
INSERT INTO t2 VALUES 
(1, 1, '2006-03-30'), (2, 2, '2006-04-06'), (3, 3, '2006-04-13'),
(4, 2, '2006-04-20'), (5, 1, '2006-05-01');
SELECT *,
(SELECT date FROM t2 WHERE mid = t1.id
ORDER BY date DESC LIMIT 0, 1) AS date_last,
(SELECT date FROM t2 WHERE mid = t1.id
ORDER BY date DESC LIMIT 3, 1) AS date_next_to_last
FROM t1;
id	name	date_last	date_next_to_last
1	Balazs	2006-05-01	NULL
2	Joe	2006-04-20	NULL
3	Frank	2006-04-13	NULL
SELECT *,
(SELECT COUNT(*) FROM t2 WHERE mid = t1.id
ORDER BY date DESC LIMIT 1, 1) AS date_count
FROM t1;
id	name	date_count
1	Balazs	NULL
2	Joe	NULL
3	Frank	NULL
SELECT *,
(SELECT date FROM t2 WHERE mid = t1.id
ORDER BY date DESC LIMIT 0, 1) AS date_last,
(SELECT date FROM t2 WHERE mid = t1.id
ORDER BY date DESC LIMIT 1, 1) AS date_next_to_last
FROM t1;
id	name	date_last	date_next_to_last
1	Balazs	2006-05-01	2006-03-30
2	Joe	2006-04-20	2006-04-06
3	Frank	2006-04-13	NULL
DROP TABLE t1,t2;
i1 int(11) NOT NULL default '0',
i2 int(11) NOT NULL default '0',
t datetime NOT NULL default '0000-00-00 00:00:00',
+4 −4
Original line number Diff line number Diff line
@@ -20,16 +20,16 @@ insert into t1 values(1);

--disable_query_log
# Test delimiter : supplied on the command line
select "Test delimiter : from command line" as " ";
select "Test delimiter : from command line" as "_";
--exec $MYSQL test --delimiter=":" -e "select * from t1:"
# Test delimiter :; supplied on the command line
select "Test delimiter :; from command line" as " ";
select "Test delimiter :; from command line" as "_";
--exec $MYSQL test --delimiter=":;" -e "select * from t1:;"
# Test 'go' command (vertical output) \G
select "Test 'go' command(vertical output) \G" as " ";
select "Test 'go' command(vertical output) \G" as "_";
--exec $MYSQL test -e "select * from t1\G"
# Test 'go' command \g
select "Test  'go' command \g" as " ";
select "Test  'go' command \g" as "_";
--exec $MYSQL test -e "select * from t1\g"
--enable_query_log
drop table t1;
+2 −1
Original line number Diff line number Diff line
@@ -2910,4 +2910,5 @@ SELECT 0.9888889889 * 1.011111411911;
#
# Bug #10977: No warning issued if a column name is truncated
#
select 1 as ' a ';
prepare stmt from 'select 1 as " a "';
execute stmt;
Loading