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
500e56e0
Commit
500e56e0
authored
Nov 22, 2002
by
venu@myvenu.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client_test.c:
Modification to new API test sql_prepare.cc: Fix for lock_types
parent
ec17cac9
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
701 additions
and
668 deletions
+701
-668
sql/sql_prepare.cc
sql/sql_prepare.cc
+14
-21
tests/client_test.c
tests/client_test.c
+687
-647
No files found.
sql/sql_prepare.cc
View file @
500e56e0
...
...
@@ -276,8 +276,9 @@ static void setup_param_functions(Item_param *param, uchar read_pos)
from client ..
*/
static
bool
setup_params_data
(
THD
*
thd
,
PREP_STMT
*
stmt
)
static
bool
setup_params_data
(
PREP_STMT
*
stmt
)
{
THD
*
thd
=
stmt
->
thd
;
List
<
Item
>
&
params
=
thd
->
lex
.
param_list
;
List_iterator
<
Item
>
param_iterator
(
params
);
Item_param
*
param
;
...
...
@@ -375,8 +376,7 @@ static int check_prepare_fields(THD *thd,TABLE *table, List<Item> &fields,
static
bool
mysql_test_insert_fields
(
PREP_STMT
*
stmt
,
TABLE_LIST
*
table_list
,
List
<
Item
>
&
fields
,
List
<
List_item
>
&
values_list
,
thr_lock_type
lock_type
)
List
<
List_item
>
&
values_list
)
{
THD
*
thd
=
stmt
->
thd
;
TABLE
*
table
;
...
...
@@ -384,7 +384,7 @@ static bool mysql_test_insert_fields(PREP_STMT *stmt,
List_item
*
values
;
DBUG_ENTER
(
"mysql_test_insert_fields"
);
if
(
!
(
table
=
open_ltable
(
thd
,
table_list
,
lock_type
)))
if
(
!
(
table
=
open_ltable
(
thd
,
table_list
,
table_list
->
lock_type
)))
DBUG_RETURN
(
1
);
if
((
values
=
its
++
))
...
...
@@ -427,13 +427,13 @@ static bool mysql_test_insert_fields(PREP_STMT *stmt,
static
bool
mysql_test_upd_fields
(
PREP_STMT
*
stmt
,
TABLE_LIST
*
table_list
,
List
<
Item
>
&
fields
,
List
<
Item
>
&
values
,
COND
*
conds
,
thr_lock_type
lock_type
)
COND
*
conds
)
{
THD
*
thd
=
stmt
->
thd
;
TABLE
*
table
;
DBUG_ENTER
(
"mysql_test_upd_fields"
);
if
(
!
(
table
=
open_ltable
(
thd
,
table_list
,
lock_type
)))
if
(
!
(
table
=
open_ltable
(
thd
,
table_list
,
table_list
->
lock_type
)))
DBUG_RETURN
(
1
);
if
(
setup_tables
(
table_list
)
||
setup_fields
(
thd
,
table_list
,
fields
,
1
,
0
,
0
)
||
...
...
@@ -465,7 +465,7 @@ static bool mysql_test_upd_fields(PREP_STMT *stmt, TABLE_LIST *table_list,
static
bool
mysql_test_select_fields
(
PREP_STMT
*
stmt
,
TABLE_LIST
*
tables
,
List
<
Item
>
&
fields
,
List
<
Item
>
&
values
,
COND
*
conds
,
ORDER
*
order
,
ORDER
*
group
,
Item
*
having
,
thr_lock_type
lock_type
)
Item
*
having
)
{
TABLE
*
table
;
bool
hidden_group_fields
;
...
...
@@ -473,7 +473,7 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
List
<
Item
>
all_fields
(
fields
);
DBUG_ENTER
(
"mysql_test_select_fields"
);
if
(
!
(
table
=
open_ltable
(
thd
,
tables
,
lock_type
)))
if
(
!
(
table
=
open_ltable
(
thd
,
tables
,
tables
->
lock_type
)))
DBUG_RETURN
(
1
);
thd
->
used_tables
=
0
;
// Updated by setup_fields
...
...
@@ -546,21 +546,19 @@ static bool send_prepare_results(PREP_STMT *stmt)
case
SQLCOM_INSERT
:
if
(
mysql_test_insert_fields
(
stmt
,
tables
,
lex
->
field_list
,
lex
->
many_values
,
lex
->
lock_option
))
lex
->
many_values
))
goto
abort
;
break
;
case
SQLCOM_UPDATE
:
if
(
mysql_test_upd_fields
(
stmt
,
tables
,
select_lex
->
item_list
,
lex
->
value_list
,
select_lex
->
where
,
lex
->
lock_option
))
lex
->
value_list
,
select_lex
->
where
))
goto
abort
;
break
;
case
SQLCOM_DELETE
:
if
(
mysql_test_upd_fields
(
stmt
,
tables
,
select_lex
->
item_list
,
lex
->
value_list
,
select_lex
->
where
,
lex
->
lock_option
))
lex
->
value_list
,
select_lex
->
where
))
goto
abort
;
break
;
...
...
@@ -568,8 +566,7 @@ static bool send_prepare_results(PREP_STMT *stmt)
if
(
mysql_test_select_fields
(
stmt
,
tables
,
select_lex
->
item_list
,
lex
->
value_list
,
select_lex
->
where
,
(
ORDER
*
)
select_lex
->
order_list
.
first
,
(
ORDER
*
)
select_lex
->
group_list
.
first
,
select_lex
->
having
,
lex
->
lock_option
))
(
ORDER
*
)
select_lex
->
group_list
.
first
,
select_lex
->
having
))
goto
abort
;
break
;
...
...
@@ -712,11 +709,9 @@ void mysql_stmt_execute(THD *thd, char *packet)
DBUG_VOID_RETURN
;
}
if
(
stmt
->
param_count
&&
setup_params_data
(
thd
,
stmt
))
if
(
stmt
->
param_count
&&
setup_params_data
(
stmt
))
DBUG_VOID_RETURN
;
MEM_ROOT
thd_root
=
thd
->
mem_root
;
thd
->
mem_root
=
thd
->
con_root
;
if
(
!
(
specialflag
&
SPECIAL_NO_PRIOR
))
my_pthread_setprio
(
pthread_self
(),
QUERY_PRIOR
);
...
...
@@ -726,14 +721,12 @@ void mysql_stmt_execute(THD *thd, char *packet)
mysql_delete(), mysql_update() and mysql_select() to not to
have re-check on setup_* and other things ..
*/
mysql_execute_command
(
thd
);
mysql_execute_command
(
stmt
->
thd
);
thd
->
last_prepared_stmt
=
stmt
;
if
(
!
(
specialflag
&
SPECIAL_NO_PRIOR
))
my_pthread_setprio
(
pthread_self
(),
WAIT_PRIOR
);
thd
->
mem_root
=
thd_root
;
DBUG_VOID_RETURN
;
}
...
...
tests/client_test.c
View file @
500e56e0
This diff is collapsed.
Click to expand it.
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