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
cfc99ce4
Commit
cfc99ce4
authored
Jan 04, 2003
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed SET with subselect
parent
7c827899
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+7
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+5
-0
sql/sql_parse.cc
sql/sql_parse.cc
+8
-1
No files found.
mysql-test/r/subselect.result
View file @
cfc99ce4
...
...
@@ -848,6 +848,13 @@ do @a:=(SELECT a from t);
select @a;
@a
1
set @a:=2;
set @a:=(SELECT a from t);
select @a;
@a
1
drop table t;
do (SELECT a from t);
Table 'test.t' doesn't exist
set @a:=(SELECT a from t);
Table 'test.t' doesn't exist
mysql-test/t/subselect.test
View file @
cfc99ce4
...
...
@@ -468,6 +468,11 @@ create table t (a int);
insert
into
t
values
(
1
);
do
@
a
:=
(
SELECT
a
from
t
);
select
@
a
;
set
@
a
:=
2
;
set
@
a
:=
(
SELECT
a
from
t
);
select
@
a
;
drop
table
t
;
--
error
1146
do
(
SELECT
a
from
t
);
--
error
1146
set
@
a
:=
(
SELECT
a
from
t
);
\ No newline at end of file
sql/sql_parse.cc
View file @
cfc99ce4
...
...
@@ -2470,9 +2470,16 @@ mysql_execute_command(THD *thd)
break
;
}
case
SQLCOM_SET_OPTION
:
if
(
!
(
res
=
sql_set_variables
(
thd
,
&
lex
->
var_list
)))
if
(
tables
&&
((
res
=
check_table_access
(
thd
,
SELECT_ACL
,
tables
))
||
(
res
=
open_and_lock_tables
(
thd
,
tables
))))
break
;
fix_tables_pointers
(
lex
->
all_selects_list
);
if
(
!
(
res
=
sql_set_variables
(
thd
,
&
lex
->
var_list
)))
send_ok
(
thd
);
if
(
thd
->
net
.
report_error
)
res
=
-
1
;
break
;
case
SQLCOM_UNLOCK_TABLES
:
unlock_locked_tables
(
thd
);
if
(
thd
->
options
&
OPTION_TABLE_LOCK
)
...
...
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