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
c04fd7b1
Commit
c04fd7b1
authored
Jan 17, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switched to new syntax (TYPE->ENGINE)
check of memory allocation operation was added
parent
4adf62ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
mysql-test/r/subselect_innodb.result
mysql-test/r/subselect_innodb.result
+2
-2
mysql-test/t/subselect_innodb.test
mysql-test/t/subselect_innodb.test
+2
-2
sql/sql_select.cc
sql/sql_select.cc
+2
-1
No files found.
mysql-test/r/subselect_innodb.result
View file @
c04fd7b1
...
@@ -69,7 +69,7 @@ b int(11) default NULL,
...
@@ -69,7 +69,7 @@ b int(11) default NULL,
c char(3) default NULL,
c char(3) default NULL,
PRIMARY KEY (id),
PRIMARY KEY (id),
KEY t2i1 (b)
KEY t2i1 (b)
)
TYP
E=innodb DEFAULT CHARSET=latin1;
)
ENGIN
E=innodb DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (0,0,'GPL'),(1,0,'GPL'),(2,1,'GPL'),(3,2,'GPL');
INSERT INTO t1 VALUES (0,0,'GPL'),(1,0,'GPL'),(2,1,'GPL'),(3,2,'GPL');
CREATE TABLE t2 (
CREATE TABLE t2 (
id int(11) NOT NULL default '0',
id int(11) NOT NULL default '0',
...
@@ -77,7 +77,7 @@ b int(11) default NULL,
...
@@ -77,7 +77,7 @@ b int(11) default NULL,
c char(3) default NULL,
c char(3) default NULL,
PRIMARY KEY (id),
PRIMARY KEY (id),
KEY t2i (b)
KEY t2i (b)
)
TYP
E=innodb DEFAULT CHARSET=latin1;
)
ENGIN
E=innodb DEFAULT CHARSET=latin1;
INSERT INTO t2 VALUES (0,0,'GPL'),(1,0,'GPL'),(2,1,'GPL'),(3,2,'GPL');
INSERT INTO t2 VALUES (0,0,'GPL'),(1,0,'GPL'),(2,1,'GPL'),(3,2,'GPL');
select (select max(id) from t2 where b=1 group by b) as x,b from t1 where b=1;
select (select max(id) from t2 where b=1 group by b) as x,b from t1 where b=1;
x b
x b
...
...
mysql-test/t/subselect_innodb.test
View file @
c04fd7b1
...
@@ -78,7 +78,7 @@ CREATE TABLE t1 (
...
@@ -78,7 +78,7 @@ CREATE TABLE t1 (
c
char
(
3
)
default
NULL
,
c
char
(
3
)
default
NULL
,
PRIMARY
KEY
(
id
),
PRIMARY
KEY
(
id
),
KEY
t2i1
(
b
)
KEY
t2i1
(
b
)
)
TYP
E
=
innodb
DEFAULT
CHARSET
=
latin1
;
)
ENGIN
E
=
innodb
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
t1
VALUES
(
0
,
0
,
'GPL'
),(
1
,
0
,
'GPL'
),(
2
,
1
,
'GPL'
),(
3
,
2
,
'GPL'
);
INSERT
INTO
t1
VALUES
(
0
,
0
,
'GPL'
),(
1
,
0
,
'GPL'
),(
2
,
1
,
'GPL'
),(
3
,
2
,
'GPL'
);
CREATE
TABLE
t2
(
CREATE
TABLE
t2
(
id
int
(
11
)
NOT
NULL
default
'0'
,
id
int
(
11
)
NOT
NULL
default
'0'
,
...
@@ -86,7 +86,7 @@ CREATE TABLE t2 (
...
@@ -86,7 +86,7 @@ CREATE TABLE t2 (
c
char
(
3
)
default
NULL
,
c
char
(
3
)
default
NULL
,
PRIMARY
KEY
(
id
),
PRIMARY
KEY
(
id
),
KEY
t2i
(
b
)
KEY
t2i
(
b
)
)
TYP
E
=
innodb
DEFAULT
CHARSET
=
latin1
;
)
ENGIN
E
=
innodb
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
t2
VALUES
(
0
,
0
,
'GPL'
),(
1
,
0
,
'GPL'
),(
2
,
1
,
'GPL'
),(
3
,
2
,
'GPL'
);
INSERT
INTO
t2
VALUES
(
0
,
0
,
'GPL'
),(
1
,
0
,
'GPL'
),(
2
,
1
,
'GPL'
),(
3
,
2
,
'GPL'
);
select
(
select
max
(
id
)
from
t2
where
b
=
1
group
by
b
)
as
x
,
b
from
t1
where
b
=
1
;
select
(
select
max
(
id
)
from
t2
where
b
=
1
group
by
b
)
as
x
,
b
from
t1
where
b
=
1
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
sql/sql_select.cc
View file @
c04fd7b1
...
@@ -1586,7 +1586,8 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
...
@@ -1586,7 +1586,8 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
}
}
else
else
{
{
join
=
new
JOIN
(
thd
,
fields
,
select_options
,
result
);
if
(
!
(
join
=
new
JOIN
(
thd
,
fields
,
select_options
,
result
)))
DBUG_RETURN
(
-
1
);
thd
->
proc_info
=
"init"
;
thd
->
proc_info
=
"init"
;
thd
->
used_tables
=
0
;
// Updated by setup_fields
thd
->
used_tables
=
0
;
// Updated by setup_fields
if
(
join
->
prepare
(
rref_pointer_array
,
tables
,
wild_num
,
if
(
join
->
prepare
(
rref_pointer_array
,
tables
,
wild_num
,
...
...
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