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
73994755
Commit
73994755
authored
Jun 28, 2010
by
Davi Arnaut
Browse files
Options
Browse Files
Download
Plain Diff
Merge of mysql-5.1-bugteam into mysql-trunk-merge.
parents
8efca286
407b68bf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
2 deletions
+87
-2
include/myisam.h
include/myisam.h
+0
-2
sql/sql_prepare.cc
sql/sql_prepare.cc
+29
-0
tests/mysql_client_test.c
tests/mysql_client_test.c
+58
-0
No files found.
include/myisam.h
View file @
73994755
...
...
@@ -55,8 +55,6 @@ extern "C" {
#define MI_MAX_MSG_BUF 1024
/* used in CHECK TABLE, REPAIR TABLE */
#define MI_NAME_IEXT ".MYI"
#define MI_NAME_DEXT ".MYD"
/* Max extra space to use when sorting keys */
#define MI_MAX_TEMP_LENGTH 2*1024L*1024L*1024L
/* Possible values for myisam_block_size (must be power of 2) */
#define MI_KEY_BLOCK_LENGTH 1024
/* default key block length */
...
...
sql/sql_prepare.cc
View file @
73994755
...
...
@@ -791,6 +791,19 @@ static void setup_one_conversion_function(THD *thd, Item_param *param,
}
#ifndef EMBEDDED_LIBRARY
/**
Check whether this parameter data type is compatible with long data.
Used to detect whether a long data stream has been supplied to a
incompatible data type.
*/
inline
bool
is_param_long_data_type
(
Item_param
*
param
)
{
return
((
param
->
param_type
>=
MYSQL_TYPE_TINY_BLOB
)
&&
(
param
->
param_type
<=
MYSQL_TYPE_STRING
));
}
/**
Routines to assign parameters from data supplied by the client.
...
...
@@ -860,6 +873,14 @@ static bool insert_params_with_log(Prepared_statement *stmt, uchar *null_array,
DBUG_RETURN
(
1
);
}
}
/*
A long data stream was supplied for this parameter marker.
This was done after prepare, prior to providing a placeholder
type (the types are supplied at execute). Check that the
supplied type of placeholder can accept a data stream.
*/
else
if
(
!
is_param_long_data_type
(
param
))
DBUG_RETURN
(
1
);
res
=
param
->
query_val_str
(
&
str
);
if
(
param
->
convert_str_value
(
thd
))
DBUG_RETURN
(
1
);
/* out of memory */
...
...
@@ -898,6 +919,14 @@ static bool insert_params(Prepared_statement *stmt, uchar *null_array,
DBUG_RETURN
(
1
);
}
}
/*
A long data stream was supplied for this parameter marker.
This was done after prepare, prior to providing a placeholder
type (the types are supplied at execute). Check that the
supplied type of placeholder can accept a data stream.
*/
else
if
(
is_param_long_data_type
(
param
))
DBUG_RETURN
(
1
);
if
(
param
->
convert_str_value
(
stmt
->
thd
))
DBUG_RETURN
(
1
);
/* out of memory */
}
...
...
tests/mysql_client_test.c
View file @
73994755
...
...
@@ -19060,6 +19060,63 @@ static void test_bug42373()
}
/**
Bug#54041: MySQL 5.0.92 fails when tests from Connector/C suite run
*/
static
void
test_bug54041
()
{
int
rc
;
MYSQL_STMT
*
stmt
;
MYSQL_BIND
bind
;
DBUG_ENTER
(
"test_bug54041"
);
myheader
(
"test_bug54041"
);
rc
=
mysql_query
(
mysql
,
"DROP TABLE IF EXISTS t1"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"CREATE TABLE t1 (a INT)"
);
myquery
(
rc
);
stmt
=
mysql_simple_prepare
(
mysql
,
"INSERT INTO t1 (a) VALUES (?)"
);
check_stmt
(
stmt
);
verify_param_count
(
stmt
,
1
);
memset
(
&
bind
,
0
,
sizeof
(
bind
));
/* Any type that does not support long data handling. */
bind
.
buffer_type
=
MYSQL_TYPE_LONG
;
rc
=
mysql_stmt_bind_param
(
stmt
,
&
bind
);
check_execute
(
stmt
,
rc
);
/*
Trick the client API into sending a long data packet for
the parameter. Long data is only supported for string and
binary types.
*/
stmt
->
params
[
0
].
buffer_type
=
MYSQL_TYPE_STRING
;
rc
=
mysql_stmt_send_long_data
(
stmt
,
0
,
"data"
,
5
);
check_execute
(
stmt
,
rc
);
/* Undo API violation. */
stmt
->
params
[
0
].
buffer_type
=
MYSQL_TYPE_LONG
;
rc
=
mysql_stmt_execute
(
stmt
);
/* Incorrect arguments. */
check_execute_r
(
stmt
,
rc
);
mysql_stmt_close
(
stmt
);
rc
=
mysql_query
(
mysql
,
"DROP TABLE IF EXISTS t1"
);
myquery
(
rc
);
DBUG_VOID_RETURN
;
}
/*
Bug#49972: Crash in prepared statements.
...
...
@@ -19500,6 +19557,7 @@ static struct my_tests_st my_tests[]= {
{
"test_bug44495"
,
test_bug44495
},
{
"test_bug49972"
,
test_bug49972
},
{
"test_bug42373"
,
test_bug42373
},
{
"test_bug54041"
,
test_bug54041
},
{
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