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
07f797a9
Commit
07f797a9
authored
Dec 04, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return a warning for DROP DATABASE/TABLE IF EXISTS <non_existing_db/table(s)>
parent
265bf238
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
5 deletions
+38
-5
sql/mysql_priv.h
sql/mysql_priv.h
+2
-1
sql/sql_db.cc
sql/sql_db.cc
+6
-2
sql/sql_error.cc
sql/sql_error.cc
+26
-0
sql/sql_table.cc
sql/sql_table.cc
+4
-2
No files found.
sql/mysql_priv.h
View file @
07f797a9
...
...
@@ -321,7 +321,6 @@ void free_items(Item *item);
bool
alloc_query
(
THD
*
thd
,
char
*
packet
,
ulong
packet_length
);
void
mysql_init_select
(
LEX
*
lex
);
void
mysql_init_query
(
THD
*
thd
);
void
mysql_reset_errors
(
THD
*
thd
);
bool
mysql_new_select
(
LEX
*
lex
,
bool
move_down
);
void
create_select_for_variable
(
const
char
*
var_name
);
void
mysql_init_multi_delete
(
LEX
*
lex
);
...
...
@@ -526,6 +525,8 @@ int check_insert_fields(THD *thd,TABLE *table,List<Item> &fields,
/* sql_error.cc */
void
push_warning
(
THD
*
thd
,
MYSQL_ERROR
::
enum_warning_level
level
,
uint
code
,
const
char
*
msg
);
void
store_warning
(
THD
*
thd
,
uint
errcode
,
...);
void
mysql_reset_errors
(
THD
*
thd
);
my_bool
mysqld_show_warnings
(
THD
*
thd
,
ulong
levels_to_show
);
/* sql_handler.cc */
...
...
sql/sql_db.cc
View file @
07f797a9
...
...
@@ -331,8 +331,12 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
error
=
-
1
;
my_error
(
ER_DB_DROP_EXISTS
,
MYF
(
0
),
db
);
}
else
if
(
!
silent
)
send_ok
(
thd
,
0
);
else
{
store_warning
(
thd
,
ER_DB_DROP_EXISTS
,
db
);
if
(
!
silent
)
send_ok
(
thd
,
0
);
}
goto
exit
;
}
pthread_mutex_lock
(
&
LOCK_open
);
...
...
sql/sql_error.cc
View file @
07f797a9
...
...
@@ -104,6 +104,32 @@ void push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, uint code,
thd
->
total_warn_count
++
;
}
/*
Store warning to the list
*/
void
store_warning
(
THD
*
thd
,
uint
errcode
,
...)
{
va_list
args
;
const
char
*
format
;
char
warning
[
ERRMSGSIZE
+
20
];
DBUG_ENTER
(
"store_warning"
);
DBUG_PRINT
(
"enter"
,(
"warning: %u"
,
errcode
));
va_start
(
args
,
errcode
);
if
(
errcode
)
format
=
ER
(
errcode
);
else
{
format
=
va_arg
(
args
,
char
*
);
errcode
=
ER_UNKNOWN_ERROR
;
}
(
void
)
vsprintf
(
warning
,
format
,
args
);
va_end
(
args
);
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
errcode
,
warning
);
DBUG_VOID_RETURN
;
}
/*
Send all notes, errors or warnings to the client in a result set
...
...
sql/sql_table.cc
View file @
07f797a9
...
...
@@ -163,8 +163,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
if
(
access
(
path
,
F_OK
))
{
if
(
!
if_exists
)
error
=
1
;
if
(
if_exists
)
store_warning
(
thd
,
ER_BAD_TABLE_ERROR
,
table
->
real_name
);
else
error
=
1
;
}
else
{
...
...
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