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
8bc13b18
Commit
8bc13b18
authored
Oct 04, 2003
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bugs #1437, #1446
parent
0c1d6495
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
11 deletions
+33
-11
include/mysql.h
include/mysql.h
+1
-0
libmysql/client_settings.h
libmysql/client_settings.h
+1
-0
libmysql/libmysql.c
libmysql/libmysql.c
+11
-6
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+11
-1
sql-common/client.c
sql-common/client.c
+2
-1
sql/sql_parse.cc
sql/sql_parse.cc
+7
-3
No files found.
include/mysql.h
View file @
8bc13b18
...
...
@@ -565,6 +565,7 @@ typedef struct st_mysql_methods
MYSQL_DATA
*
(
STDCALL
*
read_binary_rows
)(
MYSQL_STMT
*
stmt
);
int
(
STDCALL
*
unbuffered_fetch
)(
MYSQL
*
mysql
,
char
**
row
);
void
(
STDCALL
*
free_embedded_thd
)(
MYSQL
*
mysql
);
const
char
*
(
STDCALL
*
read_statistic
)(
MYSQL
*
mysql
);
#endif
}
MYSQL_METHODS
;
...
...
libmysql/client_settings.h
View file @
8bc13b18
...
...
@@ -57,3 +57,4 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
int
STDCALL
cli_stmt_execute
(
MYSQL_STMT
*
stmt
);
MYSQL_DATA
*
cli_read_binary_rows
(
MYSQL_STMT
*
stmt
);
int
STDCALL
cli_unbuffered_fetch
(
MYSQL
*
mysql
,
char
**
row
);
const
char
*
STDCALL
cli_read_statistic
(
MYSQL
*
mysql
);
libmysql/libmysql.c
View file @
8bc13b18
...
...
@@ -1102,12 +1102,8 @@ mysql_dump_debug_info(MYSQL *mysql)
DBUG_RETURN
(
simple_command
(
mysql
,
COM_DEBUG
,
0
,
0
,
0
));
}
const
char
*
STDCALL
mysql_stat
(
MYSQL
*
mysql
)
const
char
*
STDCALL
cli_read_statistic
(
MYSQL
*
mysql
)
{
DBUG_ENTER
(
"mysql_stat"
);
if
(
simple_command
(
mysql
,
COM_STATISTICS
,
0
,
0
,
0
))
return
mysql
->
net
.
last_error
;
mysql
->
net
.
read_pos
[
mysql
->
packet_length
]
=
0
;
/* End of stat string */
if
(
!
mysql
->
net
.
read_pos
[
0
])
{
...
...
@@ -1116,7 +1112,16 @@ mysql_stat(MYSQL *mysql)
strmov
(
mysql
->
net
.
last_error
,
ER
(
mysql
->
net
.
last_errno
));
return
mysql
->
net
.
last_error
;
}
DBUG_RETURN
((
char
*
)
mysql
->
net
.
read_pos
);
return
(
char
*
)
mysql
->
net
.
read_pos
;
}
const
char
*
STDCALL
mysql_stat
(
MYSQL
*
mysql
)
{
DBUG_ENTER
(
"mysql_stat"
);
if
(
simple_command
(
mysql
,
COM_STATISTICS
,
0
,
0
,
0
))
return
mysql
->
net
.
last_error
;
DBUG_RETURN
((
*
mysql
->
methods
->
read_statistic
)(
mysql
));
}
...
...
libmysqld/lib_sql.cc
View file @
8bc13b18
...
...
@@ -217,9 +217,16 @@ static void STDCALL emb_free_embedded_thd(MYSQL *mysql)
THD
*
thd
=
(
THD
*
)
mysql
->
thd
;
if
(
thd
->
data
)
free_rows
(
thd
->
data
);
thread_count
--
;
delete
thd
;
}
static
const
char
*
STDCALL
emb_read_statistic
(
MYSQL
*
mysql
)
{
THD
*
thd
=
(
THD
*
)
mysql
->
thd
;
return
thd
->
net
.
last_error
;
}
MYSQL_METHODS
embedded_methods
=
{
emb_mysql_read_query_result
,
...
...
@@ -232,7 +239,8 @@ MYSQL_METHODS embedded_methods=
emb_stmt_execute
,
emb_read_binary_rows
,
emb_unbuffered_fetch
,
emb_free_embedded_thd
emb_free_embedded_thd
,
emb_read_statistic
};
C_MODE_END
...
...
@@ -431,6 +439,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db)
{
THD
*
thd
=
(
THD
*
)
mysql
->
thd
;
thd
->
mysql
=
mysql
;
mysql
->
server_version
=
server_version
;
}
void
*
create_embedded_thd
(
int
client_flag
,
char
*
db
)
...
...
@@ -465,6 +474,7 @@ void *create_embedded_thd(int client_flag, char *db)
thd
->
data
=
0
;
thread_count
++
;
return
thd
;
}
...
...
sql-common/client.c
View file @
8bc13b18
...
...
@@ -1410,7 +1410,8 @@ static MYSQL_METHODS client_methods=
cli_stmt_execute
,
cli_read_binary_rows
,
cli_unbuffered_fetch
,
NULL
NULL
,
cli_read_statistic
#endif
};
...
...
sql/sql_parse.cc
View file @
8bc13b18
...
...
@@ -1473,12 +1473,15 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
error
=
TRUE
;
break
;
#endif
#ifndef EMBEDDED_LIBRARY
case
COM_STATISTICS
:
{
mysql_log
.
write
(
thd
,
command
,
NullS
);
statistic_increment
(
com_stat
[
SQLCOM_SHOW_STATUS
],
&
LOCK_status
);
#ifndef EMBEDDED_LIBRARY
char
buff
[
200
];
#else
char
*
buff
=
thd
->
net
.
last_error
;
#endif
ulong
uptime
=
(
ulong
)
(
thd
->
start_time
-
start_time
);
sprintf
((
char
*
)
buff
,
"Uptime: %ld Threads: %d Questions: %lu Slow queries: %ld Opens: %ld Flush tables: %ld Open tables: %u Queries per second avg: %.3f"
,
...
...
@@ -1491,12 +1494,13 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
sprintf
(
strend
(
buff
),
" Memory in use: %ldK Max memory used: %ldK"
,
(
sf_malloc_cur_memory
+
1023L
)
/
1024L
,
(
sf_malloc_max_memory
+
1023L
)
/
1024L
);
#endif
#endif
#ifndef EMBEDDED_LIBRARY
VOID
(
my_net_write
(
net
,
buff
,(
uint
)
strlen
(
buff
)));
VOID
(
net_flush
(
net
));
#endif
break
;
}
#endif
case
COM_PING
:
statistic_increment
(
com_other
,
&
LOCK_status
);
send_ok
(
thd
);
// Tell client we are alive
...
...
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