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
762771d8
Commit
762771d8
authored
Aug 26, 2004
by
konstantin@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/media/sda1/mysql/mysql-4.1-5126
parents
36d93f40
46f1922f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
libmysql/libmysql.c
libmysql/libmysql.c
+2
-0
tests/client_test.c
tests/client_test.c
+48
-0
No files found.
libmysql/libmysql.c
View file @
762771d8
...
...
@@ -3339,6 +3339,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
}
case
MYSQL_TYPE_DATE
:
case
MYSQL_TYPE_DATETIME
:
case
MYSQL_TYPE_TIMESTAMP
:
{
MYSQL_TIME
*
tm
=
(
MYSQL_TIME
*
)
buffer
;
str_to_datetime
(
value
,
length
,
tm
,
0
,
&
err
);
...
...
@@ -3612,6 +3613,7 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
length
=
2
;
break
;
}
case
MYSQL_TYPE_INT24
:
/* mediumint is sent as 4 bytes int */
case
MYSQL_TYPE_LONG
:
{
long
value
=
sint4korr
(
*
row
);
...
...
tests/client_test.c
View file @
762771d8
...
...
@@ -10044,6 +10044,53 @@ static void test_bug4030()
}
static
void
test_bug5126
()
{
MYSQL_STMT
*
stmt
;
MYSQL_BIND
bind
[
2
];
long
c1
,
c2
;
const
char
*
stmt_text
;
int
rc
;
myheader
(
"test_bug5126"
);
stmt_text
=
"DROP TABLE IF EXISTS t1"
;
rc
=
mysql_real_query
(
mysql
,
stmt_text
,
strlen
(
stmt_text
));
myquery
(
rc
);
stmt_text
=
"CREATE TABLE t1 (a mediumint, b int)"
;
rc
=
mysql_real_query
(
mysql
,
stmt_text
,
strlen
(
stmt_text
));
myquery
(
rc
);
stmt_text
=
"INSERT INTO t1 VALUES (8386608, 1)"
;
rc
=
mysql_real_query
(
mysql
,
stmt_text
,
strlen
(
stmt_text
));
myquery
(
rc
);
stmt
=
mysql_stmt_init
(
mysql
);
stmt_text
=
"SELECT a, b FROM t1"
;
rc
=
mysql_stmt_prepare
(
stmt
,
stmt_text
,
strlen
(
stmt_text
));
check_execute
(
stmt
,
rc
);
rc
=
mysql_stmt_execute
(
stmt
);
check_execute
(
stmt
,
rc
);
/* Bind output buffers */
bzero
(
bind
,
sizeof
(
bind
));
bind
[
0
].
buffer_type
=
MYSQL_TYPE_LONG
;
bind
[
0
].
buffer
=
&
c1
;
bind
[
1
].
buffer_type
=
MYSQL_TYPE_LONG
;
bind
[
1
].
buffer
=
&
c2
;
mysql_stmt_bind_result
(
stmt
,
bind
);
rc
=
mysql_stmt_fetch
(
stmt
);
assert
(
rc
==
0
);
assert
(
c1
==
8386608
&&
c2
==
1
);
printf
(
"%ld, %ld
\n
"
,
c1
,
c2
);
mysql_stmt_close
(
stmt
);
}
/*
Read and parse arguments and MySQL options from my.cnf
*/
...
...
@@ -10341,6 +10388,7 @@ int main(int argc, char **argv)
test_bug4236
();
/* init -> execute */
test_bug4030
();
/* test conversion string -> time types in
libmysql */
test_bug5126
();
/* support for mediumint type in libmysql */
/*
XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST
DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH.
...
...
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