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
b727a22d
Commit
b727a22d
authored
Feb 27, 2008
by
holyfoot/hf@hfmain.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/hf/work/25097/my50-25097
into mysql.com:/home/hf/work/25097/my51-25097
parents
947529ac
140ca595
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
17 deletions
+35
-17
client/mysql.cc
client/mysql.cc
+1
-0
include/sql_common.h
include/sql_common.h
+1
-0
libmysql/libmysql.c
libmysql/libmysql.c
+1
-1
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+10
-0
sql-common/client.c
sql-common/client.c
+21
-7
sql/log.cc
sql/log.cc
+1
-9
No files found.
client/mysql.cc
View file @
b727a22d
...
...
@@ -421,6 +421,7 @@ int main(int argc,char *argv[])
if
(
mysql_server_init
(
embedded_server_arg_count
,
embedded_server_args
,
(
char
**
)
embedded_server_groups
))
{
put_error
(
NULL
);
free_defaults
(
defaults_argv
);
my_end
(
0
);
exit
(
1
);
...
...
include/sql_common.h
View file @
b727a22d
...
...
@@ -15,6 +15,7 @@
extern
const
char
*
unknown_sqlstate
;
extern
const
char
*
cant_connect_sqlstate
;
extern
const
char
*
not_error_sqlstate
;
#ifdef __cplusplus
...
...
libmysql/libmysql.c
View file @
b727a22d
...
...
@@ -1500,7 +1500,7 @@ my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql)
const
char
*
STDCALL
mysql_sqlstate
(
MYSQL
*
mysql
)
{
return
mysql
->
net
.
sqlstate
;
return
mysql
?
mysql
->
net
.
sqlstate
:
cant_connect_
sqlstate
;
}
uint
STDCALL
mysql_warning_count
(
MYSQL
*
mysql
)
...
...
libmysqld/lib_sql.cc
View file @
b727a22d
...
...
@@ -38,6 +38,8 @@ C_MODE_START
#include <sql_common.h>
#include "embedded_priv.h"
extern
unsigned
int
mysql_server_last_errno
;
extern
char
mysql_server_last_error
[
MYSQL_ERRMSG_SIZE
];
static
my_bool
emb_read_query_result
(
MYSQL
*
mysql
);
...
...
@@ -1115,3 +1117,11 @@ bool Protocol::net_store_data(const uchar *from, size_t length)
return
FALSE
;
}
void
vprint_msg_to_log
(
enum
loglevel
level
__attribute__
((
unused
)),
const
char
*
format
,
va_list
argsi
)
{
vsnprintf
(
mysql_server_last_error
,
sizeof
(
mysql_server_last_error
),
format
,
argsi
);
mysql_server_last_errno
=
CR_UNKNOWN_ERROR
;
}
sql-common/client.c
View file @
b727a22d
...
...
@@ -112,6 +112,7 @@ uint mysql_port=0;
char
*
mysql_unix_port
=
0
;
const
char
*
unknown_sqlstate
=
"HY000"
;
const
char
*
not_error_sqlstate
=
"00000"
;
const
char
*
cant_connect_sqlstate
=
"08001"
;
#ifdef HAVE_SMEM
char
*
shared_memory_base_name
=
0
;
const
char
*
def_shared_memory_base_name
=
default_shared_memory_base_name
;
...
...
@@ -126,6 +127,9 @@ static int wait_for_data(my_socket fd, uint timeout);
CHARSET_INFO
*
default_client_charset_info
=
&
my_charset_latin1
;
/* Server error code and message */
unsigned
int
mysql_server_last_errno
;
char
mysql_server_last_error
[
MYSQL_ERRMSG_SIZE
];
/****************************************************************************
A modified version of connect(). my_connect() allows you to specify
...
...
@@ -288,11 +292,18 @@ void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate)
DBUG_PRINT
(
"enter"
,
(
"error :%d '%s'"
,
errcode
,
ER
(
errcode
)));
DBUG_ASSERT
(
mysql
!=
0
);
net
=
&
mysql
->
net
;
net
->
client_last_errno
=
errcode
;
strmov
(
net
->
client_last_error
,
ER
(
errcode
));
strmov
(
net
->
sqlstate
,
sqlstate
);
if
(
mysql
)
{
net
=
&
mysql
->
net
;
net
->
client_last_errno
=
errcode
;
strmov
(
net
->
client_last_error
,
ER
(
errcode
));
strmov
(
net
->
sqlstate
,
sqlstate
);
}
else
{
mysql_server_last_errno
=
errcode
;
strmov
(
mysql_server_last_error
,
ER
(
errcode
));
}
DBUG_VOID_RETURN
;
}
...
...
@@ -1489,7 +1500,10 @@ mysql_init(MYSQL *mysql)
if
(
!
mysql
)
{
if
(
!
(
mysql
=
(
MYSQL
*
)
my_malloc
(
sizeof
(
*
mysql
),
MYF
(
MY_WME
|
MY_ZEROFILL
))))
{
set_mysql_error
(
NULL
,
CR_OUT_OF_MEMORY
,
unknown_sqlstate
);
return
0
;
}
mysql
->
free_me
=
1
;
}
else
...
...
@@ -3079,13 +3093,13 @@ unsigned int STDCALL mysql_num_fields(MYSQL_RES *res)
uint
STDCALL
mysql_errno
(
MYSQL
*
mysql
)
{
return
mysql
->
net
.
client
_last_errno
;
return
mysql
?
mysql
->
net
.
client_last_errno
:
mysql_server
_last_errno
;
}
const
char
*
STDCALL
mysql_error
(
MYSQL
*
mysql
)
{
return
mysql
->
net
.
client
_last_error
;
return
mysql
?
mysql
->
net
.
client_last_error
:
mysql_server
_last_error
;
}
...
...
sql/log.cc
View file @
b727a22d
...
...
@@ -4378,15 +4378,7 @@ static void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
return an error (e.g. logging to the log tables)
*/
#ifdef EMBEDDED_LIBRARY
int
vprint_msg_to_log
(
enum
loglevel
level
__attribute__
((
unused
)),
const
char
*
format
__attribute__
((
unused
)),
va_list
argsi
__attribute__
((
unused
)))
{
DBUG_ENTER
(
"vprint_msg_to_log"
);
DBUG_RETURN
(
0
);
}
#else
/*!EMBEDDED_LIBRARY*/
#ifndef EMBEDDED_LIBRARY
static
void
print_buffer_to_file
(
enum
loglevel
level
,
const
char
*
buffer
)
{
time_t
skr
;
...
...
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