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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
9c8871cf
Commit
9c8871cf
authored
Oct 12, 2002
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Plain Diff
Merge sinisa@work.mysql.com:/home/bk/mysql-4.1
into sinisa.nasamreza.org:/mnt/work/mysql-4.1
parents
4df2e3bf
f6d9e96f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
6 deletions
+20
-6
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+6
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+6
-0
sql/item_subselect.cc
sql/item_subselect.cc
+8
-6
No files found.
mysql-test/r/subselect.result
View file @
9c8871cf
...
@@ -159,6 +159,12 @@ UNIQUE KEY `email` (`email`)
...
@@ -159,6 +159,12 @@ UNIQUE KEY `email` (`email`)
INSERT INTO inscrit (pseudo,email) VALUES ('joce','test');
INSERT INTO inscrit (pseudo,email) VALUES ('joce','test');
INSERT INTO inscrit (pseudo,email) VALUES ('joce1','test1');
INSERT INTO inscrit (pseudo,email) VALUES ('joce1','test1');
INSERT INTO inscrit (pseudo,email) VALUES ('2joce1','2test1');
INSERT INTO inscrit (pseudo,email) VALUES ('2joce1','2test1');
SELECT pseudo FROM inscrit WHERE pseudo=(SELECT pseudo,email FROM
inscrit WHERE pseudo='joce');
Subselect returns more than 1 field
SELECT pseudo FROM inscrit WHERE pseudo=(SELECT * FROM inscrit WHERE
pseudo='joce');
Subselect returns more than 1 field
SELECT pseudo FROM inscrit WHERE pseudo=(SELECT pseudo FROM inscrit WHERE pseudo='joce');
SELECT pseudo FROM inscrit WHERE pseudo=(SELECT pseudo FROM inscrit WHERE pseudo='joce');
pseudo
pseudo
joce
joce
...
...
mysql-test/t/subselect.test
View file @
9c8871cf
...
@@ -82,6 +82,12 @@ CREATE TABLE `inscrit` (
...
@@ -82,6 +82,12 @@ CREATE TABLE `inscrit` (
INSERT
INTO
inscrit
(
pseudo
,
email
)
VALUES
(
'joce'
,
'test'
);
INSERT
INTO
inscrit
(
pseudo
,
email
)
VALUES
(
'joce'
,
'test'
);
INSERT
INTO
inscrit
(
pseudo
,
email
)
VALUES
(
'joce1'
,
'test1'
);
INSERT
INTO
inscrit
(
pseudo
,
email
)
VALUES
(
'joce1'
,
'test1'
);
INSERT
INTO
inscrit
(
pseudo
,
email
)
VALUES
(
'2joce1'
,
'2test1'
);
INSERT
INTO
inscrit
(
pseudo
,
email
)
VALUES
(
'2joce1'
,
'2test1'
);
--
error
1239
SELECT
pseudo
FROM
inscrit
WHERE
pseudo
=
(
SELECT
pseudo
,
email
FROM
inscrit
WHERE
pseudo
=
'joce'
);
--
error
1239
SELECT
pseudo
FROM
inscrit
WHERE
pseudo
=
(
SELECT
*
FROM
inscrit
WHERE
pseudo
=
'joce'
);
SELECT
pseudo
FROM
inscrit
WHERE
pseudo
=
(
SELECT
pseudo
FROM
inscrit
WHERE
pseudo
=
'joce'
);
SELECT
pseudo
FROM
inscrit
WHERE
pseudo
=
(
SELECT
pseudo
FROM
inscrit
WHERE
pseudo
=
'joce'
);
--
error
1240
--
error
1240
SELECT
pseudo
FROM
inscrit
WHERE
pseudo
=
(
SELECT
pseudo
FROM
inscrit
WHERE
pseudo
LIKE
'%joce%'
);
SELECT
pseudo
FROM
inscrit
WHERE
pseudo
=
(
SELECT
pseudo
FROM
inscrit
WHERE
pseudo
LIKE
'%joce%'
);
...
...
sql/item_subselect.cc
View file @
9c8871cf
...
@@ -81,15 +81,17 @@ void Item_subselect::make_field (Send_field *tmp_field)
...
@@ -81,15 +81,17 @@ void Item_subselect::make_field (Send_field *tmp_field)
bool
Item_subselect
::
fix_fields
(
THD
*
thd
,
TABLE_LIST
*
tables
,
Item
**
ref
)
bool
Item_subselect
::
fix_fields
(
THD
*
thd
,
TABLE_LIST
*
tables
,
Item
**
ref
)
{
{
int
res
=
engine
->
prepare
();
if
(
!
res
)
{
// Is it one field subselect?
// Is it one field subselect?
if
(
engine
->
cols
()
>
max_columns
)
if
(
engine
->
cols
()
>
max_columns
)
{
{
my_message
(
ER_SUBSELECT_NO_1_COL
,
ER
(
ER_SUBSELECT_NO_1_COL
),
MYF
(
0
));
my_message
(
ER_SUBSELECT_NO_1_COL
,
ER
(
ER_SUBSELECT_NO_1_COL
),
MYF
(
0
));
return
1
;
return
1
;
}
}
int
res
=
engine
->
prepare
();
if
(
!
res
)
fix_length_and_dec
();
fix_length_and_dec
();
}
return
res
;
return
res
;
}
}
...
...
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