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
00398f5e
Commit
00398f5e
authored
Jul 15, 2005
by
georg@lmy002.wdf.sap.corp
Browse files
Options
Browse Files
Download
Plain Diff
Merge grichter@bk-internal.mysql.com:/home/bk/mysql-5.0
into lmy002.wdf.sap.corp:/home/georg/work/mysql-5.0
parents
cd20ee43
8c4cd042
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
4 deletions
+59
-4
libmysql/libmysql.c
libmysql/libmysql.c
+12
-3
tests/mysql_client_test.c
tests/mysql_client_test.c
+47
-1
No files found.
libmysql/libmysql.c
View file @
00398f5e
...
@@ -1774,6 +1774,7 @@ static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row);
...
@@ -1774,6 +1774,7 @@ static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row);
static
int
stmt_read_row_buffered
(
MYSQL_STMT
*
stmt
,
unsigned
char
**
row
);
static
int
stmt_read_row_buffered
(
MYSQL_STMT
*
stmt
,
unsigned
char
**
row
);
static
int
stmt_read_row_from_cursor
(
MYSQL_STMT
*
stmt
,
unsigned
char
**
row
);
static
int
stmt_read_row_from_cursor
(
MYSQL_STMT
*
stmt
,
unsigned
char
**
row
);
static
int
stmt_read_row_no_data
(
MYSQL_STMT
*
stmt
,
unsigned
char
**
row
);
static
int
stmt_read_row_no_data
(
MYSQL_STMT
*
stmt
,
unsigned
char
**
row
);
static
int
stmt_read_row_no_result_set
(
MYSQL_STMT
*
stmt
,
unsigned
char
**
row
);
/*
/*
This function is used in mysql_stmt_store_result if
This function is used in mysql_stmt_store_result if
...
@@ -2036,7 +2037,7 @@ mysql_stmt_init(MYSQL *mysql)
...
@@ -2036,7 +2037,7 @@ mysql_stmt_init(MYSQL *mysql)
stmt
->
list
.
data
=
stmt
;
stmt
->
list
.
data
=
stmt
;
stmt
->
state
=
MYSQL_STMT_INIT_DONE
;
stmt
->
state
=
MYSQL_STMT_INIT_DONE
;
stmt
->
mysql
=
mysql
;
stmt
->
mysql
=
mysql
;
stmt
->
read_row_func
=
stmt_read_row_no_
data
;
stmt
->
read_row_func
=
stmt_read_row_no_
result_set
;
stmt
->
prefetch_rows
=
DEFAULT_PREFETCH_ROWS
;
stmt
->
prefetch_rows
=
DEFAULT_PREFETCH_ROWS
;
/* The rest of statement members was bzeroed inside malloc */
/* The rest of statement members was bzeroed inside malloc */
...
@@ -2778,6 +2779,13 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
...
@@ -2778,6 +2779,13 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
static
int
static
int
stmt_read_row_no_data
(
MYSQL_STMT
*
stmt
__attribute__
((
unused
)),
stmt_read_row_no_data
(
MYSQL_STMT
*
stmt
__attribute__
((
unused
)),
unsigned
char
**
row
__attribute__
((
unused
)))
unsigned
char
**
row
__attribute__
((
unused
)))
{
return
MYSQL_NO_DATA
;
}
static
int
stmt_read_row_no_result_set
(
MYSQL_STMT
*
stmt
__attribute__
((
unused
)),
unsigned
char
**
row
__attribute__
((
unused
)))
{
{
set_stmt_error
(
stmt
,
CR_NO_RESULT_SET
,
unknown_sqlstate
);
set_stmt_error
(
stmt
,
CR_NO_RESULT_SET
,
unknown_sqlstate
);
return
1
;
return
1
;
...
@@ -4600,7 +4608,8 @@ int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt)
...
@@ -4600,7 +4608,8 @@ int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt)
((
rc
=
stmt_fetch_row
(
stmt
,
row
))
&&
rc
!=
MYSQL_DATA_TRUNCATED
))
((
rc
=
stmt_fetch_row
(
stmt
,
row
))
&&
rc
!=
MYSQL_DATA_TRUNCATED
))
{
{
stmt
->
state
=
MYSQL_STMT_PREPARE_DONE
;
/* XXX: this is buggy */
stmt
->
state
=
MYSQL_STMT_PREPARE_DONE
;
/* XXX: this is buggy */
stmt
->
read_row_func
=
stmt_read_row_no_data
;
stmt
->
read_row_func
=
(
rc
==
MYSQL_NO_DATA
)
?
stmt_read_row_no_data
:
stmt_read_row_no_result_set
;
}
}
else
else
{
{
...
@@ -4937,7 +4946,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags)
...
@@ -4937,7 +4946,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags)
for
(;
param
<
param_end
;
param
++
)
for
(;
param
<
param_end
;
param
++
)
param
->
long_data_used
=
0
;
param
->
long_data_used
=
0
;
}
}
stmt
->
read_row_func
=
stmt_read_row_no_
data
;
stmt
->
read_row_func
=
stmt_read_row_no_
result_set
;
if
(
mysql
)
if
(
mysql
)
{
{
if
((
int
)
stmt
->
state
>
(
int
)
MYSQL_STMT_PREPARE_DONE
)
if
((
int
)
stmt
->
state
>
(
int
)
MYSQL_STMT_PREPARE_DONE
)
...
...
tests/mysql_client_test.c
View file @
00398f5e
...
@@ -13315,7 +13315,7 @@ static void test_bug9992()
...
@@ -13315,7 +13315,7 @@ static void test_bug9992()
DIE_UNLESS
(
rc
==
1
);
/* Got errors, as expected */
DIE_UNLESS
(
rc
==
1
);
/* Got errors, as expected */
if
(
!
opt_silent
)
if
(
!
opt_silent
)
fprintf
(
stdout
,
"Got error,
sa
expected:
\n
[%d] %s
\n
"
,
fprintf
(
stdout
,
"Got error,
as
expected:
\n
[%d] %s
\n
"
,
mysql_errno
(
mysql1
),
mysql_error
(
mysql1
));
mysql_errno
(
mysql1
),
mysql_error
(
mysql1
));
mysql_close
(
mysql1
);
mysql_close
(
mysql1
);
...
@@ -13705,6 +13705,51 @@ static void test_bug11183()
...
@@ -13705,6 +13705,51 @@ static void test_bug11183()
myquery
(
rc
);
myquery
(
rc
);
}
}
static
void
test_bug11037
()
{
MYSQL_STMT
*
stmt
;
int
rc
;
const
char
*
stmt_text
;
myheader
(
"test_bug11037"
);
mysql_query
(
mysql
,
"drop table if exists t1"
);
rc
=
mysql_query
(
mysql
,
"create table t1 (id int not null)"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"insert into t1 values (1)"
);
myquery
(
rc
);
stmt_text
=
"select id FROM t1"
;
stmt
=
mysql_stmt_init
(
mysql
);
rc
=
mysql_stmt_prepare
(
stmt
,
stmt_text
,
strlen
(
stmt_text
));
/* expected error */
rc
=
mysql_stmt_fetch
(
stmt
);
DIE_UNLESS
(
rc
==
1
);
if
(
!
opt_silent
)
fprintf
(
stdout
,
"Got error, as expected:
\n
[%d] %s
\n
"
,
mysql_stmt_errno
(
stmt
),
mysql_stmt_error
(
stmt
));
rc
=
mysql_stmt_execute
(
stmt
);
check_execute
(
stmt
,
rc
);
rc
=
mysql_stmt_fetch
(
stmt
);
DIE_UNLESS
(
rc
==
0
);
rc
=
mysql_stmt_fetch
(
stmt
);
DIE_UNLESS
(
rc
==
MYSQL_NO_DATA
);
rc
=
mysql_stmt_fetch
(
stmt
);
DIE_UNLESS
(
rc
==
MYSQL_NO_DATA
);
mysql_stmt_close
(
stmt
);
rc
=
mysql_query
(
mysql
,
"drop table t1"
);
myquery
(
rc
);
}
/*
/*
Read and parse arguments and MySQL options from my.cnf
Read and parse arguments and MySQL options from my.cnf
*/
*/
...
@@ -13948,6 +13993,7 @@ static struct my_tests_st my_tests[]= {
...
@@ -13948,6 +13993,7 @@ static struct my_tests_st my_tests[]= {
{
"test_bug10214"
,
test_bug10214
},
{
"test_bug10214"
,
test_bug10214
},
{
"test_bug9735"
,
test_bug9735
},
{
"test_bug9735"
,
test_bug9735
},
{
"test_bug11183"
,
test_bug11183
},
{
"test_bug11183"
,
test_bug11183
},
{
"test_bug11037"
,
test_bug11037
},
{
0
,
0
}
{
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