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
0c96241b
Commit
0c96241b
authored
Feb 19, 2009
by
Alexey Kopytov
Browse files
Options
Browse Files
Download
Plain Diff
Automerge.
parents
ddf6ac40
32164609
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
1 deletion
+65
-1
sql/item.cc
sql/item.cc
+1
-1
tests/mysql_client_test.c
tests/mysql_client_test.c
+64
-0
No files found.
sql/item.cc
View file @
0c96241b
...
...
@@ -3010,7 +3010,7 @@ bool Item_param::convert_str_value(THD *thd)
str_value
.
set_charset
(
value
.
cs_info
.
final_character_set_of_str_value
);
/* Here str_value is guaranteed to be in final_character_set_of_str_value */
max_length
=
str_value
.
length
()
;
max_length
=
str_value
.
numchars
()
*
str_value
.
charset
()
->
mbmaxlen
;
decimals
=
0
;
/*
str_value_ptr is returned from val_str(). It must be not alloced
...
...
tests/mysql_client_test.c
View file @
0c96241b
...
...
@@ -16410,6 +16410,69 @@ static void test_bug36326()
#endif
/**
Bug#41078: With CURSOR_TYPE_READ_ONLY mysql_stmt_fetch() returns short
string value.
*/
static
void
test_bug41078
(
void
)
{
uint
rc
;
MYSQL_STMT
*
stmt
=
0
;
MYSQL_BIND
param
,
result
;
ulong
cursor_type
=
CURSOR_TYPE_READ_ONLY
;
ulong
len
;
char
str
[
64
];
const
char
param_str
[]
=
"abcdefghijklmn"
;
my_bool
is_null
,
error
;
DBUG_ENTER
(
"test_bug41078"
);
rc
=
mysql_query
(
mysql
,
"SET NAMES UTF8"
);
myquery
(
rc
);
stmt
=
mysql_simple_prepare
(
mysql
,
"SELECT ?"
);
check_stmt
(
stmt
);
verify_param_count
(
stmt
,
1
);
rc
=
mysql_stmt_attr_set
(
stmt
,
STMT_ATTR_CURSOR_TYPE
,
&
cursor_type
);
check_execute
(
stmt
,
rc
);
bzero
(
&
param
,
sizeof
(
param
));
param
.
buffer_type
=
MYSQL_TYPE_STRING
;
param
.
buffer
=
(
void
*
)
param_str
;
len
=
sizeof
(
param_str
)
-
1
;
param
.
length
=
&
len
;
rc
=
mysql_stmt_bind_param
(
stmt
,
&
param
);
check_execute
(
stmt
,
rc
);
rc
=
mysql_stmt_execute
(
stmt
);
check_execute
(
stmt
,
rc
);
bzero
(
&
result
,
sizeof
(
result
));
result
.
buffer_type
=
MYSQL_TYPE_STRING
;
result
.
buffer
=
str
;
result
.
buffer_length
=
sizeof
(
str
);
result
.
is_null
=
&
is_null
;
result
.
length
=
&
len
;
result
.
error
=
&
error
;
rc
=
mysql_stmt_bind_result
(
stmt
,
&
result
);
check_execute
(
stmt
,
rc
);
rc
=
mysql_stmt_store_result
(
stmt
);
check_execute
(
stmt
,
rc
);
rc
=
mysql_stmt_fetch
(
stmt
);
check_execute
(
stmt
,
rc
);
DIE_UNLESS
(
len
==
sizeof
(
param_str
)
-
1
&&
!
strcmp
(
str
,
param_str
));
mysql_stmt_close
(
stmt
);
DBUG_VOID_RETURN
;
}
/*
Read and parse arguments and MySQL options from my.cnf
...
...
@@ -16713,6 +16776,7 @@ static struct my_tests_st my_tests[]= {
#ifdef HAVE_QUERY_CACHE
{
"test_bug36326"
,
test_bug36326
},
#endif
{
"test_bug41078"
,
test_bug41078
},
{
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