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
a26e966d
Commit
a26e966d
authored
Feb 22, 2005
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manual merge 4.1->5.0
parent
2c1e12c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
10 deletions
+30
-10
sql/sql_error.cc
sql/sql_error.cc
+30
-10
No files found.
sql/sql_error.cc
View file @
a26e966d
...
...
@@ -43,6 +43,7 @@ This file contains the implementation of error and warnings related
***********************************************************************/
#include "mysql_priv.h"
#include "sp_rcontext.h"
/*
Store a new message in an error object
...
...
@@ -110,6 +111,25 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
if
(
thd
->
query_id
!=
thd
->
warn_id
)
mysql_reset_errors
(
thd
);
thd
->
got_warning
=
1
;
if
(
thd
->
spcont
&&
thd
->
spcont
->
find_handler
(
code
,
((
int
)
level
>=
(
int
)
MYSQL_ERROR
::
WARN_LEVEL_WARN
&&
thd
->
really_abort_on_warning
())
?
MYSQL_ERROR
::
WARN_LEVEL_ERROR
:
level
))
{
DBUG_RETURN
(
NULL
);
}
/* Abort if we are using strict mode and we are not using IGNORE */
if
((
int
)
level
>=
(
int
)
MYSQL_ERROR
::
WARN_LEVEL_WARN
&&
thd
->
really_abort_on_warning
())
{
thd
->
killed
=
THD
::
KILL_BAD_DATA
;
my_message
(
code
,
msg
,
MYF
(
0
));
DBUG_RETURN
(
NULL
);
}
if
(
thd
->
warn_list
.
elements
<
thd
->
variables
.
max_error_count
)
{
...
...
@@ -119,8 +139,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
*/
MEM_ROOT
*
old_root
=
thd
->
mem_root
;
thd
->
mem_root
=
&
thd
->
warn_root
;
err
=
new
MYSQL_ERROR
(
thd
,
code
,
level
,
msg
);
if
(
err
)
if
((
err
=
new
MYSQL_ERROR
(
thd
,
code
,
level
,
msg
)))
thd
->
warn_list
.
push_back
(
err
);
thd
->
mem_root
=
old_root
;
}
...
...
@@ -168,14 +187,14 @@ void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
Takes into account the current LIMIT
RETURN VALUES
0
ok
1
Error sending data to client
FALSE
ok
TRUE
Error sending data to client
*/
static
const
char
*
warning_level_names
[]
=
{
"Note"
,
"Warning"
,
"Error"
,
"?"
};
static
int
warning_level_length
[]
=
{
4
,
7
,
5
,
1
};
my_
bool
mysqld_show_warnings
(
THD
*
thd
,
ulong
levels_to_show
)
bool
mysqld_show_warnings
(
THD
*
thd
,
ulong
levels_to_show
)
{
List
<
Item
>
field_list
;
DBUG_ENTER
(
"mysqld_show_warnings"
);
...
...
@@ -184,8 +203,9 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
field_list
.
push_back
(
new
Item_return_int
(
"Code"
,
4
,
MYSQL_TYPE_LONG
));
field_list
.
push_back
(
new
Item_empty_string
(
"Message"
,
MYSQL_ERRMSG_SIZE
));
if
(
thd
->
protocol
->
send_fields
(
&
field_list
,
1
))
DBUG_RETURN
(
1
);
if
(
thd
->
protocol
->
send_fields
(
&
field_list
,
Protocol
::
SEND_NUM_ROWS
|
Protocol
::
SEND_EOF
))
DBUG_RETURN
(
TRUE
);
MYSQL_ERROR
*
err
;
SELECT_LEX
*
sel
=
&
thd
->
lex
->
select_lex
;
...
...
@@ -209,10 +229,10 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
protocol
->
store
((
uint32
)
err
->
code
);
protocol
->
store
(
err
->
msg
,
strlen
(
err
->
msg
),
system_charset_info
);
if
(
protocol
->
write
())
DBUG_RETURN
(
1
);
DBUG_RETURN
(
TRUE
);
if
(
!--
limit
)
break
;
}
send_eof
(
thd
);
DBUG_RETURN
(
0
);
send_eof
(
thd
);
DBUG_RETURN
(
FALSE
);
}
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