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
26ed51d0
Commit
26ed51d0
authored
Aug 11, 2008
by
Chad MILLER
Browse files
Options
Browse Files
Download
Plain Diff
Merge from bugteam 5.0 trunk.
parents
b615e3d5
d622b04f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
sql/sql_cursor.cc
sql/sql_cursor.cc
+4
-1
tests/mysql_client_test.c
tests/mysql_client_test.c
+30
-0
No files found.
sql/sql_cursor.cc
View file @
26ed51d0
...
...
@@ -111,7 +111,8 @@ class Select_materialize: public select_union
select_result
*
result
;
/* the result object of the caller (PS or SP) */
public:
Materialized_cursor
*
materialized_cursor
;
Select_materialize
(
select_result
*
result_arg
)
:
result
(
result_arg
)
{}
Select_materialize
(
select_result
*
result_arg
)
:
result
(
result_arg
),
materialized_cursor
(
0
)
{}
virtual
bool
send_fields
(
List
<
Item
>
&
list
,
uint
flags
);
};
...
...
@@ -155,6 +156,7 @@ int mysql_open_cursor(THD *thd, uint flags, select_result *result,
if
(
!
(
sensitive_cursor
=
new
(
thd
->
mem_root
)
Sensitive_cursor
(
thd
,
result
)))
{
delete
result_materialize
;
result_materialize
=
NULL
;
return
1
;
}
...
...
@@ -212,6 +214,7 @@ int mysql_open_cursor(THD *thd, uint flags, select_result *result,
if
((
rc
=
materialized_cursor
->
open
(
0
)))
{
delete
materialized_cursor
;
materialized_cursor
=
NULL
;
goto
err_open
;
}
...
...
tests/mysql_client_test.c
View file @
26ed51d0
...
...
@@ -16189,6 +16189,35 @@ static void test_bug32265()
DBUG_VOID_RETURN
;
}
/**
Bug#38486 Crash when using cursor protocol
*/
static
void
test_bug38486
(
void
)
{
myheader
(
"test_bug38486"
);
MYSQL_STMT
*
stmt
;
stmt
=
mysql_stmt_init
(
mysql
);
unsigned
long
type
=
CURSOR_TYPE_READ_ONLY
;
mysql_stmt_attr_set
(
stmt
,
STMT_ATTR_CURSOR_TYPE
,
(
void
*
)
&
type
);
const
char
*
sql
=
"CREATE TABLE t1 (a INT)"
;
mysql_stmt_prepare
(
stmt
,
sql
,
strlen
(
sql
));
mysql_stmt_execute
(
stmt
);
mysql_stmt_close
(
stmt
);
stmt
=
mysql_stmt_init
(
mysql
);
mysql_stmt_attr_set
(
stmt
,
STMT_ATTR_CURSOR_TYPE
,
(
void
*
)
&
type
);
const
char
*
sql2
=
"INSERT INTO t1 VALUES (1)"
;
mysql_stmt_prepare
(
stmt
,
sql2
,
strlen
(
sql2
));
mysql_stmt_execute
(
stmt
);
mysql_stmt_close
(
stmt
);
}
/*
Read and parse arguments and MySQL options from my.cnf
*/
...
...
@@ -16483,6 +16512,7 @@ static struct my_tests_st my_tests[]= {
{
"test_bug29306"
,
test_bug29306
},
{
"test_bug31669"
,
test_bug31669
},
{
"test_bug32265"
,
test_bug32265
},
{
"test_bug38486"
,
test_bug38486
},
{
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