Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
3d83d5aa
Commit
3d83d5aa
authored
Jul 17, 2006
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into rurik.mysql.com:/home/igor/mysql-5.0-opt
parents
21469f84
59e7a261
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
103 additions
and
12 deletions
+103
-12
mysql-test/r/mysql.result
mysql-test/r/mysql.result
+4
-4
mysql-test/r/select.result
mysql-test/r/select.result
+4
-3
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+44
-0
mysql-test/t/mysql.test
mysql-test/t/mysql.test
+4
-4
mysql-test/t/select.test
mysql-test/t/select.test
+2
-1
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+40
-0
sql/sql_select.cc
sql/sql_select.cc
+5
-0
No files found.
mysql-test/r/mysql.result
View file @
3d83d5aa
...
@@ -36,19 +36,19 @@ Tables_in_test
...
@@ -36,19 +36,19 @@ Tables_in_test
t1
t1
t2
t2
t3
t3
_
Test delimiter : from command line
Test delimiter : from command line
a
a
1
1
_
Test delimiter :; from command line
Test delimiter :; from command line
a
a
1
1
_
Test 'go' command(vertical output) G
Test 'go' command(vertical output) G
*************************** 1. row ***************************
*************************** 1. row ***************************
a: 1
a: 1
_
Test 'go' command g
Test 'go' command g
a
a
1
1
...
...
mysql-test/r/select.result
View file @
3d83d5aa
...
@@ -3398,8 +3398,9 @@ drop table t1,t2;
...
@@ -3398,8 +3398,9 @@ drop table t1,t2;
SELECT 0.9888889889 * 1.011111411911;
SELECT 0.9888889889 * 1.011111411911;
0.9888889889 * 1.011111411911
0.9888889889 * 1.011111411911
0.9998769417899202067879
0.9998769417899202067879
select 1 as ' a ';
prepare stmt from 'select 1 as " a "';
a
1
Warnings:
Warnings:
Warning 1466 Leading spaces are removed from name ' a '
Warning 1466 Leading spaces are removed from name ' a '
execute stmt;
a
1
mysql-test/r/subselect.result
View file @
3d83d5aa
...
@@ -3239,6 +3239,50 @@ i
...
@@ -3239,6 +3239,50 @@ i
DROP TABLE t1;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t2;
CREATE TABLE t1 (
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',
i1 int(11) NOT NULL default '0',
i2 int(11) NOT NULL default '0',
i2 int(11) NOT NULL default '0',
t datetime NOT NULL default '0000-00-00 00:00:00',
t datetime NOT NULL default '0000-00-00 00:00:00',
...
...
mysql-test/t/mysql.test
View file @
3d83d5aa
...
@@ -20,16 +20,16 @@ insert into t1 values(1);
...
@@ -20,16 +20,16 @@ insert into t1 values(1);
--
disable_query_log
--
disable_query_log
# Test delimiter : supplied on the command line
# 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:"
--
exec
$MYSQL
test
--
delimiter
=
":"
-
e
"select * from t1:"
# Test delimiter :; supplied on the command line
# 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:;"
--
exec
$MYSQL
test
--
delimiter
=
":;"
-
e
"select * from t1:;"
# Test 'go' command (vertical output) \G
# 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"
--
exec
$MYSQL
test
-
e
"select * from t1\G"
# Test 'go' command \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"
--
exec
$MYSQL
test
-
e
"select * from t1\g"
--
enable_query_log
--
enable_query_log
drop
table
t1
;
drop
table
t1
;
...
...
mysql-test/t/select.test
View file @
3d83d5aa
...
@@ -2910,4 +2910,5 @@ SELECT 0.9888889889 * 1.011111411911;
...
@@ -2910,4 +2910,5 @@ SELECT 0.9888889889 * 1.011111411911;
#
#
# Bug #10977: No warning issued if a column name is truncated
# Bug #10977: No warning issued if a column name is truncated
#
#
select
1
as
' a '
;
prepare
stmt
from
'select 1 as " a "'
;
execute
stmt
;
mysql-test/t/subselect.test
View file @
3d83d5aa
...
@@ -2163,6 +2163,46 @@ DROP TABLE t1;
...
@@ -2163,6 +2163,46 @@ DROP TABLE t1;
DROP
TABLE
t2
;
DROP
TABLE
t2
;
#
#
# Bug#20519: subselect with LIMIT M, N
#
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
;
SELECT
*
,
(
SELECT
COUNT
(
*
)
FROM
t2
WHERE
mid
=
t1
.
id
ORDER
BY
date
DESC
LIMIT
1
,
1
)
AS
date_count
FROM
t1
;
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
;
DROP
TABLE
t1
,
t2
;
#
# Bug#20869: subselect with range access by DESC
# Bug#20869: subselect with range access by DESC
#
#
...
...
sql/sql_select.cc
View file @
3d83d5aa
...
@@ -1209,6 +1209,11 @@ int
...
@@ -1209,6 +1209,11 @@ int
JOIN
::
reinit
()
JOIN
::
reinit
()
{
{
DBUG_ENTER
(
"JOIN::reinit"
);
DBUG_ENTER
(
"JOIN::reinit"
);
unit
->
offset_limit_cnt
=
(
ha_rows
)(
select_lex
->
offset_limit
?
select_lex
->
offset_limit
->
val_uint
()
:
ULL
(
0
));
first_record
=
0
;
first_record
=
0
;
if
(
exec_tmp_table1
)
if
(
exec_tmp_table1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment