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
cbff55a5
Commit
cbff55a5
authored
Jul 18, 2003
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCRUM
Including client code into embedded library fixes
parent
11de0b35
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
24 deletions
+18
-24
libmysql/libmysql.c
libmysql/libmysql.c
+1
-1
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+3
-0
libmysqld/libmysqld.c
libmysqld/libmysqld.c
+9
-3
sql-common/client.c
sql-common/client.c
+5
-20
No files found.
libmysql/libmysql.c
View file @
cbff55a5
...
...
@@ -3388,7 +3388,7 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
mysql
=
stmt
->
mysql
->
last_used_con
;
int4store
(
buff
,
stmt
->
stmt_id
);
/* Send stmt id to server */
if
(
advanced_command
(
mysql
,
COM_RESET_STMT
,
buff
,
MYSQL_STMT_HEADER
,
0
,
0
,
1
))
if
(
(
*
mysql
->
methods
->
advanced_command
)
(
mysql
,
COM_RESET_STMT
,
buff
,
MYSQL_STMT_HEADER
,
0
,
0
,
1
))
{
set_stmt_errmsg
(
stmt
,
mysql
->
net
.
last_error
,
mysql
->
net
.
last_errno
,
mysql
->
net
.
sqlstate
);
...
...
libmysqld/lib_sql.cc
View file @
cbff55a5
...
...
@@ -38,6 +38,7 @@ static char inited, org_my_init_done;
C_MODE_START
#include <mysql.h>
#include "errmsg.h"
#include <sql_common.h>
static
int
check_connections1
(
THD
*
thd
);
static
int
check_connections2
(
THD
*
thd
);
...
...
@@ -66,8 +67,10 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
/* Clear result variables */
thd
->
clear_error
();
mysql
->
affected_rows
=
~
(
my_ulonglong
)
0
;
mysql
->
field_count
=
0
;
thd
->
store_globals
();
// Fix if more than one connect
free_old_query
(
mysql
);
result
=
dispatch_command
(
command
,
thd
,
(
char
*
)
arg
,
arg_length
+
1
);
if
(
!
skip_check
)
...
...
libmysqld/libmysqld.c
View file @
cbff55a5
...
...
@@ -72,6 +72,8 @@ cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
const
char
*
passwd
,
const
char
*
db
,
uint
port
,
const
char
*
unix_socket
,
ulong
client_flag
);
void
STDCALL
cli_mysql_close
(
MYSQL
*
mysql
);
#ifdef HAVE_GETPWUID
struct
passwd
*
getpwuid
(
uid_t
);
char
*
getlogin
(
void
);
...
...
@@ -166,14 +168,12 @@ static inline int mysql_init_charset(MYSQL *mysql)
** before calling mysql_real_connect !
*/
static
void
STDCALL
emb_mysql_close
(
MYSQL
*
mysql
);
static
my_bool
STDCALL
emb_mysql_read_query_result
(
MYSQL
*
mysql
);
static
MYSQL_RES
*
STDCALL
emb_mysql_store_result
(
MYSQL
*
mysql
);
static
MYSQL_RES
*
STDCALL
emb_mysql_use_result
(
MYSQL
*
mysql
);
static
MYSQL_METHODS
embedded_methods
=
{
emb_mysql_close
,
emb_mysql_read_query_result
,
emb_advanced_command
,
emb_mysql_store_result
,
...
...
@@ -276,9 +276,15 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
** If handle is alloced by mysql connect free it.
*************************************************************************/
static
void
STDCALL
emb_
mysql_close
(
MYSQL
*
mysql
)
void
STDCALL
mysql_close
(
MYSQL
*
mysql
)
{
DBUG_ENTER
(
"mysql_close"
);
if
(
mysql
->
methods
!=
&
embedded_methods
)
{
cli_mysql_close
(
mysql
);
DBUG_VOID_RETURN
;
}
if
(
mysql
)
/* Some simple safety */
{
my_free
(
mysql
->
options
.
user
,
MYF
(
MY_ALLOW_ZERO_PTR
));
...
...
sql-common/client.c
View file @
cbff55a5
...
...
@@ -48,12 +48,14 @@
#endif
#define CLI_MYSQL_REAL_CONNECT cli_mysql_real_connect
#define CLI_MYSQL_CLOSE cli_mysql_close
#undef net_flush
my_bool
net_flush
(
NET
*
net
);
#else
/*EMBEDDED_LIBRARY*/
#define CLI_MYSQL_REAL_CONNECT mysql_real_connect
#define CLI_MYSQL_CLOSE mysql_close
#endif
/*EMBEDDED_LIBRARY*/
#if !defined(MYSQL_SERVER) && (defined(__WIN__) || defined(_WIN32) || defined(_WIN64))
...
...
@@ -965,26 +967,11 @@ void mysql_read_default_options(struct st_mysql_options *options,
void
fetch_lengths
(
ulong
*
to
,
MYSQL_ROW
column
,
uint
field_count
)
{
ulong
*
prev_length
;
byte
*
start
=
0
;
MYSQL_ROW
end
;
prev_length
=
0
;
/* Keep gcc happy */
for
(
end
=
column
+
field_count
+
1
;
column
!=
end
;
column
++
,
to
++
)
{
if
(
!*
column
)
{
*
to
=
0
;
/* Null */
continue
;
}
if
(
start
)
/* Found end of prev string */
*
prev_length
=
(
ulong
)
(
*
column
-
start
-
1
);
start
=
*
column
;
prev_length
=
to
;
}
for
(
end
=
column
+
field_count
;
column
!=
end
;
column
++
,
to
++
)
*
to
=
*
column
?
strlen
(
*
column
)
:
0
;
}
/***************************************************************************
Change field rows to field structs
***************************************************************************/
...
...
@@ -1422,14 +1409,12 @@ my_bool mysql_autenticate(MYSQL *mysql, const char *passwd)
before calling mysql_real_connect !
*/
static
void
STDCALL
cli_mysql_close
(
MYSQL
*
mysql
);
static
my_bool
STDCALL
cli_mysql_read_query_result
(
MYSQL
*
mysql
);
static
MYSQL_RES
*
STDCALL
cli_mysql_store_result
(
MYSQL
*
mysql
);
static
MYSQL_RES
*
STDCALL
cli_mysql_use_result
(
MYSQL
*
mysql
);
static
MYSQL_METHODS
client_methods
=
{
cli_mysql_close
,
cli_mysql_read_query_result
,
cli_advanced_command
,
cli_mysql_store_result
,
...
...
@@ -2140,7 +2125,7 @@ static void mysql_close_free(MYSQL *mysql)
}
static
void
STDCALL
cli_mysql_close
(
MYSQL
*
mysql
)
void
STDCALL
CLI_MYSQL_CLOSE
(
MYSQL
*
mysql
)
{
DBUG_ENTER
(
"mysql_close"
);
if
(
mysql
)
/* Some simple safety */
...
...
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