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
e5c2b42d
Commit
e5c2b42d
authored
Feb 11, 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.2208
parents
f8f0c212
d7e3b89c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
12 deletions
+50
-12
include/mysql.h
include/mysql.h
+1
-0
libmysql/client_settings.h
libmysql/client_settings.h
+1
-0
libmysql/libmysql.c
libmysql/libmysql.c
+16
-9
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+19
-1
sql/sql_class.h
sql/sql_class.h
+2
-0
sql/sql_parse.cc
sql/sql_parse.cc
+11
-2
No files found.
include/mysql.h
View file @
e5c2b42d
...
...
@@ -575,6 +575,7 @@ typedef struct st_mysql_methods
int
(
*
unbuffered_fetch
)(
MYSQL
*
mysql
,
char
**
row
);
void
(
*
free_embedded_thd
)(
MYSQL
*
mysql
);
const
char
*
(
*
read_statistic
)(
MYSQL
*
mysql
);
int
(
*
next_result
)(
MYSQL
*
mysql
);
#endif
}
MYSQL_METHODS
;
...
...
libmysql/client_settings.h
View file @
e5c2b42d
...
...
@@ -58,6 +58,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt);
MYSQL_DATA
*
cli_read_binary_rows
(
MYSQL_STMT
*
stmt
);
int
cli_unbuffered_fetch
(
MYSQL
*
mysql
,
char
**
row
);
const
char
*
cli_read_statistic
(
MYSQL
*
mysql
);
int
cli_next_result
(
MYSQL
*
mysql
);
#ifdef EMBEDDED_LIBRARY
int
init_embedded_server
(
int
argc
,
char
**
argv
,
char
**
groups
);
...
...
libmysql/libmysql.c
View file @
e5c2b42d
...
...
@@ -3511,6 +3511,21 @@ my_bool STDCALL mysql_more_results(MYSQL *mysql)
Reads and returns the next query results
*/
int
cli_next_result
(
MYSQL
*
mysql
)
{
DBUG_ENTER
(
"cli_next_result"
);
mysql
->
net
.
last_error
[
0
]
=
0
;
mysql
->
net
.
last_errno
=
0
;
strmov
(
mysql
->
net
.
sqlstate
,
not_error_sqlstate
);
mysql
->
affected_rows
=
~
(
my_ulonglong
)
0
;
if
(
mysql
->
last_used_con
->
server_status
&
SERVER_MORE_RESULTS_EXISTS
)
DBUG_RETURN
((
*
mysql
->
methods
->
read_query_result
)(
mysql
));
DBUG_RETURN
(
-
1
);
/* No more results */
}
int
STDCALL
mysql_next_result
(
MYSQL
*
mysql
)
{
DBUG_ENTER
(
"mysql_next_result"
);
...
...
@@ -3523,15 +3538,7 @@ int STDCALL mysql_next_result(MYSQL *mysql)
DBUG_RETURN
(
1
);
}
mysql
->
net
.
last_error
[
0
]
=
0
;
mysql
->
net
.
last_errno
=
0
;
strmov
(
mysql
->
net
.
sqlstate
,
not_error_sqlstate
);
mysql
->
affected_rows
=
~
(
my_ulonglong
)
0
;
if
(
mysql
->
last_used_con
->
server_status
&
SERVER_MORE_RESULTS_EXISTS
)
DBUG_RETURN
((
*
mysql
->
methods
->
read_query_result
)(
mysql
));
DBUG_RETURN
(
-
1
);
/* No more results */
DBUG_RETURN
((
*
mysql
->
methods
->
next_result
)(
mysql
));
}
...
...
libmysqld/lib_sql.cc
View file @
e5c2b42d
...
...
@@ -245,6 +245,18 @@ static MYSQL_RES * emb_mysql_store_result(MYSQL *mysql)
return
mysql_store_result
(
mysql
);
}
int
emb_next_result
(
MYSQL
*
mysql
)
{
THD
*
thd
=
(
THD
*
)
mysql
->
thd
;
DBUG_ENTER
(
"emb_next_result"
);
if
(
emb_advanced_command
(
mysql
,
COM_QUERY
,
0
,
0
,
thd
->
query_rest
,
thd
->
query_rest_length
,
1
)
||
emb_mysql_read_query_result
(
mysql
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
0
);
/* No more results */
}
MYSQL_METHODS
embedded_methods
=
{
...
...
@@ -259,7 +271,8 @@ MYSQL_METHODS embedded_methods=
emb_read_binary_rows
,
emb_unbuffered_fetch
,
emb_free_embedded_thd
,
emb_read_statistic
emb_read_statistic
,
emb_next_result
};
C_MODE_END
...
...
@@ -749,6 +762,11 @@ bool Protocol::net_store_data(const char *from, uint length)
return
false
;
}
char
*
memdup_mysql
(
struct
st_mysql
*
mysql
,
const
char
*
data
,
int
length
)
{
return
memdup_root
(
&
mysql
->
field_alloc
,
data
,
length
);
}
#if 0
/* The same as Protocol::net_store_data but does the converstion
*/
...
...
sql/sql_class.h
View file @
e5c2b42d
...
...
@@ -565,6 +565,8 @@ class THD :public ilink,
struct
st_mysql_bind
*
client_params
;
char
*
extra_data
;
ulong
extra_length
;
char
*
query_rest
;
uint32
query_rest_length
;
#endif
NET
net
;
// client connection descriptor
MEM_ROOT
warn_root
;
// For warnings and errors
...
...
sql/sql_parse.cc
View file @
e5c2b42d
...
...
@@ -48,6 +48,7 @@
extern
"C"
int
gethostname
(
char
*
name
,
int
namelen
);
#endif
char
*
memdup_mysql
(
struct
st_mysql
*
mysql
,
const
char
*
data
,
int
length
);
static
int
check_for_max_user_connections
(
THD
*
thd
,
USER_CONN
*
uc
);
static
void
decrease_user_connections
(
USER_CONN
*
uc
);
static
bool
check_db_used
(
THD
*
thd
,
TABLE_LIST
*
tables
);
...
...
@@ -1397,11 +1398,13 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
char
*
packet
=
thd
->
lex
->
found_colon
;
/*
Multiple queries exits, execute them individually
in embedded server - just store them to be executed later
*/
#ifndef EMBEDDED_LIBRARY
if
(
thd
->
lock
||
thd
->
open_tables
||
thd
->
derived_tables
)
close_thread_tables
(
thd
);
ulong
length
=
thd
->
query_length
-
(
ulong
)(
thd
->
lex
->
found_colon
-
thd
->
query
);
#endif
ulong
length
=
thd
->
query_length
-
(
ulong
)(
packet
-
thd
->
query
);
/* Remove garbage at start of query */
while
(
my_isspace
(
thd
->
charset
(),
*
packet
)
&&
length
>
0
)
...
...
@@ -1414,7 +1417,13 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
query_id
=
query_id
++
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
#ifndef EMBEDDED_LIBRARY
mysql_parse
(
thd
,
packet
,
length
);
#else
thd
->
query_rest
=
(
char
*
)
memdup_mysql
(
thd
->
mysql
,
packet
,
length
);
thd
->
query_rest_length
=
length
;
break
;
#endif
/*EMBEDDED_LIBRARY*/
}
if
(
!
(
specialflag
&
SPECIAL_NO_PRIOR
))
...
...
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