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
c60e6763
Commit
c60e6763
authored
Feb 22, 2005
by
lars@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manual merge 4.1->5.0
parent
7271a601
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 @
c60e6763
...
@@ -43,6 +43,7 @@ This file contains the implementation of error and warnings related
...
@@ -43,6 +43,7 @@ This file contains the implementation of error and warnings related
***********************************************************************/
***********************************************************************/
#include "mysql_priv.h"
#include "mysql_priv.h"
#include "sp_rcontext.h"
/*
/*
Store a new message in an error object
Store a new message in an error object
...
@@ -110,6 +111,25 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
...
@@ -110,6 +111,25 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
if
(
thd
->
query_id
!=
thd
->
warn_id
)
if
(
thd
->
query_id
!=
thd
->
warn_id
)
mysql_reset_errors
(
thd
);
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
)
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,
...
@@ -119,8 +139,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
*/
*/
MEM_ROOT
*
old_root
=
thd
->
mem_root
;
MEM_ROOT
*
old_root
=
thd
->
mem_root
;
thd
->
mem_root
=
&
thd
->
warn_root
;
thd
->
mem_root
=
&
thd
->
warn_root
;
err
=
new
MYSQL_ERROR
(
thd
,
code
,
level
,
msg
);
if
((
err
=
new
MYSQL_ERROR
(
thd
,
code
,
level
,
msg
)))
if
(
err
)
thd
->
warn_list
.
push_back
(
err
);
thd
->
warn_list
.
push_back
(
err
);
thd
->
mem_root
=
old_root
;
thd
->
mem_root
=
old_root
;
}
}
...
@@ -168,14 +187,14 @@ void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
...
@@ -168,14 +187,14 @@ void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
Takes into account the current LIMIT
Takes into account the current LIMIT
RETURN VALUES
RETURN VALUES
0
ok
FALSE
ok
1
Error sending data to client
TRUE
Error sending data to client
*/
*/
static
const
char
*
warning_level_names
[]
=
{
"Note"
,
"Warning"
,
"Error"
,
"?"
};
static
const
char
*
warning_level_names
[]
=
{
"Note"
,
"Warning"
,
"Error"
,
"?"
};
static
int
warning_level_length
[]
=
{
4
,
7
,
5
,
1
};
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
;
List
<
Item
>
field_list
;
DBUG_ENTER
(
"mysqld_show_warnings"
);
DBUG_ENTER
(
"mysqld_show_warnings"
);
...
@@ -184,8 +203,9 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
...
@@ -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_return_int
(
"Code"
,
4
,
MYSQL_TYPE_LONG
));
field_list
.
push_back
(
new
Item_empty_string
(
"Message"
,
MYSQL_ERRMSG_SIZE
));
field_list
.
push_back
(
new
Item_empty_string
(
"Message"
,
MYSQL_ERRMSG_SIZE
));
if
(
thd
->
protocol
->
send_fields
(
&
field_list
,
1
))
if
(
thd
->
protocol
->
send_fields
(
&
field_list
,
DBUG_RETURN
(
1
);
Protocol
::
SEND_NUM_ROWS
|
Protocol
::
SEND_EOF
))
DBUG_RETURN
(
TRUE
);
MYSQL_ERROR
*
err
;
MYSQL_ERROR
*
err
;
SELECT_LEX
*
sel
=
&
thd
->
lex
->
select_lex
;
SELECT_LEX
*
sel
=
&
thd
->
lex
->
select_lex
;
...
@@ -209,10 +229,10 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
...
@@ -209,10 +229,10 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
protocol
->
store
((
uint32
)
err
->
code
);
protocol
->
store
((
uint32
)
err
->
code
);
protocol
->
store
(
err
->
msg
,
strlen
(
err
->
msg
),
system_charset_info
);
protocol
->
store
(
err
->
msg
,
strlen
(
err
->
msg
),
system_charset_info
);
if
(
protocol
->
write
())
if
(
protocol
->
write
())
DBUG_RETURN
(
1
);
DBUG_RETURN
(
TRUE
);
if
(
!--
limit
)
if
(
!--
limit
)
break
;
break
;
}
}
send_eof
(
thd
);
send_eof
(
thd
);
DBUG_RETURN
(
0
);
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