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
7dd4cb58
Commit
7dd4cb58
authored
Sep 18, 2003
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCRUM
prepared statements in embedded library
parent
ccc28f46
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
9 deletions
+15
-9
include/mysql_com.h
include/mysql_com.h
+1
-1
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+10
-3
libmysqld/libmysqld.c
libmysqld/libmysqld.c
+0
-2
sql/protocol.cc
sql/protocol.cc
+3
-1
sql/protocol.h
sql/protocol.h
+1
-0
sql/sql_prepare.cc
sql/sql_prepare.cc
+0
-2
No files found.
include/mysql_com.h
View file @
7dd4cb58
...
@@ -245,7 +245,7 @@ my_bool net_realloc(NET *net, unsigned long length);
...
@@ -245,7 +245,7 @@ my_bool net_realloc(NET *net, unsigned long length);
#ifndef EMBEDDED_LIBRARY
/* To be removed by HF */
#ifndef EMBEDDED_LIBRARY
/* To be removed by HF */
my_bool
net_flush
(
NET
*
net
);
my_bool
net_flush
(
NET
*
net
);
#else
#else
#define net_flush(A)
#define net_flush(A)
((my_bool)0)
#endif
#endif
my_bool
my_net_write
(
NET
*
net
,
const
char
*
packet
,
unsigned
long
len
);
my_bool
my_net_write
(
NET
*
net
,
const
char
*
packet
,
unsigned
long
len
);
...
...
libmysqld/lib_sql.cc
View file @
7dd4cb58
...
@@ -80,6 +80,12 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
...
@@ -80,6 +80,12 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
client). So we have to call free_old_query here
client). So we have to call free_old_query here
*/
*/
free_old_query
(
mysql
);
free_old_query
(
mysql
);
if
(
!
arg
)
{
arg
=
header
;
arg_length
=
header_length
;
}
result
=
dispatch_command
(
command
,
thd
,
(
char
*
)
arg
,
arg_length
+
1
);
result
=
dispatch_command
(
command
,
thd
,
(
char
*
)
arg
,
arg_length
+
1
);
if
(
!
skip_check
)
if
(
!
skip_check
)
...
@@ -136,6 +142,7 @@ static my_bool STDCALL emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
...
@@ -136,6 +142,7 @@ static my_bool STDCALL emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
stmt
->
fields
=
mysql
->
fields
;
stmt
->
fields
=
mysql
->
fields
;
stmt
->
mem_root
=
mysql
->
field_alloc
;
stmt
->
mem_root
=
mysql
->
field_alloc
;
mysql
->
fields
=
NULL
;
}
}
return
0
;
return
0
;
...
@@ -550,7 +557,7 @@ bool Protocol_prep::write()
...
@@ -550,7 +557,7 @@ bool Protocol_prep::write()
return
true
;
return
true
;
}
}
cur
->
data
=
(
MYSQL_ROW
)(((
char
*
)
cur
)
+
sizeof
(
MYSQL_ROWS
));
cur
->
data
=
(
MYSQL_ROW
)(((
char
*
)
cur
)
+
sizeof
(
MYSQL_ROWS
));
memcpy
(
cur
->
data
,
packet
->
ptr
()
,
packet
->
length
()
);
memcpy
(
cur
->
data
,
packet
->
ptr
()
+
1
,
packet
->
length
()
-
1
);
*
data
->
prev_ptr
=
cur
;
*
data
->
prev_ptr
=
cur
;
data
->
prev_ptr
=
&
cur
->
next
;
data
->
prev_ptr
=
&
cur
->
next
;
...
@@ -674,7 +681,7 @@ bool setup_params_data(st_prep_stmt *stmt)
...
@@ -674,7 +681,7 @@ bool setup_params_data(st_prep_stmt *stmt)
setup_param_functions
(
param
,
client_param
->
buffer_type
);
setup_param_functions
(
param
,
client_param
->
buffer_type
);
if
(
!
param
->
long_data_supplied
)
if
(
!
param
->
long_data_supplied
)
{
{
if
(
client_param
->
is_null
)
if
(
*
client_param
->
is_null
)
param
->
maybe_null
=
param
->
null_value
=
1
;
param
->
maybe_null
=
param
->
null_value
=
1
;
else
else
{
{
...
@@ -712,7 +719,7 @@ bool setup_params_data_withlog(st_prep_stmt *stmt)
...
@@ -712,7 +719,7 @@ bool setup_params_data_withlog(st_prep_stmt *stmt)
else
else
{
{
if
(
client_param
->
is_null
)
if
(
*
client_param
->
is_null
)
{
{
param
->
maybe_null
=
param
->
null_value
=
1
;
param
->
maybe_null
=
param
->
null_value
=
1
;
res
=
&
null_string
;
res
=
&
null_string
;
...
...
libmysqld/libmysqld.c
View file @
7dd4cb58
...
@@ -47,8 +47,6 @@
...
@@ -47,8 +47,6 @@
#define INADDR_NONE -1
#define INADDR_NONE -1
#endif
#endif
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_TRANSACTIONS | CLIENT_PROTOCOL_41)
#if defined(MSDOS) || defined(__WIN__)
#if defined(MSDOS) || defined(__WIN__)
#define ERRNO WSAGetLastError()
#define ERRNO WSAGetLastError()
#define perror(A)
#define perror(A)
...
...
sql/protocol.cc
View file @
7dd4cb58
...
@@ -28,6 +28,9 @@
...
@@ -28,6 +28,9 @@
#ifndef EMBEDDED_LIBRARY
#ifndef EMBEDDED_LIBRARY
bool
Protocol
::
net_store_data
(
const
char
*
from
,
uint
length
)
bool
Protocol
::
net_store_data
(
const
char
*
from
,
uint
length
)
#else
bool
Protocol_prep
::
net_store_data
(
const
char
*
from
,
uint
length
)
#endif
{
{
ulong
packet_length
=
packet
->
length
();
ulong
packet_length
=
packet
->
length
();
/*
/*
...
@@ -43,7 +46,6 @@ bool Protocol::net_store_data(const char *from, uint length)
...
@@ -43,7 +46,6 @@ bool Protocol::net_store_data(const char *from, uint length)
packet
->
length
((
uint
)
(
to
+
length
-
packet
->
ptr
()));
packet
->
length
((
uint
)
(
to
+
length
-
packet
->
ptr
()));
return
0
;
return
0
;
}
}
#endif
/* Send a error string to client */
/* Send a error string to client */
...
...
sql/protocol.h
View file @
7dd4cb58
...
@@ -127,6 +127,7 @@ public:
...
@@ -127,6 +127,7 @@ public:
virtual
void
prepare_for_resend
();
virtual
void
prepare_for_resend
();
#ifdef EMBEDDED_LIBRARY
#ifdef EMBEDDED_LIBRARY
virtual
bool
write
();
virtual
bool
write
();
bool
net_store_data
(
const
char
*
from
,
uint
length
);
#endif
#endif
virtual
bool
store_null
();
virtual
bool
store_null
();
virtual
bool
store_tiny
(
longlong
from
);
virtual
bool
store_tiny
(
longlong
from
);
...
...
sql/sql_prepare.cc
View file @
7dd4cb58
...
@@ -666,13 +666,11 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
...
@@ -666,13 +666,11 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
wild_num
,
conds
,
og_num
,
order
,
group
,
having
,
proc
,
wild_num
,
conds
,
og_num
,
order
,
group
,
having
,
proc
,
select_lex
,
unit
,
0
))
select_lex
,
unit
,
0
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
#ifndef EMBEDDED_LIBRARY
if
(
send_prep_stmt
(
stmt
,
fields
.
elements
)
||
if
(
send_prep_stmt
(
stmt
,
fields
.
elements
)
||
thd
->
protocol_simple
.
send_fields
(
&
fields
,
0
)
||
thd
->
protocol_simple
.
send_fields
(
&
fields
,
0
)
||
net_flush
(
&
thd
->
net
)
||
net_flush
(
&
thd
->
net
)
||
send_item_params
(
stmt
))
send_item_params
(
stmt
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
#endif
join
->
cleanup
();
join
->
cleanup
();
}
}
DBUG_RETURN
(
0
);
DBUG_RETURN
(
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