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
736faf47
Commit
736faf47
authored
Feb 01, 2006
by
andrey@lmy004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for bug #12744 (MYSQL_STMT operations cause seg fault after connection reset)
parent
04d6b7fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
libmysql/libmysql.c
libmysql/libmysql.c
+6
-0
tests/mysql_client_test.c
tests/mysql_client_test.c
+32
-0
No files found.
libmysql/libmysql.c
View file @
736faf47
...
@@ -4628,6 +4628,12 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
...
@@ -4628,6 +4628,12 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
/* If statement hasnt been prepared there is nothing to reset */
/* If statement hasnt been prepared there is nothing to reset */
if
((
int
)
stmt
->
state
<
(
int
)
MYSQL_STMT_PREPARE_DONE
)
if
((
int
)
stmt
->
state
<
(
int
)
MYSQL_STMT_PREPARE_DONE
)
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
if
(
!
stmt
->
mysql
)
{
/* mysql can be reset in mysql_close called from mysql_reconnect */
set_stmt_error
(
stmt
,
CR_SERVER_LOST
,
unknown_sqlstate
);
DBUG_RETURN
(
1
);
}
mysql
=
stmt
->
mysql
->
last_used_con
;
mysql
=
stmt
->
mysql
->
last_used_con
;
int4store
(
buff
,
stmt
->
stmt_id
);
/* Send stmt id to server */
int4store
(
buff
,
stmt
->
stmt_id
);
/* Send stmt id to server */
...
...
tests/mysql_client_test.c
View file @
736faf47
...
@@ -11706,6 +11706,37 @@ static void test_bug12001()
...
@@ -11706,6 +11706,37 @@ static void test_bug12001()
DIE_UNLESS
(
res
==
1
);
DIE_UNLESS
(
res
==
1
);
}
}
static
void
test_bug12744
()
{
MYSQL_STMT
*
prep_stmt
=
NULL
;
int
rc
;
myheader
(
"test_bug12744"
);
prep_stmt
=
mysql_stmt_init
(
mysql
);
rc
=
mysql_stmt_prepare
(
prep_stmt
,
"SELECT 1"
,
8
);
DIE_UNLESS
(
rc
==
0
);
rc
=
mysql_kill
(
mysql
,
mysql_thread_id
(
mysql
));
DIE_UNLESS
(
rc
==
0
);
if
(
rc
=
mysql_stmt_execute
(
prep_stmt
))
{
if
(
rc
=
mysql_stmt_reset
(
prep_stmt
))
printf
(
"OK!
\n
"
);
else
{
printf
(
"Error!"
);
DIE_UNLESS
(
1
==
0
);
}
}
else
{
fprintf
(
stderr
,
"expected error but no error occured
\n
"
);
DIE_UNLESS
(
1
==
0
);
}
rc
=
mysql_stmt_close
(
prep_stmt
);
}
/*
/*
Bug#11718: query with function, join and order by returns wrong type
Bug#11718: query with function, join and order by returns wrong type
*/
*/
...
@@ -12054,6 +12085,7 @@ static struct my_tests_st my_tests[]= {
...
@@ -12054,6 +12085,7 @@ static struct my_tests_st my_tests[]= {
{
"test_bug8378"
,
test_bug8378
},
{
"test_bug8378"
,
test_bug8378
},
{
"test_bug9735"
,
test_bug9735
},
{
"test_bug9735"
,
test_bug9735
},
{
"test_bug11183"
,
test_bug11183
},
{
"test_bug11183"
,
test_bug11183
},
{
"test_bug12744"
,
test_bug12744
},
{
"test_bug12001"
,
test_bug12001
},
{
"test_bug12001"
,
test_bug12001
},
{
"test_bug11718"
,
test_bug11718
},
{
"test_bug11718"
,
test_bug11718
},
{
"test_bug12925"
,
test_bug12925
},
{
"test_bug12925"
,
test_bug12925
},
...
...
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