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
cda32e12
Commit
cda32e12
authored
Sep 19, 2003
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCRUM
prepared statements in embedded library. some fixes after testing
parent
e89e3ff7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
16 deletions
+46
-16
include/mysql.h
include/mysql.h
+3
-0
libmysql/client_settings.h
libmysql/client_settings.h
+1
-0
libmysql/libmysql.c
libmysql/libmysql.c
+12
-4
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+24
-4
sql-common/client.c
sql-common/client.c
+6
-3
sql/client_settings.h
sql/client_settings.h
+0
-5
No files found.
include/mysql.h
View file @
cda32e12
...
@@ -557,10 +557,13 @@ typedef struct st_mysql_methods
...
@@ -557,10 +557,13 @@ typedef struct st_mysql_methods
MYSQL_RES
*
(
STDCALL
*
use_result
)(
MYSQL
*
mysql
);
MYSQL_RES
*
(
STDCALL
*
use_result
)(
MYSQL
*
mysql
);
void
(
STDCALL
*
fetch_lengths
)(
unsigned
long
*
to
,
void
(
STDCALL
*
fetch_lengths
)(
unsigned
long
*
to
,
MYSQL_ROW
column
,
unsigned
int
field_count
);
MYSQL_ROW
column
,
unsigned
int
field_count
);
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
MYSQL_FIELD
*
(
STDCALL
*
list_fields
)(
MYSQL
*
mysql
);
MYSQL_FIELD
*
(
STDCALL
*
list_fields
)(
MYSQL
*
mysql
);
my_bool
(
STDCALL
*
read_prepare_result
)(
MYSQL
*
mysql
,
MYSQL_STMT
*
stmt
);
my_bool
(
STDCALL
*
read_prepare_result
)(
MYSQL
*
mysql
,
MYSQL_STMT
*
stmt
);
int
(
STDCALL
*
stmt_execute
)(
MYSQL_STMT
*
stmt
);
int
(
STDCALL
*
stmt_execute
)(
MYSQL_STMT
*
stmt
);
MYSQL_DATA
*
(
STDCALL
*
read_binary_rows
)(
MYSQL_STMT
*
stmt
);
MYSQL_DATA
*
(
STDCALL
*
read_binary_rows
)(
MYSQL_STMT
*
stmt
);
int
(
STDCALL
*
unbuffered_fetch
)(
MYSQL
*
mysql
,
char
**
row
);
#endif
}
MYSQL_METHODS
;
}
MYSQL_METHODS
;
...
...
libmysql/client_settings.h
View file @
cda32e12
...
@@ -56,3 +56,4 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
...
@@ -56,3 +56,4 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
uint
fields
);
uint
fields
);
int
STDCALL
cli_stmt_execute
(
MYSQL_STMT
*
stmt
);
int
STDCALL
cli_stmt_execute
(
MYSQL_STMT
*
stmt
);
MYSQL_DATA
*
cli_read_binary_rows
(
MYSQL_STMT
*
stmt
);
MYSQL_DATA
*
cli_read_binary_rows
(
MYSQL_STMT
*
stmt
);
int
STDCALL
cli_unbuffered_fetch
(
MYSQL
*
mysql
,
char
**
row
);
libmysql/libmysql.c
View file @
cda32e12
...
@@ -2965,6 +2965,14 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row)
...
@@ -2965,6 +2965,14 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row)
return
0
;
return
0
;
}
}
int
STDCALL
cli_unbuffered_fetch
(
MYSQL
*
mysql
,
char
**
row
)
{
if
(
packet_error
==
net_safe_read
(
mysql
))
return
1
;
*
row
=
(
mysql
->
net
.
read_pos
[
0
]
==
254
)
?
NULL
:
(
mysql
->
net
.
read_pos
+
1
);
return
0
;
}
/*
/*
Fetch and return row data to bound buffers, if any
Fetch and return row data to bound buffers, if any
...
@@ -2994,20 +3002,20 @@ int STDCALL mysql_fetch(MYSQL_STMT *stmt)
...
@@ -2994,20 +3002,20 @@ int STDCALL mysql_fetch(MYSQL_STMT *stmt)
}
}
else
/* un-buffered */
else
/* un-buffered */
{
{
if
(
packet_error
==
net_safe_read
(
mysql
))
if
((
*
mysql
->
methods
->
unbuffered_fetch
)(
mysql
,
(
char
**
)
&
row
))
{
{
set_stmt_errmsg
(
stmt
,
mysql
->
net
.
last_error
,
mysql
->
net
.
last_errno
,
set_stmt_errmsg
(
stmt
,
mysql
->
net
.
last_error
,
mysql
->
net
.
last_errno
,
mysql
->
net
.
sqlstate
);
mysql
->
net
.
sqlstate
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
if
(
mysql
->
net
.
read_pos
[
0
]
==
254
)
if
(
!
row
)
{
{
mysql
->
status
=
MYSQL_STATUS_READY
;
mysql
->
status
=
MYSQL_STATUS_READY
;
stmt
->
current_row
=
0
;
stmt
->
current_row
=
0
;
goto
no_data
;
goto
no_data
;
}
}
row
=
mysql
->
net
.
read_pos
+
1
;
}
}
stmt
->
current_row
=
row
;
stmt
->
current_row
=
row
;
DBUG_RETURN
(
stmt_fetch_row
(
stmt
,
row
));
DBUG_RETURN
(
stmt_fetch_row
(
stmt
,
row
));
...
...
libmysqld/lib_sql.cc
View file @
cda32e12
...
@@ -195,6 +195,26 @@ MYSQL_DATA *emb_read_binary_rows(MYSQL_STMT *stmt)
...
@@ -195,6 +195,26 @@ MYSQL_DATA *emb_read_binary_rows(MYSQL_STMT *stmt)
return
emb_read_rows
(
stmt
->
mysql
,
0
,
0
);
return
emb_read_rows
(
stmt
->
mysql
,
0
,
0
);
}
}
int
STDCALL
emb_unbuffered_fetch
(
MYSQL
*
mysql
,
char
**
row
)
{
MYSQL_DATA
*
data
=
((
THD
*
)
mysql
->
thd
)
->
data
;
if
(
!
data
||
!
data
->
data
)
{
*
row
=
NULL
;
if
(
data
)
{
free_rows
(
data
);
((
THD
*
)
mysql
->
thd
)
->
data
=
NULL
;
}
}
else
{
*
row
=
(
char
*
)
data
->
data
->
data
;
data
->
data
=
data
->
data
->
next
;
}
return
0
;
}
MYSQL_METHODS
embedded_methods
=
MYSQL_METHODS
embedded_methods
=
{
{
emb_mysql_read_query_result
,
emb_mysql_read_query_result
,
...
@@ -205,7 +225,8 @@ MYSQL_METHODS embedded_methods=
...
@@ -205,7 +225,8 @@ MYSQL_METHODS embedded_methods=
emb_list_fields
,
emb_list_fields
,
emb_read_prepare_result
,
emb_read_prepare_result
,
emb_stmt_execute
,
emb_stmt_execute
,
emb_read_binary_rows
emb_read_binary_rows
,
emb_unbuffered_fetch
};
};
C_MODE_END
C_MODE_END
...
@@ -561,9 +582,8 @@ bool Protocol_prep::write()
...
@@ -561,9 +582,8 @@ bool Protocol_prep::write()
*
data
->
prev_ptr
=
cur
;
*
data
->
prev_ptr
=
cur
;
data
->
prev_ptr
=
&
cur
->
next
;
data
->
prev_ptr
=
&
cur
->
next
;
next_field
=
cur
->
data
;
cur
->
next
=
0
;
next_mysql_field
=
thd
->
mysql
->
fields
;
return
false
;
return
false
;
}
}
...
...
sql-common/client.c
View file @
cda32e12
...
@@ -1405,11 +1405,14 @@ static MYSQL_METHODS client_methods=
...
@@ -1405,11 +1405,14 @@ static MYSQL_METHODS client_methods=
cli_advanced_command
,
cli_advanced_command
,
cli_read_rows
,
cli_read_rows
,
cli_mysql_use_result
,
cli_mysql_use_result
,
cli_fetch_lengths
,
cli_fetch_lengths
cli_list_fields
,
#ifndef MYSQL_SERVER
,
cli_list_fields
,
cli_read_prepare_result
,
cli_read_prepare_result
,
cli_stmt_execute
,
cli_stmt_execute
,
cli_read_binary_rows
cli_read_binary_rows
,
cli_unbuffered_fetch
#endif
};
};
MYSQL
*
STDCALL
MYSQL
*
STDCALL
...
...
sql/client_settings.h
View file @
cda32e12
...
@@ -32,8 +32,3 @@
...
@@ -32,8 +32,3 @@
#undef HAVE_SMEM
#undef HAVE_SMEM
#undef _CUSTOMCONFIG_
#undef _CUSTOMCONFIG_
#define cli_list_fields NULL
#define cli_read_prepare_result NULL
#define cli_stmt_execute NULL
#define cli_read_binary_rows NULL
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