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
f8e6e74c
Commit
f8e6e74c
authored
Aug 15, 2001
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix problem with not getting 'No Database Selected' error
parent
68c2afa8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
+18
-15
Docs/manual.texi
Docs/manual.texi
+4
-0
sql/sql_base.cc
sql/sql_base.cc
+8
-9
sql/sql_parse.cc
sql/sql_parse.cc
+6
-6
No files found.
Docs/manual.texi
View file @
f8e6e74c
...
...
@@ -45712,6 +45712,10 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@item
Cleaned up global lock handling for @code{FLUSH TABLES WITH READ LOCK}
@item
Fixed problem with @code{DATETIME = constant} in @code{WHERE} optimization.
@item
Speed up all internal list handling.
@item
Added support for @code{UNION}.
sql/sql_base.cc
View file @
f8e6e74c
...
...
@@ -1323,7 +1323,7 @@ int open_tables(THD *thd,TABLE_LIST *start)
{
if
(
!
tables
->
table
&&
!
(
tables
->
table
=
open_table
(
thd
,
tables
->
db
?
tables
->
db
:
thd
->
db
,
tables
->
db
,
tables
->
real_name
,
tables
->
name
,
&
refresh
)))
{
...
...
@@ -1380,7 +1380,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type)
DBUG_ENTER
(
"open_ltable"
);
thd
->
proc_info
=
"Opening table"
;
while
(
!
(
table
=
open_table
(
thd
,
table_list
->
db
?
table_list
->
db
:
thd
->
db
,
while
(
!
(
table
=
open_table
(
thd
,
table_list
->
db
,
table_list
->
real_name
,
table_list
->
name
,
&
refresh
))
&&
refresh
)
;
if
(
table
)
...
...
@@ -1612,9 +1612,7 @@ find_field_in_tables(THD *thd,Item_field *item,TABLE_LIST *tables)
for
(;
tables
;
tables
=
tables
->
next
)
{
if
(
!
strcmp
(
tables
->
name
,
table_name
)
&&
(
!
db
||
(
tables
->
db
&&
!
strcmp
(
db
,
tables
->
db
))
||
(
!
tables
->
db
&&
!
strcmp
(
db
,
thd
->
db
))))
(
!
db
||
!
strcmp
(
db
,
tables
->
db
)))
{
found_table
=
1
;
Field
*
find
=
find_field_in_table
(
thd
,
tables
->
table
,
name
,
length
,
...
...
@@ -1854,8 +1852,7 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name,
check_grant_all_columns
(
thd
,
SELECT_ACL
,
table
)
)
DBUG_RETURN
(
-
1
);
if
(
!
table_name
||
(
!
strcmp
(
table_name
,
tables
->
name
)
&&
(
!
db_name
||
!
tables
->
db
||
!
strcmp
(
tables
->
db
,
db_name
))))
(
!
db_name
||
!
strcmp
(
tables
->
db
,
db_name
))))
{
Field
**
ptr
=
table
->
field
,
*
field
;
thd
->
used_tables
|=
table
->
map
;
...
...
@@ -2079,7 +2076,8 @@ int mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys)
create_info
.
db_type
=
DB_TYPE_DEFAULT
;
DBUG_RETURN
(
mysql_alter_table
(
thd
,
table_list
->
db
,
table_list
->
real_name
,
&
create_info
,
table_list
,
fields
,
keys
,
drop
,
alter
,
(
ORDER
*
)
0
,
FALSE
,
DUP_ERROR
));
fields
,
keys
,
drop
,
alter
,
(
ORDER
*
)
0
,
FALSE
,
DUP_ERROR
));
}
...
...
@@ -2094,7 +2092,8 @@ int mysql_drop_index(THD *thd, TABLE_LIST *table_list, List<Alter_drop> &drop)
create_info
.
db_type
=
DB_TYPE_DEFAULT
;
DBUG_RETURN
(
mysql_alter_table
(
thd
,
table_list
->
db
,
table_list
->
real_name
,
&
create_info
,
table_list
,
fields
,
keys
,
drop
,
alter
,
(
ORDER
*
)
0
,
FALSE
,
DUP_ERROR
));
fields
,
keys
,
drop
,
alter
,
(
ORDER
*
)
0
,
FALSE
,
DUP_ERROR
));
}
/*****************************************************************************
...
...
sql/sql_parse.cc
View file @
f8e6e74c
...
...
@@ -1810,16 +1810,14 @@ mysql_execute_command(void)
DBUG_VOID_RETURN
;
#else
{
char
*
db
=
tables
->
db
?
tables
->
db
:
thd
->
db
;
if
(
!
db
)
char
*
db
=
tables
->
db
;
if
(
!
*
db
)
{
send_error
(
&
thd
->
net
,
ER_NO_DB_ERROR
);
/* purecov: inspected */
goto
error
;
/* purecov: inspected */
}
remove_escape
(
db
);
// Fix escaped '_'
remove_escape
(
tables
->
name
);
if
(
!
tables
->
db
)
tables
->
db
=
thd
->
db
;
if
(
check_access
(
thd
,
SELECT_ACL
|
EXTRA_ACL
,
db
,
&
thd
->
col_access
))
goto
error
;
/* purecov: inspected */
tables
->
grant
.
privilege
=
thd
->
col_access
;
...
...
@@ -1837,7 +1835,7 @@ mysql_execute_command(void)
DBUG_VOID_RETURN
;
#else
{
char
*
db
=
tables
->
db
?
tables
->
db
:
thd
->
db
;
char
*
db
=
tables
->
db
;
if
(
!
db
)
{
send_error
(
&
thd
->
net
,
ER_NO_DB_ERROR
);
/* purecov: inspected */
...
...
@@ -2178,7 +2176,7 @@ check_access(THD *thd,uint want_access,const char *db, uint *save_priv,
else
save_priv
=
&
dummy
;
if
(
!
db
&&
!
thd
->
db
&&
!
dont_check_global_grants
)
if
(
!
db
[
0
]
&&
!
thd
->
db
&&
!
dont_check_global_grants
)
{
send_error
(
&
thd
->
net
,
ER_NO_DB_ERROR
);
/* purecov: tested */
return
TRUE
;
/* purecov: tested */
...
...
@@ -2725,6 +2723,8 @@ add_proc_to_list(Item *item)
static
void
remove_escape
(
char
*
name
)
{
if
(
!*
name
)
// For empty DB names
return
;
char
*
to
;
#ifdef USE_MB
char
*
strend
=
name
+
(
uint
)
strlen
(
name
);
...
...
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