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
bb718b31
Commit
bb718b31
authored
Jul 08, 2003
by
venu@myvenu.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implementation of mysql_stmt_reset client end
parent
bad00c38
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
1 deletion
+33
-1
include/mysql.h
include/mysql.h
+1
-0
include/mysql_com.h
include/mysql_com.h
+1
-0
libmysql/libmysql.c
libmysql/libmysql.c
+23
-0
libmysql/libmysql.def
libmysql/libmysql.def
+1
-0
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_parse.cc
sql/sql_parse.cc
+5
-0
sql/sql_prepare.cc
sql/sql_prepare.cc
+1
-1
No files found.
include/mysql.h
View file @
bb718b31
...
@@ -566,6 +566,7 @@ unsigned long STDCALL mysql_param_count(MYSQL_STMT * stmt);
...
@@ -566,6 +566,7 @@ unsigned long STDCALL mysql_param_count(MYSQL_STMT * stmt);
my_bool
STDCALL
mysql_bind_param
(
MYSQL_STMT
*
stmt
,
MYSQL_BIND
*
bnd
);
my_bool
STDCALL
mysql_bind_param
(
MYSQL_STMT
*
stmt
,
MYSQL_BIND
*
bnd
);
my_bool
STDCALL
mysql_bind_result
(
MYSQL_STMT
*
stmt
,
MYSQL_BIND
*
bnd
);
my_bool
STDCALL
mysql_bind_result
(
MYSQL_STMT
*
stmt
,
MYSQL_BIND
*
bnd
);
my_bool
STDCALL
mysql_stmt_close
(
MYSQL_STMT
*
stmt
);
my_bool
STDCALL
mysql_stmt_close
(
MYSQL_STMT
*
stmt
);
my_bool
STDCALL
mysql_stmt_reset
(
MYSQL_STMT
*
stmt
);
my_bool
STDCALL
mysql_stmt_free_result
(
MYSQL_STMT
*
stmt
);
my_bool
STDCALL
mysql_stmt_free_result
(
MYSQL_STMT
*
stmt
);
unsigned
int
STDCALL
mysql_stmt_errno
(
MYSQL_STMT
*
stmt
);
unsigned
int
STDCALL
mysql_stmt_errno
(
MYSQL_STMT
*
stmt
);
const
char
*
STDCALL
mysql_stmt_error
(
MYSQL_STMT
*
stmt
);
const
char
*
STDCALL
mysql_stmt_error
(
MYSQL_STMT
*
stmt
);
...
...
include/mysql_com.h
View file @
bb718b31
...
@@ -44,6 +44,7 @@ enum enum_server_command
...
@@ -44,6 +44,7 @@ enum enum_server_command
COM_TIME
,
COM_DELAYED_INSERT
,
COM_CHANGE_USER
,
COM_BINLOG_DUMP
,
COM_TIME
,
COM_DELAYED_INSERT
,
COM_CHANGE_USER
,
COM_BINLOG_DUMP
,
COM_TABLE_DUMP
,
COM_CONNECT_OUT
,
COM_REGISTER_SLAVE
,
COM_TABLE_DUMP
,
COM_CONNECT_OUT
,
COM_REGISTER_SLAVE
,
COM_PREPARE
,
COM_EXECUTE
,
COM_LONG_DATA
,
COM_CLOSE_STMT
,
COM_PREPARE
,
COM_EXECUTE
,
COM_LONG_DATA
,
COM_CLOSE_STMT
,
COM_RESET_STMT
,
COM_END
/* Must be last */
COM_END
/* Must be last */
};
};
...
...
libmysql/libmysql.c
View file @
bb718b31
...
@@ -3316,6 +3316,7 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
...
@@ -3316,6 +3316,7 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
}
}
else
else
DBUG_PRINT
(
"exit"
,
(
"stmt doesn't contain any resultset"
));
DBUG_PRINT
(
"exit"
,
(
"stmt doesn't contain any resultset"
));
DBUG_VOID_RETURN
;
}
}
...
@@ -3421,6 +3422,28 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
...
@@ -3421,6 +3422,28 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
return
stmt_close
(
stmt
,
0
);
return
stmt_close
(
stmt
,
0
);
}
}
/*
Reset the statement buffers in server
*/
my_bool
STDCALL
mysql_stmt_reset
(
MYSQL_STMT
*
stmt
)
{
char
buff
[
MYSQL_STMT_HEADER
];
MYSQL
*
mysql
;
DBUG_ENTER
(
"mysql_stmt_reset"
);
DBUG_ASSERT
(
stmt
!=
0
);
mysql
=
stmt
->
mysql
->
last_used_con
;
int4store
(
buff
,
stmt
->
stmt_id
);
/* Send stmt id to server */
if
(
advanced_command
(
mysql
,
COM_RESET_STMT
,
buff
,
MYSQL_STMT_HEADER
,
0
,
0
,
1
))
{
set_stmt_errmsg
(
stmt
,
mysql
->
net
.
last_error
,
mysql
->
net
.
last_errno
,
mysql
->
net
.
sqlstate
);
DBUG_RETURN
(
1
);
}
DBUG_RETURN
(
0
);
}
/*
/*
Return statement error code
Return statement error code
*/
*/
...
...
libmysql/libmysql.def
View file @
bb718b31
...
@@ -98,6 +98,7 @@ EXPORTS
...
@@ -98,6 +98,7 @@ EXPORTS
mysql_stat
mysql_stat
mysql_stmt_affected_rows
mysql_stmt_affected_rows
mysql_stmt_close
mysql_stmt_close
mysql_stmt_reset
mysql_stmt_data_seek
mysql_stmt_data_seek
mysql_stmt_errno
mysql_stmt_errno
mysql_stmt_error
mysql_stmt_error
...
...
sql/mysql_priv.h
View file @
bb718b31
...
@@ -557,6 +557,7 @@ void free_prep_stmt(PREP_STMT *stmt, TREE_FREE mode, void *not_used);
...
@@ -557,6 +557,7 @@ void free_prep_stmt(PREP_STMT *stmt, TREE_FREE mode, void *not_used);
bool
mysql_stmt_prepare
(
THD
*
thd
,
char
*
packet
,
uint
packet_length
);
bool
mysql_stmt_prepare
(
THD
*
thd
,
char
*
packet
,
uint
packet_length
);
void
mysql_stmt_execute
(
THD
*
thd
,
char
*
packet
);
void
mysql_stmt_execute
(
THD
*
thd
,
char
*
packet
);
void
mysql_stmt_free
(
THD
*
thd
,
char
*
packet
);
void
mysql_stmt_free
(
THD
*
thd
,
char
*
packet
);
void
mysql_stmt_reset
(
THD
*
thd
,
char
*
packet
);
void
mysql_stmt_get_longdata
(
THD
*
thd
,
char
*
pos
,
ulong
packet_length
);
void
mysql_stmt_get_longdata
(
THD
*
thd
,
char
*
pos
,
ulong
packet_length
);
int
check_insert_fields
(
THD
*
thd
,
TABLE
*
table
,
List
<
Item
>
&
fields
,
int
check_insert_fields
(
THD
*
thd
,
TABLE
*
table
,
List
<
Item
>
&
fields
,
List
<
Item
>
&
values
,
ulong
counter
);
List
<
Item
>
&
values
,
ulong
counter
);
...
...
sql/sql_parse.cc
View file @
bb718b31
...
@@ -1290,6 +1290,11 @@ restore_user:
...
@@ -1290,6 +1290,11 @@ restore_user:
mysql_stmt_free
(
thd
,
packet
);
mysql_stmt_free
(
thd
,
packet
);
break
;
break
;
}
}
case
COM_RESET_STMT
:
{
mysql_stmt_reset
(
thd
,
packet
);
break
;
}
case
COM_QUERY
:
case
COM_QUERY
:
{
{
if
(
alloc_query
(
thd
,
packet
,
packet_length
))
if
(
alloc_query
(
thd
,
packet
,
packet_length
))
...
...
sql/sql_prepare.cc
View file @
bb718b31
...
@@ -965,7 +965,7 @@ void mysql_stmt_reset(THD *thd, char *packet)
...
@@ -965,7 +965,7 @@ void mysql_stmt_reset(THD *thd, char *packet)
PREP_STMT
*
stmt
;
PREP_STMT
*
stmt
;
DBUG_ENTER
(
"mysql_stmt_reset"
);
DBUG_ENTER
(
"mysql_stmt_reset"
);
if
(
!
(
stmt
=
find_prepared_statement
(
thd
,
stmt_id
,
"close
"
)))
if
(
!
(
stmt
=
find_prepared_statement
(
thd
,
stmt_id
,
"reset
"
)))
{
{
send_error
(
thd
);
send_error
(
thd
);
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
...
...
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