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
2af9056a
Commit
2af9056a
authored
Mar 31, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1
parents
ddafa2cc
4a4f5fc6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
8 deletions
+29
-8
libmysql/libmysql.c
libmysql/libmysql.c
+16
-4
sql/sql_prepare.cc
sql/sql_prepare.cc
+13
-4
No files found.
libmysql/libmysql.c
View file @
2af9056a
...
@@ -1846,6 +1846,16 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
...
@@ -1846,6 +1846,16 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
field_count
=
uint2korr
(
pos
);
pos
+=
2
;
field_count
=
uint2korr
(
pos
);
pos
+=
2
;
param_count
=
uint2korr
(
pos
);
pos
+=
2
;
param_count
=
uint2korr
(
pos
);
pos
+=
2
;
if
(
param_count
!=
0
)
{
MYSQL_DATA
*
param_data
;
/* skip parameters data: we don't support it yet */
if
(
!
(
param_data
=
(
*
mysql
->
methods
->
read_rows
)(
mysql
,
(
MYSQL_FIELD
*
)
0
,
7
)))
DBUG_RETURN
(
1
);
free_rows
(
param_data
);
}
if
(
field_count
!=
0
)
if
(
field_count
!=
0
)
{
{
if
(
!
(
mysql
->
server_status
&
SERVER_STATUS_AUTOCOMMIT
))
if
(
!
(
mysql
->
server_status
&
SERVER_STATUS_AUTOCOMMIT
))
...
@@ -2322,15 +2332,17 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length)
...
@@ -2322,15 +2332,17 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length)
{
{
MYSQL
*
mysql
=
stmt
->
mysql
;
MYSQL
*
mysql
=
stmt
->
mysql
;
NET
*
net
=
&
mysql
->
net
;
NET
*
net
=
&
mysql
->
net
;
char
buff
[
MYSQL_STMT_HEADER
];
char
buff
[
4
/* size of stmt id */
+
5
/* execution flags */
];
DBUG_ENTER
(
"execute"
);
DBUG_ENTER
(
"execute"
);
DBUG_PRINT
(
"enter"
,(
"packet: %s, length :%d"
,
packet
?
packet
:
" "
,
length
));
DBUG_PRINT
(
"enter"
,(
"packet: %s, length :%d"
,
packet
?
packet
:
" "
,
length
));
mysql
->
last_used_con
=
mysql
;
mysql
->
last_used_con
=
mysql
;
int4store
(
buff
,
stmt
->
stmt_id
);
/* Send stmt id to server */
int4store
(
buff
,
stmt
->
stmt_id
);
/* Send stmt id to server */
if
(
cli_advanced_command
(
mysql
,
COM_EXECUTE
,
buff
,
buff
[
4
]
=
(
char
)
0
;
/* no flags */
MYSQL_STMT_HEADER
,
packet
,
int4store
(
buff
+
5
,
1
);
/* iteration count */
length
,
1
)
||
if
(
cli_advanced_command
(
mysql
,
COM_EXECUTE
,
buff
,
sizeof
(
buff
),
packet
,
length
,
1
)
||
(
*
mysql
->
methods
->
read_query_result
)(
mysql
))
(
*
mysql
->
methods
->
read_query_result
)(
mysql
))
{
{
set_stmt_errmsg
(
stmt
,
net
->
last_error
,
net
->
last_errno
,
net
->
sqlstate
);
set_stmt_errmsg
(
stmt
,
net
->
last_error
,
net
->
last_errno
,
net
->
sqlstate
);
...
...
sql/sql_prepare.cc
View file @
2af9056a
...
@@ -155,8 +155,16 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns)
...
@@ -155,8 +155,16 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns)
int4store
(
buff
+
1
,
stmt
->
id
);
int4store
(
buff
+
1
,
stmt
->
id
);
int2store
(
buff
+
5
,
columns
);
int2store
(
buff
+
5
,
columns
);
int2store
(
buff
+
7
,
stmt
->
param_count
);
int2store
(
buff
+
7
,
stmt
->
param_count
);
/* TODO: send types of placeholders here */
/*
return
(
my_net_write
(
net
,
buff
,
sizeof
(
buff
))
||
net_flush
(
net
));
Send types and names of placeholders to the client
XXX: fix this nasty upcast from List<Item_param> to List<Item>
*/
return
my_net_write
(
net
,
buff
,
sizeof
(
buff
))
||
(
stmt
->
param_count
&&
stmt
->
thd
->
protocol_simple
.
send_fields
((
List
<
Item
>
*
)
&
stmt
->
lex
->
param_list
,
0
))
||
net_flush
(
net
);
return
0
;
}
}
#else
#else
static
bool
send_prep_stmt
(
Prepared_statement
*
stmt
,
static
bool
send_prep_stmt
(
Prepared_statement
*
stmt
,
...
@@ -1113,9 +1121,12 @@ static void reset_stmt_for_execute(Prepared_statement *stmt)
...
@@ -1113,9 +1121,12 @@ static void reset_stmt_for_execute(Prepared_statement *stmt)
void
mysql_stmt_execute
(
THD
*
thd
,
char
*
packet
,
uint
packet_length
)
void
mysql_stmt_execute
(
THD
*
thd
,
char
*
packet
,
uint
packet_length
)
{
{
ulong
stmt_id
=
uint4korr
(
packet
);
ulong
stmt_id
=
uint4korr
(
packet
);
uchar
*
packet_end
=
(
uchar
*
)
packet
+
packet_length
-
1
;
Prepared_statement
*
stmt
;
Prepared_statement
*
stmt
;
DBUG_ENTER
(
"mysql_stmt_execute"
);
DBUG_ENTER
(
"mysql_stmt_execute"
);
packet
+=
9
;
/* stmt_id + 5 bytes of flags */
if
(
!
(
stmt
=
find_prepared_statement
(
thd
,
stmt_id
,
"execute"
,
SEND_ERROR
)))
if
(
!
(
stmt
=
find_prepared_statement
(
thd
,
stmt_id
,
"execute"
,
SEND_ERROR
)))
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
...
@@ -1135,8 +1146,6 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
...
@@ -1135,8 +1146,6 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
#ifndef EMBEDDED_LIBRARY
#ifndef EMBEDDED_LIBRARY
if
(
stmt
->
param_count
)
if
(
stmt
->
param_count
)
{
{
uchar
*
packet_end
=
(
uchar
*
)
packet
+
packet_length
-
1
;
packet
+=
4
;
uchar
*
null_array
=
(
uchar
*
)
packet
;
uchar
*
null_array
=
(
uchar
*
)
packet
;
if
(
setup_conversion_functions
(
stmt
,
(
uchar
**
)
&
packet
,
packet_end
)
||
if
(
setup_conversion_functions
(
stmt
,
(
uchar
**
)
&
packet
,
packet_end
)
||
stmt
->
set_params
(
stmt
,
null_array
,
(
uchar
*
)
packet
,
packet_end
))
stmt
->
set_params
(
stmt
,
null_array
,
(
uchar
*
)
packet
,
packet_end
))
...
...
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