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
d854a85f
Commit
d854a85f
authored
Apr 30, 2004
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/dbdata/psergey/mysql-4.1-bug3420
parents
661aeb5a
448e4bbd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
tests/client_test.c
tests/client_test.c
+58
-0
No files found.
tests/client_test.c
View file @
d854a85f
...
@@ -1828,6 +1828,63 @@ static void test_select()
...
@@ -1828,6 +1828,63 @@ static void test_select()
mysql_stmt_close
(
stmt
);
mysql_stmt_close
(
stmt
);
}
}
/*
Test for BUG#3420 ("select id1,value1 from t where id=? or value=?"
returns all rows in the table)
*/
static
void
test_ps_conj_select
()
{
MYSQL_STMT
*
stmt
;
int
rc
;
MYSQL_BIND
bind
[
2
];
long
int
int_data
;
char
str_data
[
32
];
unsigned
long
str_length
;
myheader
(
"test_ps_conj_select"
);
rc
=
mysql_query
(
mysql
,
"drop table if exists t1"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"create table t1 (id1 int(11) NOT NULL default '0',"
"value2 varchar(100), value1 varchar(100))"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"insert into t1 values (1,'hh','hh'),(2,'hh','hh'),"
"(1,'ii','ii'),(2,'ii','ii')"
);
myquery
(
rc
);
strmov
(
query
,
"select id1,value1 from t1 where id1=? or value1=?"
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
mystmt_init
(
stmt
);
verify_param_count
(
stmt
,
2
);
bind
[
0
].
buffer_type
=
MYSQL_TYPE_LONG
;
bind
[
0
].
buffer
=
(
char
*
)
&
int_data
;
bind
[
0
].
is_null
=
0
;
bind
[
0
].
length
=
0
;
bind
[
1
].
buffer_type
=
MYSQL_TYPE_VAR_STRING
;
bind
[
1
].
buffer
=
(
char
*
)
str_data
;
bind
[
1
].
buffer_length
=
array_elements
(
str_data
);
bind
[
1
].
is_null
=
0
;
bind
[
1
].
length
=
&
str_length
;
rc
=
mysql_bind_param
(
stmt
,
bind
);
mystmt
(
stmt
,
rc
);
int_data
=
1
;
strcpy
(
str_data
,
"hh"
);
str_length
=
strlen
(
str_data
);
rc
=
mysql_execute
(
stmt
);
mystmt
(
stmt
,
rc
);
assert
(
my_process_stmt_result
(
stmt
)
==
3
);
mysql_stmt_close
(
stmt
);
}
/*
/*
test BUG#1115 (incorrect string parameter value allocation)
test BUG#1115 (incorrect string parameter value allocation)
*/
*/
...
@@ -9508,6 +9565,7 @@ int main(int argc, char **argv)
...
@@ -9508,6 +9565,7 @@ int main(int argc, char **argv)
test_select_prepare
();
/* prepare select - protocol_prep debug */
test_select_prepare
();
/* prepare select - protocol_prep debug */
test_select
();
/* simple select test */
test_select
();
/* simple select test */
test_select_version
();
/* select with variables */
test_select_version
();
/* select with variables */
test_ps_conj_select
();
/* prepare select with "where a=? or b=?" */
test_select_show_table
();
/* simple show prepare */
test_select_show_table
();
/* simple show prepare */
#if NOT_USED
#if NOT_USED
/*
/*
...
...
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