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
6f607d3a
Commit
6f607d3a
authored
Sep 04, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug 1176
parent
d89b2a9f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
mysql-test/r/derived.result
mysql-test/r/derived.result
+8
-0
mysql-test/t/derived.test
mysql-test/t/derived.test
+13
-0
sql/sql_derived.cc
sql/sql_derived.cc
+1
-1
No files found.
mysql-test/r/derived.result
View file @
6f607d3a
...
...
@@ -196,3 +196,11 @@ drop table t1,t2;
SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1;
x
1
create table a1 select 1 as a;
select 2 as a from (select * from a1) b;
ERROR 3D000: No Database Selected
use test;
select 2 as a from (select * from a1) b;
a
2
drop table a1;
mysql-test/t/derived.test
View file @
6f607d3a
...
...
@@ -94,3 +94,16 @@ drop table t1,t2;
# derived table reference
#
SELECT
a
.
x
FROM
(
SELECT
1
AS
x
)
AS
a
HAVING
a
.
x
=
1
;
#
# Test for select if database is not selected.
#
# Connect without a database
create
table
a1
select
1
as
a
;
connect
(
con1
,
localhost
,
mysqltest_1
,,
*
NO
-
ONE
*
,
$MASTER_MYPORT
,
master
.
sock
);
connection
con1
;
--
error
1046
select
2
as
a
from
(
select
*
from
a1
)
b
;
use
test
;
select
2
as
a
from
(
select
*
from
a1
)
b
;
drop
table
a1
;
sql/sql_derived.cc
View file @
6f607d3a
...
...
@@ -96,7 +96,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
else
res
=
check_access
(
thd
,
SELECT_ACL
,
any_db
);
if
(
res
)
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
1
);
if
(
!
(
res
=
open_and_lock_tables
(
thd
,
tables
)))
{
...
...
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