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
618bd69d
Commit
618bd69d
authored
Jun 30, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1
into mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug20152
parents
0343a80b
86155590
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
4 deletions
+56
-4
libmysql/libmysql.c
libmysql/libmysql.c
+3
-4
tests/mysql_client_test.c
tests/mysql_client_test.c
+53
-0
No files found.
libmysql/libmysql.c
View file @
618bd69d
...
...
@@ -2409,10 +2409,9 @@ static void net_store_datetime(NET *net, MYSQL_TIME *tm)
static
void
store_param_date
(
NET
*
net
,
MYSQL_BIND
*
param
)
{
MYSQL_TIME
*
tm
=
(
MYSQL_TIME
*
)
param
->
buffer
;
tm
->
hour
=
tm
->
minute
=
tm
->
second
=
0
;
tm
->
second_part
=
0
;
net_store_datetime
(
net
,
tm
);
MYSQL_TIME
tm
=
*
((
MYSQL_TIME
*
)
param
->
buffer
);
tm
.
hour
=
tm
.
minute
=
tm
.
second
=
tm
.
second_part
=
0
;
net_store_datetime
(
net
,
&
tm
);
}
static
void
store_param_datetime
(
NET
*
net
,
MYSQL_BIND
*
param
)
...
...
tests/mysql_client_test.c
View file @
618bd69d
...
...
@@ -11855,6 +11855,58 @@ static void test_bug15613()
mysql_stmt_close
(
stmt
);
}
/*
Bug#20152: mysql_stmt_execute() writes to MYSQL_TYPE_DATE buffer
*/
static
void
test_bug20152
()
{
MYSQL_BIND
bind
[
1
];
MYSQL_STMT
*
stmt
;
MYSQL_TIME
tm
;
int
rc
;
const
char
*
query
=
"INSERT INTO t1 (f1) VALUES (?)"
;
myheader
(
"test_bug20152"
);
memset
(
bind
,
0
,
sizeof
(
bind
));
bind
[
0
].
buffer_type
=
MYSQL_TYPE_DATE
;
bind
[
0
].
buffer
=
(
void
*
)
&
tm
;
tm
.
year
=
2006
;
tm
.
month
=
6
;
tm
.
day
=
18
;
tm
.
hour
=
14
;
tm
.
minute
=
9
;
tm
.
second
=
42
;
rc
=
mysql_query
(
mysql
,
"DROP TABLE IF EXISTS t1"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"CREATE TABLE t1 (f1 DATE)"
);
myquery
(
rc
);
stmt
=
mysql_stmt_init
(
mysql
);
rc
=
mysql_stmt_prepare
(
stmt
,
query
,
strlen
(
query
));
check_execute
(
stmt
,
rc
);
rc
=
mysql_stmt_bind_param
(
stmt
,
bind
);
check_execute
(
stmt
,
rc
);
rc
=
mysql_stmt_execute
(
stmt
);
check_execute
(
stmt
,
rc
);
rc
=
mysql_stmt_close
(
stmt
);
check_execute
(
stmt
,
rc
);
rc
=
mysql_query
(
mysql
,
"DROP TABLE t1"
);
myquery
(
rc
);
if
(
tm
.
hour
==
14
&&
tm
.
minute
==
9
&&
tm
.
second
==
42
)
{
if
(
!
opt_silent
)
printf
(
"OK!"
);
}
else
{
printf
(
"[14:09:42] != [%02d:%02d:%02d]
\n
"
,
tm
.
hour
,
tm
.
minute
,
tm
.
second
);
DIE_UNLESS
(
0
==
1
);
}
}
/*
Read and parse arguments and MySQL options from my.cnf
*/
...
...
@@ -12078,6 +12130,7 @@ static struct my_tests_st my_tests[]= {
{
"test_bug11718"
,
test_bug11718
},
{
"test_bug12925"
,
test_bug12925
},
{
"test_bug15613"
,
test_bug15613
},
{
"test_bug20152"
,
test_bug20152
},
{
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