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
6c152b29
Commit
6c152b29
authored
Jul 12, 2007
by
kostja@bodhi.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into bodhi.(none):/opt/local/work/mysql-5.0-runtime
parents
675a4e8f
366b761f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
14 deletions
+45
-14
sql/sql_prepare.cc
sql/sql_prepare.cc
+45
-14
No files found.
sql/sql_prepare.cc
View file @
6c152b29
...
...
@@ -1900,13 +1900,6 @@ void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length)
/* Statement map deletes statement on erase */
thd
->
stmt_map
.
erase
(
stmt
);
}
else
{
const
char
*
format
=
"[%lu] %.*b"
;
mysql_log
.
write
(
thd
,
COM_STMT_PREPARE
,
format
,
stmt
->
id
,
stmt
->
query_length
,
stmt
->
query
);
}
/* check_prepared_statemnt sends the metadata packet in case of success */
DBUG_VOID_RETURN
;
}
...
...
@@ -2289,13 +2282,6 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
test
(
flags
&
(
ulong
)
CURSOR_TYPE_READ_ONLY
));
if
(
!
(
specialflag
&
SPECIAL_NO_PRIOR
))
my_pthread_setprio
(
pthread_self
(),
WAIT_PRIOR
);
if
(
error
==
0
)
{
const
char
*
format
=
"[%lu] %.*b"
;
mysql_log
.
write
(
thd
,
COM_STMT_EXECUTE
,
format
,
stmt
->
id
,
thd
->
query_length
,
thd
->
query
);
}
DBUG_VOID_RETURN
;
set_params_data_err:
...
...
@@ -2879,6 +2865,29 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
init_stmt_after_parse
(
lex
);
state
=
Query_arena
::
PREPARED
;
flags
&=
~
(
uint
)
IS_IN_USE
;
/*
Log COM_EXECUTE to the general log. Note, that in case of SQL
prepared statements this causes two records to be output:
Query PREPARE stmt from @user_variable
Prepare <statement SQL text>
This is considered user-friendly, since in the
second log entry we output the actual statement text.
Do not print anything if this is an SQL prepared statement and
we're inside a stored procedure (also called Dynamic SQL) --
sub-statements inside stored procedures are not logged into
the general log.
*/
if
(
thd
->
spcont
==
NULL
)
{
const
char
*
format
=
"[%lu] %.*b"
;
mysql_log
.
write
(
thd
,
COM_STMT_PREPARE
,
format
,
id
,
query_length
,
query
);
}
}
DBUG_RETURN
(
error
);
}
...
...
@@ -3016,6 +3025,28 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
if
(
state
==
Query_arena
::
PREPARED
)
state
=
Query_arena
::
EXECUTED
;
/*
Log COM_EXECUTE to the general log. Note, that in case of SQL
prepared statements this causes two records to be output:
Query EXECUTE <statement name>
Execute <statement SQL text>
This is considered user-friendly, since in the
second log entry we output values of parameter markers.
Do not print anything if this is an SQL prepared statement and
we're inside a stored procedure (also called Dynamic SQL) --
sub-statements inside stored procedures are not logged into
the general log.
*/
if
(
error
==
0
&&
thd
->
spcont
==
NULL
)
{
const
char
*
format
=
"[%lu] %.*b"
;
mysql_log
.
write
(
thd
,
COM_STMT_EXECUTE
,
format
,
id
,
thd
->
query_length
,
thd
->
query
);
}
error:
flags
&=
~
(
uint
)
IS_IN_USE
;
return
error
;
...
...
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