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
a47488ab
Commit
a47488ab
authored
20 years ago
by
unknown
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
6b86e0eb
86c161e6
Changes
6
Show 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 @
a47488ab
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
libmysql/client_settings.h
View file @
a47488ab
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
libmysql/libmysql.c
View file @
a47488ab
...
...
@@ -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
));
}
...
...
This diff is collapsed.
Click to expand it.
libmysqld/lib_sql.cc
View file @
a47488ab
...
...
@@ -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
*/
...
...
This diff is collapsed.
Click to expand it.
sql/sql_class.h
View file @
a47488ab
...
...
@@ -565,6 +565,8 @@ public:
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
...
...
This diff is collapsed.
Click to expand it.
sql/sql_parse.cc
View file @
a47488ab
...
...
@@ -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
))
...
...
This diff is collapsed.
Click to expand it.
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