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
85f52632
Commit
85f52632
authored
Nov 17, 2005
by
konstantin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix and a test case for Bug#13524 "lock timeout gives
incorrect warning on open cursor"
parent
becda939
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
1 deletion
+63
-1
sql/sql_prepare.cc
sql/sql_prepare.cc
+1
-0
tests/mysql_client_test.c
tests/mysql_client_test.c
+62
-1
No files found.
sql/sql_prepare.cc
View file @
85f52632
...
...
@@ -2312,6 +2312,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
Server_side_cursor
*
cursor
;
DBUG_ENTER
(
"mysql_stmt_fetch"
);
mysql_reset_thd_for_next_command
(
thd
);
statistic_increment
(
thd
->
status_var
.
com_stmt_fetch
,
&
LOCK_status
);
if
(
!
(
stmt
=
find_prepared_statement
(
thd
,
stmt_id
,
"mysql_stmt_fetch"
)))
DBUG_VOID_RETURN
;
...
...
tests/mysql_client_test.c
View file @
85f52632
...
...
@@ -14419,7 +14419,7 @@ static void test_bug14210()
myquery
(
rc
);
}
/* Bug#13488 */
/* Bug#13488
: wrong column metadata when fetching from cursor
*/
static
void
test_bug13488
()
{
...
...
@@ -14487,6 +14487,66 @@ static void test_bug13488()
myquery
(
rc
);
}
/*
Bug#13524: warnings of a previous command are not reset when fetching
from a cursor.
*/
static
void
test_bug13524
()
{
MYSQL_STMT
*
stmt
;
int
rc
;
unsigned
int
warning_count
;
const
ulong
type
=
CURSOR_TYPE_READ_ONLY
;
const
char
*
query
=
"select * from t1"
;
myheader
(
"test_bug13524"
);
rc
=
mysql_query
(
mysql
,
"drop table if exists t1, t2"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"create table t1 (a int not null primary key)"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"insert into t1 values (1), (2), (3), (4)"
);
myquery
(
rc
);
stmt
=
mysql_stmt_init
(
mysql
);
rc
=
mysql_stmt_attr_set
(
stmt
,
STMT_ATTR_CURSOR_TYPE
,
(
const
void
*
)
&
type
);
check_execute
(
stmt
,
rc
);
rc
=
mysql_stmt_prepare
(
stmt
,
query
,
strlen
(
query
));
check_execute
(
stmt
,
rc
);
rc
=
mysql_stmt_execute
(
stmt
);
check_execute
(
stmt
,
rc
);
rc
=
mysql_stmt_fetch
(
stmt
);
check_execute
(
stmt
,
rc
);
warning_count
=
mysql_warning_count
(
mysql
);
DIE_UNLESS
(
warning_count
==
0
);
/* Check that DROP TABLE produced a warning (no such table) */
rc
=
mysql_query
(
mysql
,
"drop table if exists t2"
);
myquery
(
rc
);
warning_count
=
mysql_warning_count
(
mysql
);
DIE_UNLESS
(
warning_count
==
1
);
/*
Check that fetch from a cursor cleared the warning from the previous
command.
*/
rc
=
mysql_stmt_fetch
(
stmt
);
check_execute
(
stmt
,
rc
);
warning_count
=
mysql_warning_count
(
mysql
);
DIE_UNLESS
(
warning_count
==
0
);
/* Cleanup */
mysql_stmt_close
(
stmt
);
rc
=
mysql_query
(
mysql
,
"drop table t1"
);
myquery
(
rc
);
}
/*
Read and parse arguments and MySQL options from my.cnf
*/
...
...
@@ -14744,6 +14804,7 @@ static struct my_tests_st my_tests[]= {
{
"test_bug12243"
,
test_bug12243
},
{
"test_bug14210"
,
test_bug14210
},
{
"test_bug13488"
,
test_bug13488
},
{
"test_bug13524"
,
test_bug13524
},
{
0
,
0
}
};
...
...
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