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
418dffe2
Commit
418dffe2
authored
May 21, 2004
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.3744
parents
cb07a07e
0379682e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
13 deletions
+28
-13
client/mysql.cc
client/mysql.cc
+7
-1
libmysqld/embedded_priv.h
libmysqld/embedded_priv.h
+1
-0
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+19
-12
libmysqld/libmysqld.c
libmysqld/libmysqld.c
+1
-0
No files found.
client/mysql.cc
View file @
418dffe2
...
@@ -371,10 +371,16 @@ int main(int argc,char *argv[])
...
@@ -371,10 +371,16 @@ int main(int argc,char *argv[])
!
(
status
.
line_buff
=
batch_readline_init
(
max_allowed_packet
+
512
,
stdin
)))
!
(
status
.
line_buff
=
batch_readline_init
(
max_allowed_packet
+
512
,
stdin
)))
{
{
free_defaults
(
defaults_argv
);
free_defaults
(
defaults_argv
);
my_end
(
0
);
exit
(
1
);
}
if
(
mysql_server_init
(
0
,
NULL
,
(
char
**
)
server_default_groups
))
{
free_defaults
(
defaults_argv
);
my_end
(
0
);
exit
(
1
);
exit
(
1
);
}
}
glob_buffer
.
realloc
(
512
);
glob_buffer
.
realloc
(
512
);
mysql_server_init
(
0
,
NULL
,
(
char
**
)
server_default_groups
);
completion_hash_init
(
&
ht
,
128
);
completion_hash_init
(
&
ht
,
128
);
init_alloc_root
(
&
hash_mem_root
,
16384
,
0
);
init_alloc_root
(
&
hash_mem_root
,
16384
,
0
);
bzero
((
char
*
)
&
mysql
,
sizeof
(
mysql
));
bzero
((
char
*
)
&
mysql
,
sizeof
(
mysql
));
...
...
libmysqld/embedded_priv.h
View file @
418dffe2
...
@@ -28,5 +28,6 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db);
...
@@ -28,5 +28,6 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db);
void
*
create_embedded_thd
(
int
client_flag
,
char
*
db
);
void
*
create_embedded_thd
(
int
client_flag
,
char
*
db
);
int
check_embedded_connection
(
MYSQL
*
mysql
);
int
check_embedded_connection
(
MYSQL
*
mysql
);
void
free_old_query
(
MYSQL
*
mysql
);
void
free_old_query
(
MYSQL
*
mysql
);
void
embedded_get_error
(
MYSQL
*
mysql
);
extern
MYSQL_METHODS
embedded_methods
;
extern
MYSQL_METHODS
embedded_methods
;
C_MODE_END
C_MODE_END
libmysqld/lib_sql.cc
View file @
418dffe2
...
@@ -42,6 +42,22 @@ C_MODE_START
...
@@ -42,6 +42,22 @@ C_MODE_START
#include "errmsg.h"
#include "errmsg.h"
#include <sql_common.h>
#include <sql_common.h>
void
embedded_get_error
(
MYSQL
*
mysql
)
{
THD
*
thd
=
(
THD
*
)
mysql
->
thd
;
NET
*
net
=
&
mysql
->
net
;
if
((
net
->
last_errno
=
thd
->
net
.
last_errno
))
{
memcpy
(
net
->
last_error
,
thd
->
net
.
last_error
,
sizeof
(
net
->
last_error
));
memcpy
(
net
->
sqlstate
,
thd
->
net
.
sqlstate
,
sizeof
(
net
->
sqlstate
));
}
else
{
net
->
last_error
[
0
]
=
0
;
strmov
(
net
->
sqlstate
,
not_error_sqlstate
);
}
}
static
my_bool
static
my_bool
emb_advanced_command
(
MYSQL
*
mysql
,
enum
enum_server_command
command
,
emb_advanced_command
(
MYSQL
*
mysql
,
enum
enum_server_command
command
,
const
char
*
header
,
ulong
header_length
,
const
char
*
header
,
ulong
header_length
,
...
@@ -86,16 +102,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
...
@@ -86,16 +102,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
if
(
!
skip_check
)
if
(
!
skip_check
)
result
=
thd
->
net
.
last_errno
?
-
1
:
0
;
result
=
thd
->
net
.
last_errno
?
-
1
:
0
;
if
((
net
->
last_errno
=
thd
->
net
.
last_errno
))
embedded_get_error
(
mysql
);
{
memcpy
(
net
->
last_error
,
thd
->
net
.
last_error
,
sizeof
(
net
->
last_error
));
memcpy
(
net
->
sqlstate
,
thd
->
net
.
sqlstate
,
sizeof
(
net
->
sqlstate
));
}
else
{
net
->
last_error
[
0
]
=
0
;
strmov
(
net
->
sqlstate
,
not_error_sqlstate
);
}
mysql
->
server_status
=
thd
->
server_status
;
mysql
->
server_status
=
thd
->
server_status
;
mysql
->
warning_count
=
((
THD
*
)
mysql
->
thd
)
->
total_warn_count
;
mysql
->
warning_count
=
((
THD
*
)
mysql
->
thd
)
->
total_warn_count
;
return
result
;
return
result
;
...
@@ -239,6 +246,7 @@ static void emb_free_embedded_thd(MYSQL *mysql)
...
@@ -239,6 +246,7 @@ static void emb_free_embedded_thd(MYSQL *mysql)
free_rows
(
thd
->
data
);
free_rows
(
thd
->
data
);
thread_count
--
;
thread_count
--
;
delete
thd
;
delete
thd
;
mysql
->
thd
=
0
;
}
}
static
const
char
*
emb_read_statistics
(
MYSQL
*
mysql
)
static
const
char
*
emb_read_statistics
(
MYSQL
*
mysql
)
...
@@ -498,8 +506,7 @@ int check_embedded_connection(MYSQL *mysql)
...
@@ -498,8 +506,7 @@ int check_embedded_connection(MYSQL *mysql)
thd
->
host
=
(
char
*
)
my_localhost
;
thd
->
host
=
(
char
*
)
my_localhost
;
thd
->
host_or_ip
=
thd
->
host
;
thd
->
host_or_ip
=
thd
->
host
;
thd
->
user
=
my_strdup
(
mysql
->
user
,
MYF
(
0
));
thd
->
user
=
my_strdup
(
mysql
->
user
,
MYF
(
0
));
check_user
(
thd
,
COM_CONNECT
,
NULL
,
0
,
thd
->
db
,
true
);
return
check_user
(
thd
,
COM_CONNECT
,
NULL
,
0
,
thd
->
db
,
true
);
return
0
;
}
}
#else
#else
...
...
libmysqld/libmysqld.c
View file @
418dffe2
...
@@ -232,6 +232,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
...
@@ -232,6 +232,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
DBUG_RETURN
(
mysql
);
DBUG_RETURN
(
mysql
);
error:
error:
embedded_get_error
(
mysql
);
DBUG_PRINT
(
"error"
,(
"message: %u (%s)"
,
mysql
->
net
.
last_errno
,
DBUG_PRINT
(
"error"
,(
"message: %u (%s)"
,
mysql
->
net
.
last_errno
,
mysql
->
net
.
last_error
));
mysql
->
net
.
last_error
));
{
{
...
...
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