1 diff -ruN a/BUILD/Makefile.in b/BUILD/Makefile.in
2 --- a/BUILD/Makefile.in Wed Jul 29 13:33:34 2009 -0700
3 +++ b/BUILD/Makefile.in Wed Jul 29 13:34:11 2009 -0700
6 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
11 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
12 diff -ruN a/Docs/Makefile.in b/Docs/Makefile.in
13 --- a/Docs/Makefile.in Wed Jul 29 13:33:34 2009 -0700
14 +++ b/Docs/Makefile.in Wed Jul 29 13:34:11 2009 -0700
17 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
22 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
23 diff -ruN a/Makefile.in b/Makefile.in
24 --- a/Makefile.in Wed Jul 29 13:33:34 2009 -0700
25 +++ b/Makefile.in Wed Jul 29 13:34:11 2009 -0700
28 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
33 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
34 diff -ruN a/SSL/Makefile.in b/SSL/Makefile.in
35 --- a/SSL/Makefile.in Wed Jul 29 13:33:34 2009 -0700
36 +++ b/SSL/Makefile.in Wed Jul 29 13:34:11 2009 -0700
39 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
44 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
45 diff -ruN a/client/Makefile.in b/client/Makefile.in
46 --- a/client/Makefile.in Wed Jul 29 13:33:34 2009 -0700
47 +++ b/client/Makefile.in Wed Jul 29 13:34:11 2009 -0700
50 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
55 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
56 diff -ruN a/cmd-line-utils/Makefile.in b/cmd-line-utils/Makefile.in
57 --- a/cmd-line-utils/Makefile.in Wed Jul 29 13:33:34 2009 -0700
58 +++ b/cmd-line-utils/Makefile.in Wed Jul 29 13:34:11 2009 -0700
61 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
66 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
67 diff -ruN a/cmd-line-utils/libedit/Makefile.in b/cmd-line-utils/libedit/Makefile.in
68 --- a/cmd-line-utils/libedit/Makefile.in Wed Jul 29 13:33:34 2009 -0700
69 +++ b/cmd-line-utils/libedit/Makefile.in Wed Jul 29 13:34:11 2009 -0700
72 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
77 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
78 diff -ruN a/cmd-line-utils/readline/Makefile.in b/cmd-line-utils/readline/Makefile.in
79 --- a/cmd-line-utils/readline/Makefile.in Wed Jul 29 13:33:34 2009 -0700
80 +++ b/cmd-line-utils/readline/Makefile.in Wed Jul 29 13:34:11 2009 -0700
83 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
88 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
89 diff -ruN a/configure b/configure
90 diff -ruN a/configure.in b/configure.in
91 --- a/configure.in Wed Jul 29 13:33:34 2009 -0700
92 +++ b/configure.in Wed Jul 29 13:34:11 2009 -0700
93 @@ -2140,7 +2140,18 @@
94 # We also disable for SCO for the time being, the headers for the
95 # thread library we use conflicts with other headers.
97 - *) AC_CHECK_FUNCS(clock_gettime)
99 + # most systems require the program be linked with librt library to use
100 + # the function clock_gettime
101 + my_save_LIBS="$LIBS"
103 + AC_CHECK_LIB(rt,clock_gettime)
105 + LIBS="$my_save_LIBS"
108 + LIBS="$LIBS $LIBRT"
109 + AC_CHECK_FUNCS(clock_gettime)
113 @@ -2776,7 +2787,7 @@
114 AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe])
117 -CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS"
118 +CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS $LIBRT"
120 AC_SUBST(CLIENT_LIBS)
121 AC_SUBST(NON_THREADED_LIBS)
122 diff -ruN a/dbug/Makefile.in b/dbug/Makefile.in
123 --- a/dbug/Makefile.in Wed Jul 29 13:33:34 2009 -0700
124 +++ b/dbug/Makefile.in Wed Jul 29 13:34:11 2009 -0700
127 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
132 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
133 diff -ruN a/extra/Makefile.in b/extra/Makefile.in
134 --- a/extra/Makefile.in Wed Jul 29 13:33:34 2009 -0700
135 +++ b/extra/Makefile.in Wed Jul 29 13:34:11 2009 -0700
138 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
143 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
144 diff -ruN a/extra/yassl/Makefile.in b/extra/yassl/Makefile.in
145 --- a/extra/yassl/Makefile.in Wed Jul 29 13:33:34 2009 -0700
146 +++ b/extra/yassl/Makefile.in Wed Jul 29 13:34:11 2009 -0700
149 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
154 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
155 diff -ruN a/extra/yassl/src/Makefile.in b/extra/yassl/src/Makefile.in
156 --- a/extra/yassl/src/Makefile.in Wed Jul 29 13:33:34 2009 -0700
157 +++ b/extra/yassl/src/Makefile.in Wed Jul 29 13:34:11 2009 -0700
160 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
165 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
166 diff -ruN a/extra/yassl/taocrypt/Makefile.in b/extra/yassl/taocrypt/Makefile.in
167 --- a/extra/yassl/taocrypt/Makefile.in Wed Jul 29 13:33:34 2009 -0700
168 +++ b/extra/yassl/taocrypt/Makefile.in Wed Jul 29 13:34:11 2009 -0700
171 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
176 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
177 diff -ruN a/extra/yassl/taocrypt/benchmark/Makefile.in b/extra/yassl/taocrypt/benchmark/Makefile.in
178 --- a/extra/yassl/taocrypt/benchmark/Makefile.in Wed Jul 29 13:33:34 2009 -0700
179 +++ b/extra/yassl/taocrypt/benchmark/Makefile.in Wed Jul 29 13:34:11 2009 -0700
182 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
187 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
188 diff -ruN a/extra/yassl/taocrypt/src/Makefile.in b/extra/yassl/taocrypt/src/Makefile.in
189 --- a/extra/yassl/taocrypt/src/Makefile.in Wed Jul 29 13:33:34 2009 -0700
190 +++ b/extra/yassl/taocrypt/src/Makefile.in Wed Jul 29 13:34:11 2009 -0700
193 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
198 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
199 diff -ruN a/extra/yassl/taocrypt/test/Makefile.in b/extra/yassl/taocrypt/test/Makefile.in
200 --- a/extra/yassl/taocrypt/test/Makefile.in Wed Jul 29 13:33:34 2009 -0700
201 +++ b/extra/yassl/taocrypt/test/Makefile.in Wed Jul 29 13:34:11 2009 -0700
204 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
209 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
210 diff -ruN a/extra/yassl/testsuite/Makefile.in b/extra/yassl/testsuite/Makefile.in
211 --- a/extra/yassl/testsuite/Makefile.in Wed Jul 29 13:33:34 2009 -0700
212 +++ b/extra/yassl/testsuite/Makefile.in Wed Jul 29 13:34:11 2009 -0700
215 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
220 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
221 diff -ruN a/heap/Makefile.in b/heap/Makefile.in
222 --- a/heap/Makefile.in Wed Jul 29 13:33:34 2009 -0700
223 +++ b/heap/Makefile.in Wed Jul 29 13:34:11 2009 -0700
226 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
231 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
232 diff -ruN a/include/Makefile.in b/include/Makefile.in
233 --- a/include/Makefile.in Wed Jul 29 13:33:34 2009 -0700
234 +++ b/include/Makefile.in Wed Jul 29 13:34:11 2009 -0700
237 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
242 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
243 diff -ruN a/include/mysql_com.h b/include/mysql_com.h
244 --- a/include/mysql_com.h Wed Jul 29 13:33:34 2009 -0700
245 +++ b/include/mysql_com.h Wed Jul 29 13:34:11 2009 -0700
247 #define USERNAME_LENGTH 16
248 #define SERVER_VERSION_LENGTH 60
249 #define SQLSTATE_LENGTH 5
250 +#define LIST_PROCESS_HOST_LEN 64
253 USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain
256 #define REFRESH_MASTER 128 /* Remove all bin logs in the index
257 and truncate the index */
258 +#define REFRESH_TABLE_STATS 256 /* Refresh table stats hash table */
259 +#define REFRESH_INDEX_STATS 512 /* Refresh index stats hash table */
260 +#define REFRESH_USER_STATS 1024 /* Refresh user stats hash table */
261 +#define REFRESH_SLOW_QUERY_LOG 4096 /* Flush slow query log and rotate*/
262 +#define REFRESH_CLIENT_STATS 8192 /* Refresh client stats hash table */
264 /* The following can't be set with mysql_refresh() */
265 #define REFRESH_READ_LOCK 16384 /* Lock tables for read */
268 my_bool report_error; /* We should report error (we have unreported error) */
269 my_bool return_errno;
270 -#if defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY)
271 +#if defined(MYSQL_SERVER)
273 Controls whether a big packet should be skipped.
275 diff -ruN a/libmysql/Makefile.in b/libmysql/Makefile.in
276 --- a/libmysql/Makefile.in Wed Jul 29 13:33:34 2009 -0700
277 +++ b/libmysql/Makefile.in Wed Jul 29 13:34:11 2009 -0700
280 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
285 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
286 diff -ruN a/libmysql_r/Makefile.in b/libmysql_r/Makefile.in
287 --- a/libmysql_r/Makefile.in Wed Jul 29 13:33:34 2009 -0700
288 +++ b/libmysql_r/Makefile.in Wed Jul 29 13:34:11 2009 -0700
291 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
294 LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
296 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
297 diff -ruN a/libmysqld/Makefile.in b/libmysqld/Makefile.in
298 --- a/libmysqld/Makefile.in Wed Jul 29 13:33:34 2009 -0700
299 +++ b/libmysqld/Makefile.in Wed Jul 29 13:34:11 2009 -0700
302 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
307 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
308 diff -ruN a/libmysqld/examples/Makefile.in b/libmysqld/examples/Makefile.in
309 --- a/libmysqld/examples/Makefile.in Wed Jul 29 13:33:34 2009 -0700
310 +++ b/libmysqld/examples/Makefile.in Wed Jul 29 13:34:11 2009 -0700
313 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
316 LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs)
318 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
319 diff -ruN a/man/Makefile.in b/man/Makefile.in
320 --- a/man/Makefile.in Wed Jul 29 13:33:34 2009 -0700
321 +++ b/man/Makefile.in Wed Jul 29 13:34:11 2009 -0700
324 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
329 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
330 diff -ruN a/myisam/Makefile.in b/myisam/Makefile.in
331 --- a/myisam/Makefile.in Wed Jul 29 13:33:34 2009 -0700
332 +++ b/myisam/Makefile.in Wed Jul 29 13:34:11 2009 -0700
335 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
340 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
341 diff -ruN a/myisammrg/Makefile.in b/myisammrg/Makefile.in
342 --- a/myisammrg/Makefile.in Wed Jul 29 13:33:34 2009 -0700
343 +++ b/myisammrg/Makefile.in Wed Jul 29 13:34:11 2009 -0700
346 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
351 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
352 diff -ruN a/mysql-test/Makefile.in b/mysql-test/Makefile.in
353 --- a/mysql-test/Makefile.in Wed Jul 29 13:33:34 2009 -0700
354 +++ b/mysql-test/Makefile.in Wed Jul 29 13:34:11 2009 -0700
357 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
362 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
363 diff -ruN a/mysql-test/ndb/Makefile.in b/mysql-test/ndb/Makefile.in
364 --- a/mysql-test/ndb/Makefile.in Wed Jul 29 13:33:34 2009 -0700
365 +++ b/mysql-test/ndb/Makefile.in Wed Jul 29 13:34:11 2009 -0700
368 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
373 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
374 diff -ruN a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
375 --- a/mysql-test/r/information_schema.result Wed Jul 29 13:33:34 2009 -0700
376 +++ b/mysql-test/r/information_schema.result Wed Jul 29 13:34:11 2009 -0700
383 COLLATION_CHARACTER_SET_APPLICABILITY
403 TABLE_CONSTRAINTS TABLE_CONSTRAINTS
404 TABLE_PRIVILEGES TABLE_PRIVILEGES
405 +TABLE_STATISTICS TABLE_STATISTICS
407 tables_priv tables_priv
411 TABLE_CONSTRAINTS TABLE_CONSTRAINTS
412 TABLE_PRIVILEGES TABLE_PRIVILEGES
413 +TABLE_STATISTICS TABLE_STATISTICS
415 tables_priv tables_priv
419 TABLE_CONSTRAINTS TABLE_CONSTRAINTS
420 TABLE_PRIVILEGES TABLE_PRIVILEGES
421 +TABLE_STATISTICS TABLE_STATISTICS
423 tables_priv tables_priv
425 @@ -594,12 +601,13 @@
426 where table_schema='information_schema' limit 2;
427 TABLE_NAME TABLE_TYPE ENGINE
428 CHARACTER_SETS SYSTEM VIEW MEMORY
429 -COLLATIONS SYSTEM VIEW MEMORY
430 +CLIENT_STATISTICS SYSTEM VIEW MEMORY
431 show tables from information_schema like "T%";
432 Tables_in_information_schema (T%)
438 create database information_schema;
439 ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
442 TABLE_CONSTRAINTS SYSTEM VIEW
443 TABLE_PRIVILEGES SYSTEM VIEW
444 +TABLE_STATISTICS SYSTEM VIEW
446 create table t1(a int);
447 ERROR 42S02: Unknown table 't1' in information_schema
454 select table_name from tables where table_name='user';
457 CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1;
458 CREATE VIEW a2 AS SELECT t_CRASHME FROM a1;
463 drop table t_crashme;
464 select table_schema,table_name, column_name from
465 @@ -790,18 +800,20 @@
466 TABLE_NAME COLUMN_NAME PRIVILEGES
467 COLUMNS TABLE_NAME select
468 COLUMN_PRIVILEGES TABLE_NAME select
469 +INDEX_STATISTICS TABLE_NAME select
470 KEY_COLUMN_USAGE TABLE_NAME select
471 STATISTICS TABLE_NAME select
472 TABLES TABLE_NAME select
473 TABLE_CONSTRAINTS TABLE_NAME select
474 TABLE_PRIVILEGES TABLE_NAME select
475 +TABLE_STATISTICS TABLE_NAME select
476 VIEWS TABLE_NAME select
477 delete from mysql.user where user='mysqltest_4';
478 delete from mysql.db where user='mysqltest_4';
480 SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
481 table_schema count(*)
482 -information_schema 17
483 +information_schema 21
485 create table t1 (i int, j int);
486 create trigger trg1 before insert on t1 for each row
487 @@ -1187,10 +1199,12 @@
489 table_name column_name
490 CHARACTER_SETS CHARACTER_SET_NAME
491 +CLIENT_STATISTICS CLIENT
492 COLLATIONS COLLATION_NAME
493 COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
495 COLUMN_PRIVILEGES TABLE_SCHEMA
496 +INDEX_STATISTICS TABLE_SCHEMA
497 KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
499 ROUTINES ROUTINE_SCHEMA
500 @@ -1200,8 +1214,10 @@
502 TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
503 TABLE_PRIVILEGES TABLE_SCHEMA
504 +TABLE_STATISTICS TABLE_SCHEMA
505 TRIGGERS TRIGGER_SCHEMA
506 USER_PRIVILEGES GRANTEE
507 +USER_STATISTICS USER
509 SELECT t.table_name, c1.column_name
510 FROM information_schema.tables t
511 @@ -1219,10 +1235,12 @@
513 table_name column_name
514 CHARACTER_SETS CHARACTER_SET_NAME
515 +CLIENT_STATISTICS CLIENT
516 COLLATIONS COLLATION_NAME
517 COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
519 COLUMN_PRIVILEGES TABLE_SCHEMA
520 +INDEX_STATISTICS TABLE_SCHEMA
521 KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
523 ROUTINES ROUTINE_SCHEMA
524 @@ -1232,8 +1250,10 @@
526 TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
527 TABLE_PRIVILEGES TABLE_SCHEMA
528 +TABLE_STATISTICS TABLE_SCHEMA
529 TRIGGERS TRIGGER_SCHEMA
530 USER_PRIVILEGES GRANTEE
531 +USER_STATISTICS USER
533 SELECT MAX(table_name) FROM information_schema.tables;
535 @@ -1302,10 +1322,12 @@
536 group by t.table_name order by num1, t.table_name;
537 table_name group_concat(t.table_schema, '.', t.table_name) num1
538 CHARACTER_SETS information_schema.CHARACTER_SETS 1
539 +CLIENT_STATISTICS information_schema.CLIENT_STATISTICS 1
540 COLLATIONS information_schema.COLLATIONS 1
541 COLLATION_CHARACTER_SET_APPLICABILITY information_schema.COLLATION_CHARACTER_SET_APPLICABILITY 1
542 COLUMNS information_schema.COLUMNS 1
543 COLUMN_PRIVILEGES information_schema.COLUMN_PRIVILEGES 1
544 +INDEX_STATISTICS information_schema.INDEX_STATISTICS 1
545 KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
546 PROFILING information_schema.PROFILING 1
547 ROUTINES information_schema.ROUTINES 1
548 @@ -1315,8 +1337,10 @@
549 TABLES information_schema.TABLES 1
550 TABLE_CONSTRAINTS information_schema.TABLE_CONSTRAINTS 1
551 TABLE_PRIVILEGES information_schema.TABLE_PRIVILEGES 1
552 +TABLE_STATISTICS information_schema.TABLE_STATISTICS 1
553 TRIGGERS information_schema.TRIGGERS 1
554 USER_PRIVILEGES information_schema.USER_PRIVILEGES 1
555 +USER_STATISTICS information_schema.USER_STATISTICS 1
556 VIEWS information_schema.VIEWS 1
557 create table t1(f1 int);
558 create view v1 as select f1+1 as a from t1;
559 diff -ruN a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
560 --- a/mysql-test/r/information_schema_db.result Wed Jul 29 13:33:34 2009 -0700
561 +++ b/mysql-test/r/information_schema_db.result Wed Jul 29 13:34:11 2009 -0700
564 Tables_in_information_schema
568 COLLATION_CHARACTER_SET_APPLICABILITY
584 show tables from INFORMATION_SCHEMA like 'T%';
585 Tables_in_information_schema (T%)
591 create database `inf%`;
592 create database mbase;
593 diff -ruN a/mysql-test/r/mysqlshow.result b/mysql-test/r/mysqlshow.result
594 --- a/mysql-test/r/mysqlshow.result Wed Jul 29 13:33:34 2009 -0700
595 +++ b/mysql-test/r/mysqlshow.result Wed Jul 29 13:34:11 2009 -0700
598 +---------------------------------------+
600 +| CLIENT_STATISTICS |
602 | COLLATION_CHARACTER_SET_APPLICABILITY |
604 | COLUMN_PRIVILEGES |
605 +| INDEX_STATISTICS |
611 | TABLE_CONSTRAINTS |
613 +| TABLE_STATISTICS |
618 +---------------------------------------+
619 Database: INFORMATION_SCHEMA
620 @@ -102,10 +106,12 @@
622 +---------------------------------------+
624 +| CLIENT_STATISTICS |
626 | COLLATION_CHARACTER_SET_APPLICABILITY |
628 | COLUMN_PRIVILEGES |
629 +| INDEX_STATISTICS |
635 | TABLE_CONSTRAINTS |
637 +| TABLE_STATISTICS |
642 +---------------------------------------+
643 Wildcard: inf_rmation_schema
644 diff -ruN a/mysys/Makefile.in b/mysys/Makefile.in
645 --- a/mysys/Makefile.in Wed Jul 29 13:33:34 2009 -0700
646 +++ b/mysys/Makefile.in Wed Jul 29 13:34:11 2009 -0700
649 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
654 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
655 diff -ruN a/ndb/Makefile.in b/ndb/Makefile.in
656 --- a/ndb/Makefile.in Wed Jul 29 13:33:34 2009 -0700
657 +++ b/ndb/Makefile.in Wed Jul 29 13:34:11 2009 -0700
660 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
665 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
666 diff -ruN a/ndb/docs/Makefile.in b/ndb/docs/Makefile.in
667 --- a/ndb/docs/Makefile.in Wed Jul 29 13:33:34 2009 -0700
668 +++ b/ndb/docs/Makefile.in Wed Jul 29 13:34:11 2009 -0700
671 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
676 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
677 diff -ruN a/ndb/include/Makefile.in b/ndb/include/Makefile.in
678 --- a/ndb/include/Makefile.in Wed Jul 29 13:33:34 2009 -0700
679 +++ b/ndb/include/Makefile.in Wed Jul 29 13:34:11 2009 -0700
682 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
687 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
688 diff -ruN a/ndb/src/Makefile.in b/ndb/src/Makefile.in
689 --- a/ndb/src/Makefile.in Wed Jul 29 13:33:34 2009 -0700
690 +++ b/ndb/src/Makefile.in Wed Jul 29 13:34:11 2009 -0700
693 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
698 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
699 diff -ruN a/ndb/src/common/Makefile.in b/ndb/src/common/Makefile.in
700 --- a/ndb/src/common/Makefile.in Wed Jul 29 13:33:34 2009 -0700
701 +++ b/ndb/src/common/Makefile.in Wed Jul 29 13:34:11 2009 -0700
704 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
709 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
710 diff -ruN a/ndb/src/common/debugger/Makefile.in b/ndb/src/common/debugger/Makefile.in
711 --- a/ndb/src/common/debugger/Makefile.in Wed Jul 29 13:33:34 2009 -0700
712 +++ b/ndb/src/common/debugger/Makefile.in Wed Jul 29 13:34:11 2009 -0700
715 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
720 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
721 diff -ruN a/ndb/src/common/debugger/signaldata/Makefile.in b/ndb/src/common/debugger/signaldata/Makefile.in
722 --- a/ndb/src/common/debugger/signaldata/Makefile.in Wed Jul 29 13:33:34 2009 -0700
723 +++ b/ndb/src/common/debugger/signaldata/Makefile.in Wed Jul 29 13:34:11 2009 -0700
726 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
731 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
732 diff -ruN a/ndb/src/common/logger/Makefile.in b/ndb/src/common/logger/Makefile.in
733 --- a/ndb/src/common/logger/Makefile.in Wed Jul 29 13:33:34 2009 -0700
734 +++ b/ndb/src/common/logger/Makefile.in Wed Jul 29 13:34:11 2009 -0700
737 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
742 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
743 diff -ruN a/ndb/src/common/mgmcommon/Makefile.in b/ndb/src/common/mgmcommon/Makefile.in
744 --- a/ndb/src/common/mgmcommon/Makefile.in Wed Jul 29 13:33:34 2009 -0700
745 +++ b/ndb/src/common/mgmcommon/Makefile.in Wed Jul 29 13:34:11 2009 -0700
748 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
753 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
754 diff -ruN a/ndb/src/common/portlib/Makefile.in b/ndb/src/common/portlib/Makefile.in
755 --- a/ndb/src/common/portlib/Makefile.in Wed Jul 29 13:33:34 2009 -0700
756 +++ b/ndb/src/common/portlib/Makefile.in Wed Jul 29 13:34:11 2009 -0700
759 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
764 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
765 diff -ruN a/ndb/src/common/transporter/Makefile.in b/ndb/src/common/transporter/Makefile.in
766 --- a/ndb/src/common/transporter/Makefile.in Wed Jul 29 13:33:34 2009 -0700
767 +++ b/ndb/src/common/transporter/Makefile.in Wed Jul 29 13:34:11 2009 -0700
770 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
775 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
776 diff -ruN a/ndb/src/common/util/Makefile.in b/ndb/src/common/util/Makefile.in
777 --- a/ndb/src/common/util/Makefile.in Wed Jul 29 13:33:34 2009 -0700
778 +++ b/ndb/src/common/util/Makefile.in Wed Jul 29 13:34:11 2009 -0700
781 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
786 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
787 diff -ruN a/ndb/src/cw/Makefile.in b/ndb/src/cw/Makefile.in
788 --- a/ndb/src/cw/Makefile.in Wed Jul 29 13:33:34 2009 -0700
789 +++ b/ndb/src/cw/Makefile.in Wed Jul 29 13:34:11 2009 -0700
792 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
797 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
798 diff -ruN a/ndb/src/cw/cpcd/Makefile.in b/ndb/src/cw/cpcd/Makefile.in
799 --- a/ndb/src/cw/cpcd/Makefile.in Wed Jul 29 13:33:34 2009 -0700
800 +++ b/ndb/src/cw/cpcd/Makefile.in Wed Jul 29 13:34:11 2009 -0700
803 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
808 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
809 diff -ruN a/ndb/src/kernel/Makefile.in b/ndb/src/kernel/Makefile.in
810 --- a/ndb/src/kernel/Makefile.in Wed Jul 29 13:33:34 2009 -0700
811 +++ b/ndb/src/kernel/Makefile.in Wed Jul 29 13:34:11 2009 -0700
814 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
819 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
820 diff -ruN a/ndb/src/kernel/blocks/Makefile.in b/ndb/src/kernel/blocks/Makefile.in
821 --- a/ndb/src/kernel/blocks/Makefile.in Wed Jul 29 13:33:34 2009 -0700
822 +++ b/ndb/src/kernel/blocks/Makefile.in Wed Jul 29 13:34:11 2009 -0700
825 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
830 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
831 diff -ruN a/ndb/src/kernel/blocks/backup/Makefile.in b/ndb/src/kernel/blocks/backup/Makefile.in
832 --- a/ndb/src/kernel/blocks/backup/Makefile.in Wed Jul 29 13:33:34 2009 -0700
833 +++ b/ndb/src/kernel/blocks/backup/Makefile.in Wed Jul 29 13:34:11 2009 -0700
836 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
841 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
842 diff -ruN a/ndb/src/kernel/blocks/cmvmi/Makefile.in b/ndb/src/kernel/blocks/cmvmi/Makefile.in
843 --- a/ndb/src/kernel/blocks/cmvmi/Makefile.in Wed Jul 29 13:33:34 2009 -0700
844 +++ b/ndb/src/kernel/blocks/cmvmi/Makefile.in Wed Jul 29 13:34:11 2009 -0700
847 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
852 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
853 diff -ruN a/ndb/src/kernel/blocks/dbacc/Makefile.in b/ndb/src/kernel/blocks/dbacc/Makefile.in
854 --- a/ndb/src/kernel/blocks/dbacc/Makefile.in Wed Jul 29 13:33:34 2009 -0700
855 +++ b/ndb/src/kernel/blocks/dbacc/Makefile.in Wed Jul 29 13:34:11 2009 -0700
858 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
863 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
864 diff -ruN a/ndb/src/kernel/blocks/dbdict/Makefile.in b/ndb/src/kernel/blocks/dbdict/Makefile.in
865 --- a/ndb/src/kernel/blocks/dbdict/Makefile.in Wed Jul 29 13:33:34 2009 -0700
866 +++ b/ndb/src/kernel/blocks/dbdict/Makefile.in Wed Jul 29 13:34:11 2009 -0700
869 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
874 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
875 diff -ruN a/ndb/src/kernel/blocks/dbdih/Makefile.in b/ndb/src/kernel/blocks/dbdih/Makefile.in
876 --- a/ndb/src/kernel/blocks/dbdih/Makefile.in Wed Jul 29 13:33:34 2009 -0700
877 +++ b/ndb/src/kernel/blocks/dbdih/Makefile.in Wed Jul 29 13:34:11 2009 -0700
880 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
885 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
886 diff -ruN a/ndb/src/kernel/blocks/dblqh/Makefile.in b/ndb/src/kernel/blocks/dblqh/Makefile.in
887 --- a/ndb/src/kernel/blocks/dblqh/Makefile.in Wed Jul 29 13:33:34 2009 -0700
888 +++ b/ndb/src/kernel/blocks/dblqh/Makefile.in Wed Jul 29 13:34:11 2009 -0700
891 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
896 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
897 diff -ruN a/ndb/src/kernel/blocks/dbtc/Makefile.in b/ndb/src/kernel/blocks/dbtc/Makefile.in
898 --- a/ndb/src/kernel/blocks/dbtc/Makefile.in Wed Jul 29 13:33:34 2009 -0700
899 +++ b/ndb/src/kernel/blocks/dbtc/Makefile.in Wed Jul 29 13:34:11 2009 -0700
902 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
907 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
908 diff -ruN a/ndb/src/kernel/blocks/dbtup/Makefile.in b/ndb/src/kernel/blocks/dbtup/Makefile.in
909 --- a/ndb/src/kernel/blocks/dbtup/Makefile.in Wed Jul 29 13:33:34 2009 -0700
910 +++ b/ndb/src/kernel/blocks/dbtup/Makefile.in Wed Jul 29 13:34:11 2009 -0700
913 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
918 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
919 diff -ruN a/ndb/src/kernel/blocks/dbtux/Makefile.in b/ndb/src/kernel/blocks/dbtux/Makefile.in
920 --- a/ndb/src/kernel/blocks/dbtux/Makefile.in Wed Jul 29 13:33:34 2009 -0700
921 +++ b/ndb/src/kernel/blocks/dbtux/Makefile.in Wed Jul 29 13:34:11 2009 -0700
924 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
929 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
930 diff -ruN a/ndb/src/kernel/blocks/dbutil/Makefile.in b/ndb/src/kernel/blocks/dbutil/Makefile.in
931 --- a/ndb/src/kernel/blocks/dbutil/Makefile.in Wed Jul 29 13:33:34 2009 -0700
932 +++ b/ndb/src/kernel/blocks/dbutil/Makefile.in Wed Jul 29 13:34:11 2009 -0700
935 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
940 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
941 diff -ruN a/ndb/src/kernel/blocks/ndbcntr/Makefile.in b/ndb/src/kernel/blocks/ndbcntr/Makefile.in
942 --- a/ndb/src/kernel/blocks/ndbcntr/Makefile.in Wed Jul 29 13:33:34 2009 -0700
943 +++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.in Wed Jul 29 13:34:11 2009 -0700
946 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
951 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
952 diff -ruN a/ndb/src/kernel/blocks/ndbfs/Makefile.in b/ndb/src/kernel/blocks/ndbfs/Makefile.in
953 --- a/ndb/src/kernel/blocks/ndbfs/Makefile.in Wed Jul 29 13:33:34 2009 -0700
954 +++ b/ndb/src/kernel/blocks/ndbfs/Makefile.in Wed Jul 29 13:34:11 2009 -0700
957 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
962 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
963 diff -ruN a/ndb/src/kernel/blocks/qmgr/Makefile.in b/ndb/src/kernel/blocks/qmgr/Makefile.in
964 --- a/ndb/src/kernel/blocks/qmgr/Makefile.in Wed Jul 29 13:33:34 2009 -0700
965 +++ b/ndb/src/kernel/blocks/qmgr/Makefile.in Wed Jul 29 13:34:11 2009 -0700
968 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
973 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
974 diff -ruN a/ndb/src/kernel/blocks/suma/Makefile.in b/ndb/src/kernel/blocks/suma/Makefile.in
975 --- a/ndb/src/kernel/blocks/suma/Makefile.in Wed Jul 29 13:33:34 2009 -0700
976 +++ b/ndb/src/kernel/blocks/suma/Makefile.in Wed Jul 29 13:34:11 2009 -0700
979 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
984 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
985 diff -ruN a/ndb/src/kernel/blocks/trix/Makefile.in b/ndb/src/kernel/blocks/trix/Makefile.in
986 --- a/ndb/src/kernel/blocks/trix/Makefile.in Wed Jul 29 13:33:34 2009 -0700
987 +++ b/ndb/src/kernel/blocks/trix/Makefile.in Wed Jul 29 13:34:11 2009 -0700
990 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
995 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
996 diff -ruN a/ndb/src/kernel/error/Makefile.in b/ndb/src/kernel/error/Makefile.in
997 --- a/ndb/src/kernel/error/Makefile.in Wed Jul 29 13:33:34 2009 -0700
998 +++ b/ndb/src/kernel/error/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1001 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1006 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1007 diff -ruN a/ndb/src/kernel/vm/Makefile.in b/ndb/src/kernel/vm/Makefile.in
1008 --- a/ndb/src/kernel/vm/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1009 +++ b/ndb/src/kernel/vm/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1012 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1017 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1018 diff -ruN a/ndb/src/mgmapi/Makefile.in b/ndb/src/mgmapi/Makefile.in
1019 --- a/ndb/src/mgmapi/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1020 +++ b/ndb/src/mgmapi/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1023 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1028 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1029 diff -ruN a/ndb/src/mgmclient/Makefile.in b/ndb/src/mgmclient/Makefile.in
1030 --- a/ndb/src/mgmclient/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1031 +++ b/ndb/src/mgmclient/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1034 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1039 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1040 diff -ruN a/ndb/src/mgmsrv/Makefile.in b/ndb/src/mgmsrv/Makefile.in
1041 --- a/ndb/src/mgmsrv/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1042 +++ b/ndb/src/mgmsrv/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1045 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1050 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1051 diff -ruN a/ndb/src/ndbapi/Makefile.in b/ndb/src/ndbapi/Makefile.in
1052 --- a/ndb/src/ndbapi/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1053 +++ b/ndb/src/ndbapi/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1056 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1061 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1062 diff -ruN a/ndb/test/Makefile.in b/ndb/test/Makefile.in
1063 --- a/ndb/test/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1064 +++ b/ndb/test/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1067 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1072 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1073 diff -ruN a/ndb/test/ndbapi/Makefile.in b/ndb/test/ndbapi/Makefile.in
1074 --- a/ndb/test/ndbapi/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1075 +++ b/ndb/test/ndbapi/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1078 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1083 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1084 diff -ruN a/ndb/test/ndbapi/bank/Makefile.in b/ndb/test/ndbapi/bank/Makefile.in
1085 --- a/ndb/test/ndbapi/bank/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1086 +++ b/ndb/test/ndbapi/bank/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1089 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1094 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1095 diff -ruN a/ndb/test/run-test/Makefile.in b/ndb/test/run-test/Makefile.in
1096 --- a/ndb/test/run-test/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1097 +++ b/ndb/test/run-test/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1100 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1105 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1106 diff -ruN a/ndb/test/src/Makefile.in b/ndb/test/src/Makefile.in
1107 --- a/ndb/test/src/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1108 +++ b/ndb/test/src/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1111 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1116 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1117 diff -ruN a/ndb/test/tools/Makefile.in b/ndb/test/tools/Makefile.in
1118 --- a/ndb/test/tools/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1119 +++ b/ndb/test/tools/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1122 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1127 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1128 diff -ruN a/ndb/tools/Makefile.in b/ndb/tools/Makefile.in
1129 --- a/ndb/tools/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1130 +++ b/ndb/tools/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1133 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1138 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1139 diff -ruN a/netware/Makefile.in b/netware/Makefile.in
1140 --- a/netware/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1141 +++ b/netware/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1144 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1149 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1150 diff -ruN /dev/null b/patch_info/userstats.info
1151 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1152 +++ b/patch_info/userstats.info Wed Jul 29 13:34:11 2009 -0700
1154 +File=userstatsv2.patch
1155 +Name=SHOW USER/TABLE/INDEX statistics
1159 +Comment=Added INFORMATION_SCHEMA.*_STATISTICS
1161 +YK: fix behavior for prepared statements
1164 +YK: add switch variable "userstat_running" to control INFORMATION_SCHEMA.*_STATISTICS (default:OFF)
1167 +YK: fixed "Row_sent: 0" problem at microslow_innodb.patch
1168 diff -ruN a/pstack/Makefile.in b/pstack/Makefile.in
1169 --- a/pstack/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1170 +++ b/pstack/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1173 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1178 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1179 diff -ruN a/pstack/aout/Makefile.in b/pstack/aout/Makefile.in
1180 --- a/pstack/aout/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1181 +++ b/pstack/aout/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1184 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1189 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1190 diff -ruN a/regex/Makefile.in b/regex/Makefile.in
1191 --- a/regex/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1192 +++ b/regex/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1195 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1200 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1201 diff -ruN a/scripts/Makefile.in b/scripts/Makefile.in
1202 --- a/scripts/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1203 +++ b/scripts/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1206 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1211 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1212 diff -ruN a/server-tools/Makefile.in b/server-tools/Makefile.in
1213 --- a/server-tools/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1214 +++ b/server-tools/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1217 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1222 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1223 diff -ruN a/server-tools/instance-manager/Makefile.in b/server-tools/instance-manager/Makefile.in
1224 --- a/server-tools/instance-manager/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1225 +++ b/server-tools/instance-manager/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1228 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1233 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1234 diff -ruN a/sql/Makefile.in b/sql/Makefile.in
1235 --- a/sql/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1236 +++ b/sql/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1239 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1244 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1245 diff -ruN a/sql/ha_innodb.cc b/sql/ha_innodb.cc
1246 --- a/sql/ha_innodb.cc Wed Jul 29 13:33:34 2009 -0700
1247 +++ b/sql/ha_innodb.cc Wed Jul 29 13:34:11 2009 -0700
1248 @@ -3329,6 +3329,8 @@
1250 error = row_insert_for_mysql((byte*) record, prebuilt);
1252 + if (error == DB_SUCCESS) rows_changed++;
1254 if (error == DB_SUCCESS && auto_inc_used) {
1256 /* Fetch the value that was set in the autoincrement field */
1257 @@ -3601,6 +3603,8 @@
1261 + if (error == DB_SUCCESS) rows_changed++;
1263 innodb_srv_conc_exit_innodb(prebuilt->trx);
1265 error = convert_error_code_to_mysql(error, user_thd);
1266 @@ -3649,6 +3653,8 @@
1268 error = row_update_for_mysql((byte*) record, prebuilt);
1270 + if (error == DB_SUCCESS) rows_changed++;
1272 innodb_srv_conc_exit_innodb(prebuilt->trx);
1274 error = convert_error_code_to_mysql(error, user_thd);
1275 @@ -4080,6 +4086,9 @@
1276 if (ret == DB_SUCCESS) {
1280 + if (active_index >= 0 && active_index < MAX_KEY)
1281 + index_rows_read[active_index]++;
1283 } else if (ret == DB_RECORD_NOT_FOUND) {
1284 error = HA_ERR_END_OF_FILE;
1285 diff -ruN a/sql/ha_myisam.cc b/sql/ha_myisam.cc
1286 --- a/sql/ha_myisam.cc Wed Jul 29 13:33:34 2009 -0700
1287 +++ b/sql/ha_myisam.cc Wed Jul 29 13:34:11 2009 -0700
1289 if ((error= update_auto_increment()))
1292 - return mi_write(file,buf);
1293 + int error=mi_write(file,buf);
1294 + if (!error) rows_changed++;
1298 int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
1299 @@ -1516,13 +1518,17 @@
1300 statistic_increment(table->in_use->status_var.ha_update_count,&LOCK_status);
1301 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
1302 table->timestamp_field->set_time();
1303 - return mi_update(file,old_data,new_data);
1304 + int error=mi_update(file,old_data,new_data);
1305 + if (!error) rows_changed++;
1309 int ha_myisam::delete_row(const byte * buf)
1311 statistic_increment(table->in_use->status_var.ha_delete_count,&LOCK_status);
1312 - return mi_delete(file,buf);
1313 + int error=mi_delete(file,buf);
1314 + if (!error) rows_changed++;
1318 int ha_myisam::index_read(byte * buf, const byte * key,
1319 @@ -1533,6 +1539,13 @@
1321 int error=mi_rkey(file,buf,active_index, key, key_len, find_flag);
1322 table->status=error ? STATUS_NOT_FOUND: 0;
1326 + int inx = (active_index == -1) ? file->lastinx : active_index;
1327 + if (inx >= 0 && inx < MAX_KEY)
1328 + index_rows_read[inx]++;
1333 @@ -1543,6 +1556,13 @@
1335 int error=mi_rkey(file,buf,index, key, key_len, find_flag);
1336 table->status=error ? STATUS_NOT_FOUND: 0;
1341 + if (inx >= 0 && inx < MAX_KEY)
1342 + index_rows_read[inx]++;
1347 @@ -1553,6 +1573,13 @@
1349 int error=mi_rkey(file,buf,active_index, key, key_len, HA_READ_PREFIX_LAST);
1350 table->status=error ? STATUS_NOT_FOUND: 0;
1354 + int inx = (active_index == -1) ? file->lastinx : active_index;
1355 + if (inx >= 0 && inx < MAX_KEY)
1356 + index_rows_read[inx]++;
1361 @@ -1563,6 +1590,13 @@
1363 int error=mi_rnext(file,buf,active_index);
1364 table->status=error ? STATUS_NOT_FOUND: 0;
1368 + int inx = (active_index == -1) ? file->lastinx : active_index;
1369 + if (inx >= 0 && inx < MAX_KEY)
1370 + index_rows_read[inx]++;
1375 @@ -1573,6 +1607,13 @@
1377 int error=mi_rprev(file,buf, active_index);
1378 table->status=error ? STATUS_NOT_FOUND: 0;
1382 + int inx = (active_index == -1) ? file->lastinx : active_index;
1383 + if (inx >= 0 && inx < MAX_KEY)
1384 + index_rows_read[inx]++;
1389 @@ -1583,6 +1624,13 @@
1391 int error=mi_rfirst(file, buf, active_index);
1392 table->status=error ? STATUS_NOT_FOUND: 0;
1396 + int inx = (active_index == -1) ? file->lastinx : active_index;
1397 + if (inx >= 0 && inx < MAX_KEY)
1398 + index_rows_read[inx]++;
1403 @@ -1593,6 +1641,13 @@
1405 int error=mi_rlast(file, buf, active_index);
1406 table->status=error ? STATUS_NOT_FOUND: 0;
1410 + int inx = (active_index == -1) ? file->lastinx : active_index;
1411 + if (inx >= 0 && inx < MAX_KEY)
1412 + index_rows_read[inx]++;
1417 @@ -1609,6 +1664,13 @@
1418 error= mi_rnext_same(file,buf);
1419 } while (error == HA_ERR_RECORD_DELETED);
1420 table->status=error ? STATUS_NOT_FOUND: 0;
1424 + int inx = (active_index == -1) ? file->lastinx : active_index;
1425 + if (inx >= 0 && inx < MAX_KEY)
1426 + index_rows_read[inx]++;
1431 @@ -1626,6 +1688,7 @@
1433 int error=mi_scan(file, buf);
1434 table->status=error ? STATUS_NOT_FOUND: 0;
1435 + if (!error) rows_read++;
1439 @@ -1640,6 +1703,7 @@
1441 int error=mi_rrnd(file, buf, my_get_ptr(pos,ref_length));
1442 table->status=error ? STATUS_NOT_FOUND: 0;
1443 + if (!error) rows_read++;
1447 diff -ruN a/sql/handler.cc b/sql/handler.cc
1448 --- a/sql/handler.cc Wed Jul 29 13:33:34 2009 -0700
1449 +++ b/sql/handler.cc Wed Jul 29 13:34:11 2009 -0700
1452 tc_log->unlog(cookie, xid);
1453 DBUG_EXECUTE_IF("crash_commit_after", abort(););
1454 + if (is_real_trans)
1455 + thd->diff_commit_trans++;
1458 start_waiting_global_read_lock(thd);
1460 thd->transaction.cleanup();
1463 + thd->diff_rollback_trans++;
1464 #endif /* USING_TRANSACTIONS */
1467 @@ -1224,6 +1227,7 @@
1468 statistic_increment(thd->status_var.ha_rollback_count,&LOCK_status);
1469 *ht=0; // keep it conveniently zero-filled
1471 + thd->diff_rollback_trans++;
1475 @@ -1454,6 +1458,8 @@
1477 dupp_ref=ref+ALIGN_SIZE(ref_length);
1479 + rows_read = rows_changed = 0;
1480 + memset(index_rows_read, 0, sizeof(index_rows_read));
1484 @@ -2291,6 +2297,111 @@
1488 +// Updates the global table stats with the TABLE this handler represents.
1489 +void handler::update_global_table_stats() {
1490 + if (!opt_userstat_running) {
1491 + rows_read = rows_changed = 0;
1495 + if (!rows_read && !rows_changed) return; // Nothing to update.
1496 + // table_cache_key is db_name + '\0' + table_name + '\0'.
1497 + if (!table->s || !table->s->table_cache_key || !table->s->table_name) return;
1499 + TABLE_STATS* table_stats;
1500 + char key[NAME_LEN * 2 + 2];
1501 + // [db] + '.' + [table]
1502 + sprintf(key, "%s.%s", table->s->table_cache_key, table->s->table_name);
1504 + pthread_mutex_lock(&LOCK_global_table_stats);
1505 + // Gets the global table stats, creating one if necessary.
1506 + if (!(table_stats = (TABLE_STATS*)hash_search(&global_table_stats,
1509 + if (!(table_stats = ((TABLE_STATS*)
1510 + my_malloc(sizeof(TABLE_STATS), MYF(MY_WME | MY_ZEROFILL))))) {
1512 + sql_print_error("Allocating table stats failed.");
1515 + strncpy(table_stats->table, key, sizeof(table_stats->table));
1516 + table_stats->rows_read = 0;
1517 + table_stats->rows_changed = 0;
1518 + table_stats->rows_changed_x_indexes = 0;
1519 + table_stats->engine_type = (int) ht->db_type;
1521 + if (my_hash_insert(&global_table_stats, (byte*)table_stats)) {
1523 + sql_print_error("Inserting table stats failed.");
1524 + my_free((char*)table_stats, 0);
1528 + // Updates the global table stats.
1529 + table_stats->rows_read += rows_read;
1530 + table_stats->rows_changed += rows_changed;
1531 + table_stats->rows_changed_x_indexes +=
1532 + rows_changed * (table->s->keys ? table->s->keys : 1);
1533 + current_thd->diff_total_read_rows += rows_read;
1534 + rows_read = rows_changed = 0;
1536 + pthread_mutex_unlock(&LOCK_global_table_stats);
1539 +// Updates the global index stats with this handler's accumulated index reads.
1540 +void handler::update_global_index_stats() {
1541 + // table_cache_key is db_name + '\0' + table_name + '\0'.
1542 + if (!table->s || !table->s->table_cache_key || !table->s->table_name) return;
1544 + if (!opt_userstat_running) {
1545 + for (int x = 0; x < table->s->keys; x++) {
1546 + index_rows_read[x] = 0;
1551 + for (int x = 0; x < table->s->keys; x++) {
1552 + if (index_rows_read[x]) {
1553 + // Rows were read using this index.
1554 + KEY* key_info = &table->key_info[x];
1556 + if (!key_info->name) continue;
1558 + INDEX_STATS* index_stats;
1559 + char key[NAME_LEN * 3 + 3];
1560 + // [db] + '.' + [table] + '.' + [index]
1561 + sprintf(key, "%s.%s.%s", table->s->table_cache_key,
1562 + table->s->table_name, key_info->name);
1564 + pthread_mutex_lock(&LOCK_global_index_stats);
1565 + // Gets the global index stats, creating one if necessary.
1566 + if (!(index_stats = (INDEX_STATS*)hash_search(&global_index_stats,
1569 + if (!(index_stats = ((INDEX_STATS*)
1570 + my_malloc(sizeof(INDEX_STATS), MYF(MY_WME | MY_ZEROFILL))))) {
1572 + sql_print_error("Allocating index stats failed.");
1575 + strncpy(index_stats->index, key, sizeof(index_stats->index));
1576 + index_stats->rows_read = 0;
1578 + if (my_hash_insert(&global_index_stats, (byte*)index_stats)) {
1580 + sql_print_error("Inserting index stats failed.");
1581 + my_free((char*)index_stats, 0);
1585 + // Updates the global index stats.
1586 + index_stats->rows_read += index_rows_read[x];
1587 + index_rows_read[x] = 0;
1589 + pthread_mutex_unlock(&LOCK_global_index_stats);
1594 /****************************************************************************
1595 ** Some general functions that isn't in the handler class
1596 diff -ruN a/sql/handler.h b/sql/handler.h
1597 --- a/sql/handler.h Wed Jul 29 13:33:34 2009 -0700
1598 +++ b/sql/handler.h Wed Jul 29 13:34:11 2009 -0700
1600 #define USING_TRANSACTIONS
1604 +#error MAX_KEY is too large. Values up to 128 are supported.
1607 // the following is for checking tables
1609 #define HA_ADMIN_ALREADY_DONE 1
1611 bool auto_increment_column_changed;
1612 bool implicit_emptied; /* Can be !=0 only if HEAP */
1613 const COND *pushed_cond;
1614 + ulonglong rows_read;
1615 + ulonglong rows_changed;
1616 + ulonglong index_rows_read[MAX_KEY];
1618 handler(const handlerton *ht_arg, TABLE *table_arg) :table(table_arg),
1620 @@ -615,8 +622,10 @@
1621 ref_length(sizeof(my_off_t)), block_size(0),
1622 raid_type(0), ft_handler(0), inited(NONE),
1623 locked(FALSE), implicit_emptied(0),
1626 + pushed_cond(NULL), rows_read(0), rows_changed(0)
1628 + memset(index_rows_read, 0, sizeof(index_rows_read));
1630 virtual ~handler(void) { DBUG_ASSERT(locked == FALSE); /* TODO: DBUG_ASSERT(inited == NONE); */ }
1631 virtual handler *clone(MEM_ROOT *mem_root);
1632 int ha_open(const char *name, int mode, int test_if_locked);
1633 @@ -625,7 +634,11 @@
1634 virtual void print_error(int error, myf errflag);
1635 virtual bool get_error_message(int error, String *buf);
1636 uint get_dup_key(int error);
1637 - void change_table_ptr(TABLE *table_arg) { table=table_arg; }
1638 + void change_table_ptr(TABLE *table_arg) {
1640 + rows_read = rows_changed = 0;
1641 + memset(index_rows_read, 0, sizeof(index_rows_read));
1643 virtual double scan_time()
1644 { return ulonglong2double(data_file_length) / IO_SIZE + 2; }
1645 virtual double read_time(uint index, uint ranges, ha_rows rows)
1647 virtual bool is_crashed() const { return 0; }
1648 virtual bool auto_repair() const { return 0; }
1650 + void update_global_table_stats();
1651 + void update_global_index_stats();
1654 default rename_table() and delete_table() rename/delete files with a
1655 given name and extensions from bas_ext()
1656 diff -ruN a/sql/lex.h b/sql/lex.h
1657 --- a/sql/lex.h Wed Jul 29 13:33:34 2009 -0700
1658 +++ b/sql/lex.h Wed Jul 29 13:34:11 2009 -0700
1660 { "CHECKSUM", SYM(CHECKSUM_SYM)},
1661 { "CIPHER", SYM(CIPHER_SYM)},
1662 { "CLIENT", SYM(CLIENT_SYM)},
1663 + { "CLIENT_STATISTICS", SYM(CLIENT_STATS_SYM)},
1664 { "CLOSE", SYM(CLOSE_SYM)},
1665 { "CODE", SYM(CODE_SYM)},
1666 { "COLLATE", SYM(COLLATE_SYM)},
1668 { "IN", SYM(IN_SYM)},
1669 { "INDEX", SYM(INDEX_SYM)},
1670 { "INDEXES", SYM(INDEXES)},
1671 + { "INDEX_STATISTICS", SYM(INDEX_STATS_SYM)},
1672 { "INFILE", SYM(INFILE)},
1673 { "INNER", SYM(INNER_SYM)},
1674 { "INNOBASE", SYM(INNOBASE_SYM)},
1676 { "SIGNED", SYM(SIGNED_SYM)},
1677 { "SIMPLE", SYM(SIMPLE_SYM)},
1678 { "SLAVE", SYM(SLAVE)},
1679 + { "SLOW", SYM(SLOW_SYM)},
1680 { "SNAPSHOT", SYM(SNAPSHOT_SYM)},
1681 { "SMALLINT", SYM(SMALLINT)},
1682 { "SOME", SYM(ANY_SYM)},
1684 { "TABLE", SYM(TABLE_SYM)},
1685 { "TABLES", SYM(TABLES)},
1686 { "TABLESPACE", SYM(TABLESPACE)},
1687 + { "TABLE_STATISTICS", SYM(TABLE_STATS_SYM)},
1688 { "TEMPORARY", SYM(TEMPORARY)},
1689 { "TEMPTABLE", SYM(TEMPTABLE_SYM)},
1690 { "TERMINATED", SYM(TERMINATED)},
1692 { "USE", SYM(USE_SYM)},
1693 { "USER", SYM(USER)},
1694 { "USER_RESOURCES", SYM(RESOURCES)},
1695 + { "USER_STATISTICS", SYM(USER_STATS_SYM)},
1696 { "USE_FRM", SYM(USE_FRM)},
1697 { "USING", SYM(USING)},
1698 { "UTC_DATE", SYM(UTC_DATE_SYM)},
1699 diff -ruN a/sql/log.cc b/sql/log.cc
1700 --- a/sql/log.cc Wed Jul 29 13:33:34 2009 -0700
1701 +++ b/sql/log.cc Wed Jul 29 13:34:11 2009 -0700
1702 @@ -1960,18 +1960,24 @@
1703 thd->current_insert_id);
1706 + if (file == &log_file)
1707 + thd->binlog_bytes_written += e.data_written;
1709 if (thd->insert_id_used)
1711 Intvar_log_event e(thd,(uchar) INSERT_ID_EVENT,thd->last_insert_id);
1714 + if (file == &log_file)
1715 + thd->binlog_bytes_written += e.data_written;
1719 Rand_log_event e(thd,thd->rand_saved_seed1,thd->rand_saved_seed2);
1722 + if (file == &log_file)
1723 + thd->binlog_bytes_written += e.data_written;
1725 if (thd->user_var_events.elements)
1727 @@ -1987,6 +1993,8 @@
1728 user_var_event->charset_number);
1731 + if (file == &log_file)
1732 + thd->binlog_bytes_written += e.data_written;
1736 @@ -1997,6 +2005,8 @@
1738 if (event_info->write(file))
1740 + if (file == &log_file)
1741 + thd->binlog_bytes_written += event_info->data_written;
1743 if (file == &log_file) // we are writing to the real log (disk)
1745 @@ -2119,6 +2129,7 @@
1747 if (qinfo.write(&log_file))
1749 + thd->binlog_bytes_written += qinfo.data_written;
1751 /* Read from the file used to cache the queries .*/
1752 if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
1753 @@ -2165,6 +2176,7 @@
1754 /* write the first half of the split header */
1755 if (my_b_write(&log_file, header, carry))
1757 + thd->binlog_bytes_written += carry;
1760 copy fixed second half of header to cache so the correct
1761 @@ -2233,6 +2245,8 @@
1762 /* Write data to the binary log file */
1763 if (my_b_write(&log_file, cache->read_pos, length))
1765 + thd->binlog_bytes_written += length;
1767 cache->read_pos=cache->read_end; // Mark buffer used up
1768 DBUG_EXECUTE_IF("half_binlogged_transaction", goto DBUG_skip_commit;);
1769 } while ((length=my_b_fill(cache)));
1770 @@ -2241,6 +2255,8 @@
1772 if (commit_event->write(&log_file))
1774 + thd->binlog_bytes_written += commit_event->data_written;
1779 diff -ruN a/sql/mysql_priv.h b/sql/mysql_priv.h
1780 --- a/sql/mysql_priv.h Wed Jul 29 13:33:34 2009 -0700
1781 +++ b/sql/mysql_priv.h Wed Jul 29 13:34:11 2009 -0700
1782 @@ -837,7 +837,15 @@
1783 bool multi_delete_set_locks_and_link_aux_tables(LEX *lex);
1784 void init_max_user_conn(void);
1785 void init_update_queries(void);
1786 +void init_global_user_stats(void);
1787 +void init_global_table_stats(void);
1788 +void init_global_index_stats(void);
1789 +void init_global_client_stats(void);
1790 void free_max_user_conn(void);
1791 +void free_global_user_stats(void);
1792 +void free_global_table_stats(void);
1793 +void free_global_index_stats(void);
1794 +void free_global_client_stats(void);
1795 pthread_handler_t handle_one_connection(void *arg);
1796 pthread_handler_t handle_bootstrap(void *arg);
1797 void end_thread(THD *thd,bool put_in_cache);
1798 @@ -1416,6 +1424,7 @@
1799 extern ulong max_connections,max_connect_errors, connect_timeout;
1800 extern ulong slave_net_timeout, slave_trans_retries;
1801 extern uint max_user_connections;
1802 +extern ulonglong denied_connections;
1803 extern ulong what_to_log,flush_time;
1804 extern ulong query_buff_size, thread_stack;
1805 extern ulong max_prepared_stmt_count, prepared_stmt_count;
1806 @@ -1446,6 +1455,7 @@
1807 extern my_bool opt_safe_show_db, opt_local_infile;
1808 extern my_bool opt_slave_compressed_protocol, use_temp_pool;
1809 extern my_bool opt_readonly, lower_case_file_system;
1810 +extern my_bool opt_userstat_running;
1811 extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
1812 extern my_bool opt_secure_auth;
1813 extern char* opt_secure_file_priv;
1814 @@ -1493,6 +1503,14 @@
1815 extern struct system_variables max_system_variables;
1816 extern struct system_status_var global_status_var;
1817 extern struct rand_struct sql_rand;
1818 +extern HASH global_user_stats;
1819 +extern HASH global_client_stats;
1820 +extern pthread_mutex_t LOCK_global_user_client_stats;
1821 +extern HASH global_table_stats;
1822 +extern pthread_mutex_t LOCK_global_table_stats;
1823 +extern HASH global_index_stats;
1824 +extern pthread_mutex_t LOCK_global_index_stats;
1825 +extern pthread_mutex_t LOCK_stats;
1827 extern const char *opt_date_time_formats[];
1828 extern KNOWN_DATE_TIME_FORMAT known_date_time_formats[];
1829 diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
1830 --- a/sql/mysqld.cc Wed Jul 29 13:33:34 2009 -0700
1831 +++ b/sql/mysqld.cc Wed Jul 29 13:34:11 2009 -0700
1833 uint opt_large_page_size= 0;
1834 my_bool opt_old_style_user_limits= 0, trust_function_creators= 0;
1835 char* opt_slow_logname= 0;
1836 +my_bool opt_userstat_running= 0;
1838 True if there is at least one per-hour limit for some user, so we should
1839 check them before each query (and possibly reset counters when hour is
1841 ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
1842 ulong max_connections, max_connect_errors;
1843 uint max_user_connections= 0;
1844 +ulonglong denied_connections = 0;
1846 Limit of the total number of prepared statements in the server.
1847 Is necessary to protect the server against out-of-memory attacks.
1848 @@ -555,6 +557,10 @@
1849 LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
1850 LOCK_global_system_variables,
1851 LOCK_user_conn, LOCK_slave_list, LOCK_active_mi;
1852 +pthread_mutex_t LOCK_stats;
1853 +pthread_mutex_t LOCK_global_user_client_stats;
1854 +pthread_mutex_t LOCK_global_table_stats;
1855 +pthread_mutex_t LOCK_global_index_stats;
1857 The below lock protects access to two global server variables:
1858 max_prepared_stmt_count and prepared_stmt_count. These variables
1859 @@ -1196,6 +1202,10 @@
1860 x_free(opt_secure_file_priv);
1861 bitmap_free(&temp_pool);
1862 free_max_user_conn();
1863 + free_global_user_stats();
1864 + free_global_client_stats();
1865 + free_global_table_stats();
1866 + free_global_index_stats();
1867 #ifdef HAVE_REPLICATION
1869 free_list(&replicate_do_db);
1870 @@ -1310,6 +1320,10 @@
1871 (void) pthread_cond_destroy(&COND_thread_cache);
1872 (void) pthread_cond_destroy(&COND_flush_thread_cache);
1873 (void) pthread_cond_destroy(&COND_manager);
1874 + (void) pthread_mutex_destroy(&LOCK_stats);
1875 + (void) pthread_mutex_destroy(&LOCK_global_user_client_stats);
1876 + (void) pthread_mutex_destroy(&LOCK_global_table_stats);
1877 + (void) pthread_mutex_destroy(&LOCK_global_index_stats);
1880 #endif /*EMBEDDED_LIBRARY*/
1881 @@ -3157,6 +3171,10 @@
1882 (void) pthread_mutex_init(&LOCK_rpl_status, MY_MUTEX_INIT_FAST);
1883 (void) pthread_cond_init(&COND_rpl_status, NULL);
1885 + (void) pthread_mutex_init(&LOCK_stats, MY_MUTEX_INIT_FAST);
1886 + (void) pthread_mutex_init(&LOCK_global_user_client_stats, MY_MUTEX_INIT_FAST);
1887 + (void) pthread_mutex_init(&LOCK_global_table_stats, MY_MUTEX_INIT_FAST);
1888 + (void) pthread_mutex_init(&LOCK_global_index_stats, MY_MUTEX_INIT_FAST);
1890 /* Parameter for threads created for connections */
1891 (void) pthread_attr_init(&connection_attrib);
1892 @@ -3431,6 +3449,10 @@
1893 sql_print_error("Out of memory");
1897 + init_global_table_stats();
1898 + init_global_index_stats();
1902 sql_print_error("Can't init databases");
1903 @@ -3513,6 +3535,8 @@
1905 init_max_user_conn();
1906 init_update_queries();
1907 + init_global_user_stats();
1908 + init_global_client_stats();
1912 @@ -4252,6 +4276,7 @@
1914 DBUG_PRINT("error",("Too many connections"));
1915 close_connection(thd, ER_CON_COUNT_ERROR, 1);
1916 + statistic_increment(denied_connections, &LOCK_status);
1920 @@ -5073,6 +5098,7 @@
1921 OPT_PROFILING_USE_GETRUSAGE,
1923 OPT_SLOW_QUERY_LOG_FILE,
1924 + OPT_USERSTAT_RUNNING,
1925 OPT_USE_GLOBAL_LONG_QUERY_TIME,
1926 OPT_INNODB_ROLLBACK_ON_TIMEOUT,
1927 OPT_SECURE_FILE_PRIV,
1928 @@ -6545,6 +6571,10 @@
1929 (gptr*) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
1930 REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT),
1932 + {"userstat_running", OPT_USERSTAT_RUNNING,
1933 + "Control USER_STATISTICS, CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS running",
1934 + (gptr*) &opt_userstat_running, (gptr*) &opt_userstat_running,
1935 + 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
1936 {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
1939 diff -ruN a/sql/set_var.cc b/sql/set_var.cc
1940 --- a/sql/set_var.cc Wed Jul 29 13:33:34 2009 -0700
1941 +++ b/sql/set_var.cc Wed Jul 29 13:34:11 2009 -0700
1943 sys_var_thd_ulong sys_read_buff_size("read_buffer_size",
1944 &SV::read_buff_size);
1945 sys_var_bool_ptr sys_readonly("read_only", &opt_readonly);
1946 +sys_var_bool_ptr sys_userstat_running("userstat_running", &opt_userstat_running);
1947 sys_var_thd_ulong sys_read_rnd_buff_size("read_rnd_buffer_size",
1948 &SV::read_rnd_buff_size);
1949 sys_var_thd_ulong sys_div_precincrement("div_precision_increment",
1951 &sys_trans_alloc_block_size,
1952 &sys_trans_prealloc_size,
1954 + &sys_userstat_running,
1956 #ifdef HAVE_BERKELEY_DB
1958 @@ -1197,6 +1199,7 @@
1959 {sys_tx_isolation.name, (char*) &sys_tx_isolation, SHOW_SYS},
1960 {sys_updatable_views_with_limit.name,
1961 (char*) &sys_updatable_views_with_limit,SHOW_SYS},
1962 + {sys_userstat_running.name, (char*) &sys_userstat_running, SHOW_SYS},
1963 {sys_use_global_long_query_time.name, (char*) &sys_use_global_long_query_time, SHOW_SYS},
1964 {sys_version.name, (char*) &sys_version, SHOW_SYS},
1965 #ifdef HAVE_BERKELEY_DB
1966 diff -ruN a/sql/share/Makefile.in b/sql/share/Makefile.in
1967 --- a/sql/share/Makefile.in Wed Jul 29 13:33:34 2009 -0700
1968 +++ b/sql/share/Makefile.in Wed Jul 29 13:34:11 2009 -0700
1971 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1976 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1977 diff -ruN a/sql/sql_base.cc b/sql/sql_base.cc
1978 --- a/sql/sql_base.cc Wed Jul 29 13:33:34 2009 -0700
1979 +++ b/sql/sql_base.cc Wed Jul 29 13:34:11 2009 -0700
1980 @@ -624,6 +624,12 @@
1981 DBUG_ENTER("close_thread_table");
1982 DBUG_ASSERT(table->key_read == 0);
1983 DBUG_ASSERT(!table->file || table->file->inited == handler::NONE);
1987 + table->file->update_global_table_stats();
1988 + table->file->update_global_index_stats();
1991 *table_ptr=table->next;
1992 if (table->needs_reopen_or_name_lock() ||
1995 DBUG_ENTER("close_temporary");
1996 char path[FN_REFLEN];
1998 + table->file->update_global_table_stats();
1999 + table->file->update_global_index_stats();
2000 db_type table_type=table->s->db_type;
2001 strmov(path,table->s->path);
2002 free_io_cache(table);
2003 diff -ruN a/sql/sql_class.cc b/sql/sql_class.cc
2004 --- a/sql/sql_class.cc Wed Jul 29 13:33:34 2009 -0700
2005 +++ b/sql/sql_class.cc Wed Jul 29 13:34:11 2009 -0700
2006 @@ -239,6 +239,13 @@
2007 bzero(ha_data, sizeof(ha_data));
2009 binlog_evt_union.do_union= FALSE;
2012 + bytes_received = 0;
2014 + binlog_bytes_written = 0;
2015 + updated_row_count = 0;
2016 + sent_row_count_2 = 0;
2018 dbug_sentry=THD_SENTRY_MAGIC;
2020 @@ -378,6 +385,88 @@
2021 total_warn_count= 0;
2023 bzero((char *) &status_var, sizeof(status_var));
2027 +// Resets stats in a THD.
2028 +void THD::reset_stats(void) {
2029 + current_connect_time = time(NULL);
2030 + last_global_update_time = current_connect_time;
2031 + reset_diff_stats();
2034 +// Resets the 'diff' stats, which are used to update global stats.
2035 +void THD::reset_diff_stats(void) {
2036 + diff_total_busy_time = 0;
2037 + diff_total_cpu_time = 0;
2038 + diff_total_bytes_received = 0;
2039 + diff_total_bytes_sent = 0;
2040 + diff_total_binlog_bytes_written = 0;
2041 + diff_total_sent_rows = 0;
2042 + diff_total_updated_rows = 0;
2043 + diff_total_read_rows = 0;
2044 + diff_select_commands = 0;
2045 + diff_update_commands = 0;
2046 + diff_other_commands = 0;
2047 + diff_commit_trans = 0;
2048 + diff_rollback_trans = 0;
2049 + diff_denied_connections = 0;
2050 + diff_lost_connections = 0;
2051 + diff_access_denied_errors = 0;
2052 + diff_empty_queries = 0;
2055 +// Updates 'diff' stats of a THD.
2056 +void THD::update_stats(bool ran_command) {
2057 + if (opt_userstat_running) {
2058 + diff_total_busy_time += busy_time;
2059 + diff_total_cpu_time += cpu_time;
2060 + diff_total_bytes_received += bytes_received;
2061 + diff_total_bytes_sent += bytes_sent;
2062 + diff_total_binlog_bytes_written += binlog_bytes_written;
2063 + diff_total_sent_rows += sent_row_count_2;
2064 + diff_total_updated_rows += updated_row_count;
2065 + // diff_total_read_rows is updated in handler.cc.
2067 + if (ran_command) {
2068 + // The replication thread has the COM_CONNECT command.
2069 + if ((old_command == COM_QUERY || command == COM_CONNECT) &&
2070 + (lex->sql_command >= 0 && lex->sql_command < SQLCOM_END)) {
2072 + if (lex->sql_command == SQLCOM_SELECT) {
2073 + if (lex->orig_sql_command == SQLCOM_END) {
2074 + diff_select_commands++;
2075 + if (!sent_row_count_2)
2076 + diff_empty_queries++;
2078 + // 'SHOW ' commands become SQLCOM_SELECT.
2079 + diff_other_commands++;
2080 + // 'SHOW ' commands shouldn't inflate total sent row count.
2081 + diff_total_sent_rows -= sent_row_count_2;
2083 + } else if (is_update_query(lex->sql_command)) {
2084 + diff_update_commands++;
2086 + diff_other_commands++;
2090 + // diff_commit_trans is updated in handler.cc.
2091 + // diff_rollback_trans is updated in handler.cc.
2092 + // diff_denied_connections is updated in sql_parse.cc.
2093 + // diff_lost_connections is updated in sql_parse.cc.
2094 + // diff_access_denied_errors is updated in sql_parse.cc.
2096 + /* reset counters to zero to avoid double-counting since values
2097 + are already store in diff_total_*. */
2101 + bytes_received = 0;
2103 + binlog_bytes_written = 0;
2104 + updated_row_count = 0;
2105 + sent_row_count_2 = 0;
2109 @@ -907,6 +996,33 @@
2113 +char *THD::get_client_host_port(THD *client)
2115 + Security_context *client_sctx= client->security_ctx;
2116 + char *client_host= NULL;
2118 + if (client->peer_port && (client_sctx->host || client_sctx->ip) &&
2119 + security_ctx->host_or_ip[0])
2121 + if ((client_host= this->alloc(LIST_PROCESS_HOST_LEN+1)))
2122 + my_snprintf((char *) client_host, LIST_PROCESS_HOST_LEN,
2123 + "%s:%u", client_sctx->host_or_ip, client->peer_port);
2126 + client_host= this->strdup(client_sctx->host_or_ip[0] ?
2127 + client_sctx->host_or_ip :
2128 + client_sctx->host ? client_sctx->host : "");
2130 + return client_host;
2133 +const char *get_client_host(THD *client)
2135 + return client->security_ctx->host_or_ip[0] ?
2136 + client->security_ctx->host_or_ip :
2137 + client->security_ctx->host ? client->security_ctx->host : "";
2141 struct Item_change_record: public ilink
2143 @@ -1082,6 +1198,7 @@
2144 buffer.set(buff, sizeof(buff), &my_charset_bin);
2146 thd->sent_row_count++;
2147 + thd->sent_row_count_2++;
2150 if (!thd->net.report_error)
2151 @@ -1174,6 +1291,7 @@
2152 select_export::~select_export()
2154 thd->sent_row_count=row_count;
2155 + thd->sent_row_count_2=row_count;
2159 @@ -2110,6 +2228,7 @@
2160 if (likely(thd != 0))
2161 { /* current_thd==0 when close_connection() calls net_send_error() */
2162 thd->status_var.bytes_sent+= length;
2163 + thd->bytes_sent+= length;
2167 @@ -2117,6 +2236,7 @@
2168 void thd_increment_bytes_received(ulong length)
2170 current_thd->status_var.bytes_received+= length;
2171 + current_thd->bytes_received+= length;
2175 diff -ruN a/sql/sql_class.h b/sql/sql_class.h
2176 --- a/sql/sql_class.h Wed Jul 29 13:33:34 2009 -0700
2177 +++ b/sql/sql_class.h Wed Jul 29 13:34:11 2009 -0700
2178 @@ -1308,6 +1308,8 @@
2179 first byte of the packet in do_command()
2181 enum enum_server_command command;
2182 + // Used to save the command, before it is set to COM_SLEEP.
2183 + enum enum_server_command old_command;
2185 uint32 file_id; // for LOAD DATA INFILE
2187 @@ -1504,6 +1506,8 @@
2188 /* variables.transaction_isolation is reset to this after each commit */
2189 enum_tx_isolation session_tx_isolation;
2190 enum_check_fields count_cuted_fields;
2191 + ha_rows updated_row_count;
2192 + ha_rows sent_row_count_2; /* for userstat */
2194 DYNAMIC_ARRAY user_var_events; /* For user variables replication */
2195 MEM_ROOT *user_var_events_alloc; /* Allocate above array elements here */
2196 @@ -1613,6 +1617,49 @@
2198 LOG_INFO* current_linfo;
2199 NET* slave_net; // network connection from slave -> m.
2202 + Used to update global user stats. The global user stats are updated
2203 + occasionally with the 'diff' variables. After the update, the 'diff'
2204 + variables are reset to 0.
2206 + // Time when the current thread connected to MySQL.
2207 + time_t current_connect_time;
2208 + // Last time when THD stats were updated in global_user_stats.
2209 + time_t last_global_update_time;
2210 + // Busy (non-idle) time for just one command.
2212 + // Busy time not updated in global_user_stats yet.
2213 + double diff_total_busy_time;
2214 + // Cpu (non-idle) time for just one thread.
2216 + // Cpu time not updated in global_user_stats yet.
2217 + double diff_total_cpu_time;
2218 + /* bytes counting */
2219 + ulonglong bytes_received;
2220 + ulonglong diff_total_bytes_received;
2221 + ulonglong bytes_sent;
2222 + ulonglong diff_total_bytes_sent;
2223 + ulonglong binlog_bytes_written;
2224 + ulonglong diff_total_binlog_bytes_written;
2226 + // Number of rows not reflected in global_user_stats yet.
2227 + ha_rows diff_total_sent_rows, diff_total_updated_rows, diff_total_read_rows;
2228 + // Number of commands not reflected in global_user_stats yet.
2229 + ulonglong diff_select_commands, diff_update_commands, diff_other_commands;
2230 + // Number of transactions not reflected in global_user_stats yet.
2231 + ulonglong diff_commit_trans, diff_rollback_trans;
2232 + // Number of connection errors not reflected in global_user_stats yet.
2233 + ulonglong diff_denied_connections, diff_lost_connections;
2234 + // Number of db access denied, not reflected in global_user_stats yet.
2235 + ulonglong diff_access_denied_errors;
2236 + // Number of queries that return 0 rows
2237 + ulonglong diff_empty_queries;
2239 + // Per account query delay in miliseconds. When not 0, sleep this number of
2240 + // milliseconds before every SQL command.
2241 + ulonglong query_delay_millis;
2243 /* Used by the sys_var class to store temporary values */
2246 @@ -1668,6 +1715,11 @@
2249 void init_for_queries();
2250 + void reset_stats(void);
2251 + void reset_diff_stats(void);
2252 + // ran_command is true when this is called immediately after a
2253 + // command has been run.
2254 + void update_stats(bool ran_command);
2255 void change_user(void);
2257 void cleanup_after_query();
2258 @@ -1901,8 +1953,14 @@
2260 *p_db_length= db_length;
2263 + // Returns string as 'IP:port' for the client-side of the connnection represented
2264 + // by 'client' as displayed by SHOW PROCESSLIST. Allocates memory from the heap of
2265 + // this THD and that is not reclaimed immediately, so use sparingly. May return NULL.
2268 + char *get_client_host_port(THD *client);
2272 Add an internal error handler to the thread execution context.
2273 @@ -1953,6 +2011,10 @@
2274 MEM_ROOT main_mem_root;
2277 +// Returns string as 'IP' for the client-side of the connection represented by
2278 +// 'client'. Does not allocate memory. May return "".
2279 +const char *get_client_host(THD *client);
2282 #define tmp_disable_binlog(A) \
2283 {ulonglong tmp_disable_binlog__save_options= (A)->options; \
2284 diff -ruN a/sql/sql_delete.cc b/sql/sql_delete.cc
2285 --- a/sql/sql_delete.cc Wed Jul 29 13:33:34 2009 -0700
2286 +++ b/sql/sql_delete.cc Wed Jul 29 13:34:11 2009 -0700
2288 send_ok(thd,deleted);
2289 DBUG_PRINT("info",("%ld records deleted",(long) deleted));
2291 + thd->updated_row_count += deleted;
2292 DBUG_RETURN(error >= 0 || thd->net.report_error);
2296 thd->row_count_func= deleted;
2297 ::send_ok(thd, deleted);
2299 + thd->updated_row_count += deleted;
2303 diff -ruN a/sql/sql_insert.cc b/sql/sql_insert.cc
2304 --- a/sql/sql_insert.cc Wed Jul 29 13:33:34 2009 -0700
2305 +++ b/sql/sql_insert.cc Wed Jul 29 13:34:11 2009 -0700
2307 thd->row_count_func= info.copied + info.deleted + updated;
2308 ::send_ok(thd, (ulong) thd->row_count_func, id, buff);
2310 + thd->updated_row_count += thd->row_count_func;
2311 thd->abort_on_warning= 0;
2314 @@ -3103,6 +3104,7 @@
2315 autoinc_value_of_first_inserted_row : thd->insert_id_used ?
2316 thd->last_insert_id : 0;
2317 ::send_ok(thd, (ulong) thd->row_count_func, id, buff);
2318 + thd->updated_row_count += thd->row_count_func;
2322 diff -ruN a/sql/sql_lex.h b/sql/sql_lex.h
2323 --- a/sql/sql_lex.h Wed Jul 29 13:33:34 2009 -0700
2324 +++ b/sql/sql_lex.h Wed Jul 29 13:34:11 2009 -0700
2326 When a command is added here, be sure it's also added in mysqld.cc
2327 in "struct show_var_st status_vars[]= {" ...
2329 + // TODO(mcallaghan): update status_vars in mysqld to export these
2330 + SQLCOM_SHOW_USER_STATS, SQLCOM_SHOW_TABLE_STATS, SQLCOM_SHOW_INDEX_STATS,
2331 + SQLCOM_SHOW_CLIENT_STATS,
2332 /* This should be the last !!! */
2335 diff -ruN a/sql/sql_parse.cc b/sql/sql_parse.cc
2336 --- a/sql/sql_parse.cc Wed Jul 29 13:33:34 2009 -0700
2337 +++ b/sql/sql_parse.cc Wed Jul 29 13:34:11 2009 -0700
2339 const char *table_name);
2340 static bool check_show_create_table_access(THD *thd, TABLE_LIST *table);
2342 +// Increments connection count for user.
2343 +static int increment_connection_count(THD* thd, bool use_lock);
2345 +// Uses the THD to update the global stats by user name and client IP
2346 +void update_global_user_stats(THD* thd, bool create_user, time_t now);
2348 const char *any_db="*any*"; // Special symbol for check_access
2350 const char *command_name[]={
2351 @@ -146,6 +152,17 @@
2352 static bool do_command(THD *thd);
2353 #endif // EMBEDDED_LIBRARY
2355 +HASH global_user_stats;
2356 +HASH global_client_stats;
2357 +// Protects global_user_stats and global_client_stats
2358 +extern pthread_mutex_t LOCK_global_user_client_stats;
2360 +HASH global_table_stats;
2361 +extern pthread_mutex_t LOCK_global_table_stats;
2363 +HASH global_index_stats;
2364 +extern pthread_mutex_t LOCK_global_index_stats;
2367 extern void win_install_sigabrt_handler(void);
2370 mysql_log.write(thd,COM_CONNECT,"%s",ER(ER_NOT_SUPPORTED_AUTH_MODE));
2373 + thd->diff_access_denied_errors++;
2374 net_printf_error(thd, ER_ACCESS_DENIED_ERROR,
2375 thd->main_security_ctx.user,
2376 thd->main_security_ctx.host_or_ip,
2377 @@ -543,13 +561,191 @@
2378 void init_max_user_conn(void)
2380 #ifndef NO_EMBEDDED_ACCESS_CHECKS
2381 - (void) hash_init(&hash_user_connections,system_charset_info,max_connections,
2383 - (hash_get_key) get_key_conn, (hash_free_key) free_user,
2385 + if (hash_init(&hash_user_connections,system_charset_info,max_connections,
2387 + (hash_get_key) get_key_conn, (hash_free_key) free_user,
2389 + sql_print_error("Initializing hash_user_connections failed.");
2395 +byte *get_key_user_stats(USER_STATS *user_stats, uint *length,
2396 + my_bool not_used __attribute__((unused)))
2398 + *length = strlen(user_stats->user);
2399 + return (byte*)user_stats->user;
2402 +void free_user_stats(USER_STATS* user_stats)
2404 + my_free((char*)user_stats, MYF(0));
2407 +void init_user_stats(USER_STATS *user_stats,
2409 + const char *priv_user,
2410 + uint total_connections,
2411 + uint concurrent_connections,
2412 + time_t connected_time,
2415 + ulonglong bytes_received,
2416 + ulonglong bytes_sent,
2417 + ulonglong binlog_bytes_written,
2418 + ha_rows rows_fetched,
2419 + ha_rows rows_updated,
2420 + ha_rows rows_read,
2421 + ulonglong select_commands,
2422 + ulonglong update_commands,
2423 + ulonglong other_commands,
2424 + ulonglong commit_trans,
2425 + ulonglong rollback_trans,
2426 + ulonglong denied_connections,
2427 + ulonglong lost_connections,
2428 + ulonglong access_denied_errors,
2429 + ulonglong empty_queries)
2431 + DBUG_ENTER("init_user_stats");
2432 + DBUG_PRINT("info",
2433 + ("Add user_stats entry for user %s - priv_user %s",
2434 + user, priv_user));
2435 + strncpy(user_stats->user, user, sizeof(user_stats->user));
2436 + strncpy(user_stats->priv_user, priv_user, sizeof(user_stats->priv_user));
2438 + user_stats->total_connections = total_connections;
2439 + user_stats->concurrent_connections = concurrent_connections;
2440 + user_stats->connected_time = connected_time;
2441 + user_stats->busy_time = busy_time;
2442 + user_stats->cpu_time = cpu_time;
2443 + user_stats->bytes_received = bytes_received;
2444 + user_stats->bytes_sent = bytes_sent;
2445 + user_stats->binlog_bytes_written = binlog_bytes_written;
2446 + user_stats->rows_fetched = rows_fetched;
2447 + user_stats->rows_updated = rows_updated;
2448 + user_stats->rows_read = rows_read;
2449 + user_stats->select_commands = select_commands;
2450 + user_stats->update_commands = update_commands;
2451 + user_stats->other_commands = other_commands;
2452 + user_stats->commit_trans = commit_trans;
2453 + user_stats->rollback_trans = rollback_trans;
2454 + user_stats->denied_connections = denied_connections;
2455 + user_stats->lost_connections = lost_connections;
2456 + user_stats->access_denied_errors = access_denied_errors;
2457 + user_stats->empty_queries = empty_queries;
2461 +void add_user_stats(USER_STATS *user_stats,
2462 + uint total_connections,
2463 + uint concurrent_connections,
2464 + time_t connected_time,
2467 + ulonglong bytes_received,
2468 + ulonglong bytes_sent,
2469 + ulonglong binlog_bytes_written,
2470 + ha_rows rows_fetched,
2471 + ha_rows rows_updated,
2472 + ha_rows rows_read,
2473 + ulonglong select_commands,
2474 + ulonglong update_commands,
2475 + ulonglong other_commands,
2476 + ulonglong commit_trans,
2477 + ulonglong rollback_trans,
2478 + ulonglong denied_connections,
2479 + ulonglong lost_connections,
2480 + ulonglong access_denied_errors,
2481 + ulonglong empty_queries)
2483 + user_stats->total_connections += total_connections;
2484 + user_stats->concurrent_connections += concurrent_connections;
2485 + user_stats->connected_time += connected_time;
2486 + user_stats->busy_time += busy_time;
2487 + user_stats->cpu_time += cpu_time;
2488 + user_stats->bytes_received += bytes_received;
2489 + user_stats->bytes_sent += bytes_sent;
2490 + user_stats->binlog_bytes_written += binlog_bytes_written;
2491 + user_stats->rows_fetched += rows_fetched;
2492 + user_stats->rows_updated += rows_updated;
2493 + user_stats->rows_read += rows_read;
2494 + user_stats->select_commands += select_commands;
2495 + user_stats->update_commands += update_commands;
2496 + user_stats->other_commands += other_commands;
2497 + user_stats->commit_trans += commit_trans;
2498 + user_stats->rollback_trans += rollback_trans;
2499 + user_stats->denied_connections += denied_connections;
2500 + user_stats->lost_connections += lost_connections;
2501 + user_stats->access_denied_errors += access_denied_errors;
2502 + user_stats->empty_queries += empty_queries;
2505 +void init_global_user_stats(void)
2507 + if (hash_init(&global_user_stats, system_charset_info, max_connections,
2508 + 0, 0, (hash_get_key)get_key_user_stats,
2509 + (hash_free_key)free_user_stats, 0)) {
2510 + sql_print_error("Initializing global_user_stats failed.");
2515 +void init_global_client_stats(void)
2517 + if (hash_init(&global_client_stats, system_charset_info, max_connections,
2518 + 0, 0, (hash_get_key)get_key_user_stats,
2519 + (hash_free_key)free_user_stats, 0)) {
2520 + sql_print_error("Initializing global_client_stats failed.");
2525 +extern "C" byte *get_key_table_stats(TABLE_STATS *table_stats, uint *length,
2526 + my_bool not_used __attribute__((unused)))
2528 + *length = strlen(table_stats->table);
2529 + return (byte*)table_stats->table;
2532 +extern "C" void free_table_stats(TABLE_STATS* table_stats)
2534 + my_free((char*)table_stats, MYF(0));
2537 +void init_global_table_stats(void)
2539 + if (hash_init(&global_table_stats, system_charset_info, max_connections,
2540 + 0, 0, (hash_get_key)get_key_table_stats,
2541 + (hash_free_key)free_table_stats, 0)) {
2542 + sql_print_error("Initializing global_table_stats failed.");
2547 +extern "C" byte *get_key_index_stats(INDEX_STATS *index_stats, uint *length,
2548 + my_bool not_used __attribute__((unused)))
2550 + *length = strlen(index_stats->index);
2551 + return (byte*)index_stats->index;
2554 +extern "C" void free_index_stats(INDEX_STATS* index_stats)
2556 + my_free((char*)index_stats, MYF(0));
2559 +void init_global_index_stats(void)
2561 + if (hash_init(&global_index_stats, system_charset_info, max_connections,
2562 + 0, 0, (hash_get_key)get_key_index_stats,
2563 + (hash_free_key)free_index_stats, 0)) {
2564 + sql_print_error("Initializing global_index_stats failed.");
2572 check if user has already too many connections
2573 @@ -606,7 +802,10 @@
2578 + statistic_increment(denied_connections, &LOCK_status);
2579 uc->connections--; // no need for decrease_user_connections() here
2581 (void) pthread_mutex_unlock(&LOCK_user_conn);
2584 @@ -653,6 +852,25 @@
2585 #endif /* NO_EMBEDDED_ACCESS_CHECKS */
2588 +void free_global_user_stats(void)
2590 + hash_free(&global_user_stats);
2593 +void free_global_table_stats(void)
2595 + hash_free(&global_table_stats);
2598 +void free_global_index_stats(void)
2600 + hash_free(&global_index_stats);
2603 +void free_global_client_stats(void)
2605 + hash_free(&global_client_stats);
2610 @@ -705,6 +923,214 @@
2611 return uc_update_queries[command] != 0;
2614 +// 'mysql_system_user' is used for when the user is not defined for a THD.
2615 +static char mysql_system_user[] = "#mysql_system#";
2617 +// Returns 'user' if it's not NULL. Returns 'mysql_system_user' otherwise.
2618 +static char* get_valid_user_string(char* user) {
2619 + return user ? user : mysql_system_user;
2622 +// Increments the global stats connection count for an entry from
2623 +// global_client_stats or global_user_stats. Returns 0 on success
2625 +static int increment_count_by_name(const char *name, const char *role_name,
2626 + HASH *users_or_clients, THD *thd)
2628 + USER_STATS* user_stats;
2630 + if (!(user_stats = (USER_STATS*)hash_search(users_or_clients, name,
2633 + // First connection for this user or client
2634 + if (!(user_stats = ((USER_STATS*)
2635 + my_malloc(sizeof(USER_STATS), MYF(MY_WME | MY_ZEROFILL)))))
2637 + return 1; // Out of memory
2640 + init_user_stats(user_stats, name, role_name,
2641 + 0, 0, // connections
2643 + 0, 0, 0, // bytes sent, received and written
2644 + 0, 0, 0, // rows fetched, updated and read
2645 + 0, 0, 0, // select, update and other commands
2646 + 0, 0, // commit and rollback trans
2647 + thd->diff_denied_connections,
2648 + 0, // lost connections
2649 + 0, // access denied errors
2650 + 0); // empty queries
2652 + if (my_hash_insert(users_or_clients, (byte*)user_stats))
2654 + my_free((char*)user_stats, 0);
2655 + return 1; // Out of memory
2658 + user_stats->total_connections++;
2662 +// Increments the global user and client stats connection count. If 'use_lock'
2663 +// is true, LOCK_global_user_client_stats will be locked/unlocked. Returns
2664 +// 0 on success, 1 on error.
2665 +static int increment_connection_count(THD* thd, bool use_lock)
2667 + char* user_string = get_valid_user_string(thd->main_security_ctx.user);
2668 + const char* client_string = get_client_host(thd);
2669 + int return_value = 0;
2671 + if (!opt_userstat_running)
2672 + return return_value;
2674 + if (use_lock) pthread_mutex_lock(&LOCK_global_user_client_stats);
2676 + if (increment_count_by_name(user_string, user_string,
2677 + &global_user_stats, thd))
2682 + if (increment_count_by_name(client_string,
2684 + &global_client_stats, thd))
2691 + if (use_lock) pthread_mutex_unlock(&LOCK_global_user_client_stats);
2692 + return return_value;
2695 +// Used to update the global user and client stats.
2696 +static void update_global_user_stats_with_user(THD* thd,
2697 + USER_STATS* user_stats,
2700 + user_stats->connected_time += now - thd->last_global_update_time;
2701 + thd->last_global_update_time = now;
2702 + user_stats->busy_time += thd->diff_total_busy_time;
2703 + user_stats->cpu_time += thd->diff_total_cpu_time;
2704 + user_stats->bytes_received += thd->diff_total_bytes_received;
2705 + user_stats->bytes_sent += thd->diff_total_bytes_sent;
2706 + user_stats->binlog_bytes_written += thd->diff_total_binlog_bytes_written;
2707 + user_stats->rows_fetched += thd->diff_total_sent_rows;
2708 + user_stats->rows_updated += thd->diff_total_updated_rows;
2709 + user_stats->rows_read += thd->diff_total_read_rows;
2710 + user_stats->select_commands += thd->diff_select_commands;
2711 + user_stats->update_commands += thd->diff_update_commands;
2712 + user_stats->other_commands += thd->diff_other_commands;
2713 + user_stats->commit_trans += thd->diff_commit_trans;
2714 + user_stats->rollback_trans += thd->diff_rollback_trans;
2715 + user_stats->denied_connections += thd->diff_denied_connections;
2716 + user_stats->lost_connections += thd->diff_lost_connections;
2717 + user_stats->access_denied_errors += thd->diff_access_denied_errors;
2718 + user_stats->empty_queries += thd->diff_empty_queries;
2721 +// Updates the global stats of a user or client
2722 +void update_global_user_stats(THD* thd, bool create_user, time_t now)
2724 + if (opt_userstat_running) {
2725 + char* user_string = get_valid_user_string(thd->main_security_ctx.user);
2726 + const char* client_string = get_client_host(thd);
2728 + USER_STATS* user_stats;
2729 + pthread_mutex_lock(&LOCK_global_user_client_stats);
2731 + // Update by user name
2732 + if ((user_stats = (USER_STATS*)hash_search(&global_user_stats,
2733 + (byte*)user_string,
2734 + strlen(user_string)))) {
2736 + update_global_user_stats_with_user(thd, user_stats, now);
2738 + // Create the entry
2739 + if (create_user) {
2740 + increment_count_by_name(user_string, user_string,
2741 + &global_user_stats, thd);
2745 + // Update by client IP
2746 + if ((user_stats = (USER_STATS*)hash_search(&global_client_stats,
2747 + (byte*)client_string,
2748 + strlen(client_string)))) {
2749 + // Found by client IP
2750 + update_global_user_stats_with_user(thd, user_stats, now);
2752 + // Create the entry
2753 + if (create_user) {
2754 + increment_count_by_name(client_string,
2756 + &global_client_stats, thd);
2759 + thd->reset_diff_stats();
2761 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
2763 + thd->reset_diff_stats();
2767 +// Determines the concurrent number of connections of current threads.
2768 +static void set_connections_stats()
2770 + USER_STATS* user_stats;
2772 + pthread_mutex_lock(&LOCK_global_user_client_stats);
2773 + pthread_mutex_lock(&LOCK_thread_count);
2775 + // Resets all concurrent connections to 0.
2776 + for (int i = 0; i < global_user_stats.records; ++i) {
2777 + user_stats = (USER_STATS*)hash_element(&global_user_stats, i);
2778 + user_stats->concurrent_connections = 0;
2780 + for (int i = 0; i < global_client_stats.records; ++i) {
2781 + user_stats = (USER_STATS*)hash_element(&global_client_stats, i);
2782 + user_stats->concurrent_connections = 0;
2785 + I_List_iterator<THD> it(threads);
2787 + time_t now = time(NULL);
2788 + // Iterates through the current threads.
2789 + while ((thd = it++)) {
2790 + char* user_string = get_valid_user_string(thd->main_security_ctx.user);
2791 + if ((user_stats = (USER_STATS*)hash_search(&global_user_stats,
2792 + (byte*)user_string,
2793 + strlen(user_string)))) {
2795 + user_stats->concurrent_connections++;
2796 + update_global_user_stats_with_user(thd, user_stats, now);
2798 + // The user name should exist.
2799 + if (user_string == mysql_system_user) {
2800 + // Only create the user if it is the mysql_system_user
2801 + increment_count_by_name(user_string, user_string,
2802 + &global_user_stats, thd);
2806 + const char* client_string = get_client_host(thd);
2807 + if ((user_stats = (USER_STATS*)hash_search(&global_client_stats,
2808 + (byte*)client_string,
2809 + strlen(client_string)))) {
2811 + user_stats->concurrent_connections++;
2812 + update_global_user_stats_with_user(thd, user_stats, now);
2814 + // Do nothing, unlike what is done for global_user_stats
2816 + thd->reset_diff_stats();
2818 + pthread_mutex_unlock(&LOCK_thread_count);
2819 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
2823 Reset per-hour user resource limits when it has been more than
2824 an hour since they were last checked
2825 @@ -1190,6 +1616,8 @@
2826 my_net_set_read_timeout(net, connect_timeout);
2827 my_net_set_write_timeout(net, connect_timeout);
2829 + bool create_user = true;
2831 if ((error=check_connection(thd)))
2832 { // Wrong permissions
2834 @@ -1199,8 +1627,22 @@
2835 my_sleep(1000); /* must wait after eof() */
2837 statistic_increment(aborted_connects,&LOCK_status);
2838 + thd->diff_denied_connections++;
2839 + if (error == -2) {
2840 + // Do not create statistics for a user who does not exist, or failed
2841 + // to authenticate.
2842 + create_user = false;
2847 + thd->reset_stats();
2848 + // Updates global user connection stats.
2849 + if (increment_connection_count(thd, true)) {
2850 + net_send_error(thd, ER_OUTOFMEMORY); // Out of memory
2855 netware_reg_user(sctx->ip, sctx->user, "MySQL");
2857 @@ -1257,6 +1699,7 @@
2858 (net->vio && net->error && net->report_error))
2860 statistic_increment(aborted_threads, &LOCK_status);
2861 + thd->diff_lost_connections++;
2864 if (net->error && net->vio != 0 && net->report_error)
2865 @@ -1276,6 +1719,8 @@
2868 close_connection(thd, 0, 1);
2869 + thd->update_stats(false);
2870 + update_global_user_stats(thd, create_user, time(NULL));
2873 If end_thread returns, we are either running with --one-thread
2874 @@ -1606,6 +2051,13 @@
2876 thd->clear_error(); // Clear error message
2878 + thd->updated_row_count=0;
2881 + thd->bytes_received=0;
2882 + thd->bytes_sent=0;
2883 + thd->binlog_bytes_written=0;
2885 net_new_transaction(net);
2887 packet_length= my_net_read(net);
2888 @@ -1764,6 +2216,9 @@
2891 thd->command=command;
2892 + // To increment the corrent command counter for user stats, 'command' must
2893 + // be saved because it is set to COM_SLEEP at the end of this function.
2894 + thd->old_command = command;
2896 Commands which always take a long time are logged into
2897 the slow log only if opt_log_slow_admin_statements is set.
2898 @@ -4569,6 +5024,15 @@
2899 if (check_global_access(thd,RELOAD_ACL))
2902 + if(lex->type & REFRESH_SLOW_QUERY_LOG) {
2903 + /* We are only flushing slow query log */
2904 + mysql_slow_log.new_file(1);
2912 reload_acl_and_cache() will tell us if we are allowed to write to the
2914 @@ -4877,6 +5341,7 @@
2916 if (check_global_access(thd, SUPER_ACL))
2918 + thd->diff_access_denied_errors++;
2919 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
2920 goto create_sp_error;
2922 @@ -5721,6 +6186,7 @@
2925 const char *db_name= db ? db : thd->db;
2926 + thd->diff_access_denied_errors++;
2927 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
2928 sctx->priv_user, sctx->priv_host, db_name);
2930 @@ -5756,6 +6222,7 @@
2931 { // We can never grant this
2932 DBUG_PRINT("error",("No possible access"));
2934 + thd->diff_access_denied_errors++;
2935 my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
2938 @@ -5788,11 +6255,15 @@
2940 DBUG_PRINT("error",("Access denied"));
2943 + // increment needs !no_errors condition, otherwise double counting.
2944 + thd->diff_access_denied_errors++;
2945 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
2946 sctx->priv_user, sctx->priv_host,
2947 (db ? db : (thd->db ?
2949 "unknown"))); /* purecov: tested */
2951 DBUG_RETURN(TRUE); /* purecov: tested */
2952 #endif /* NO_EMBEDDED_ACCESS_CHECKS */
2954 @@ -5826,6 +6297,7 @@
2955 if ((thd->security_ctx->master_access & want_access))
2957 get_privilege_desc(command, sizeof(command), want_access);
2958 + thd->diff_access_denied_errors++;
2959 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);
2961 #endif /* NO_EMBEDDED_ACCESS_CHECKS */
2962 @@ -5858,6 +6330,7 @@
2964 if (!thd->col_access && check_grant_db(thd, dst_db_name))
2966 + thd->diff_access_denied_errors++;
2967 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
2968 thd->security_ctx->priv_user,
2969 thd->security_ctx->priv_host,
2970 @@ -5889,6 +6362,12 @@
2971 check_grant(thd, SELECT_ACL, dst_table, 2, UINT_MAX, FALSE);
2975 + case SCH_USER_STATS:
2976 + case SCH_CLIENT_STATS:
2977 + return check_global_access(thd, SUPER_ACL | PROCESS_ACL);
2978 + case SCH_TABLE_STATS:
2979 + case SCH_INDEX_STATS:
2980 case SCH_OPEN_TABLES:
2983 @@ -5942,8 +6421,8 @@
2984 #ifndef NO_EMBEDDED_ACCESS_CHECKS
2985 TABLE_LIST *org_tables= tables;
2987 - TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table();
2988 Security_context *sctx= thd->security_ctx, *backup_ctx= thd->security_ctx;
2989 + TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table();
2991 The check that first_not_own_table is not reached is for the case when
2992 the given table list refers to the list for prelocking (contains tables
2993 @@ -5960,9 +6439,12 @@
2994 (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
2998 + thd->diff_access_denied_errors++;
2999 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
3000 sctx->priv_user, sctx->priv_host,
3001 INFORMATION_SCHEMA_NAME.str);
3006 @@ -6472,6 +6954,30 @@
3008 mysql_reset_thd_for_next_command(thd);
3010 + int start_time_error = 0;
3011 + int end_time_error = 0;
3012 + struct timeval start_time, end_time;
3013 + double start_usecs = 0;
3014 + double end_usecs = 0;
3016 + int cputime_error = 0;
3017 + struct timespec tp;
3018 + double start_cpu_nsecs = 0;
3019 + double end_cpu_nsecs = 0;
3021 + if (opt_userstat_running) {
3022 +#ifdef HAVE_CLOCK_GETTIME
3023 + /* get start cputime */
3024 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3025 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3028 + // Gets the start time, in order to measure how long this command takes.
3029 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3030 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3034 if (query_cache_send_result_to_client(thd, (char*) inBuf, length) <= 0)
3037 @@ -6550,6 +7056,43 @@
3038 *found_semicolon= NULL;
3041 + if (opt_userstat_running) {
3042 + // Gets the end time.
3043 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3044 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3047 + // Calculates the difference between the end and start times.
3048 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3049 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3050 + // In case there are bad values, 2629743 is the #seconds in a month.
3051 + if (thd->busy_time > 2629743) {
3052 + thd->busy_time = 0;
3055 + // end time went back in time, or gettimeofday() failed.
3056 + thd->busy_time = 0;
3059 +#ifdef HAVE_CLOCK_GETTIME
3060 + /* get end cputime */
3061 + if (!cputime_error &&
3062 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3063 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3065 + if (start_cpu_nsecs && !cputime_error) {
3066 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3067 + // In case there are bad values, 2629743 is the #seconds in a month.
3068 + if (thd->cpu_time > 2629743) {
3069 + thd->cpu_time = 0;
3072 + thd->cpu_time = 0;
3074 + // Updates THD stats and the global user stats.
3075 + thd->update_stats(true);
3076 + update_global_user_stats(thd, true, time(NULL));
3081 @@ -7561,8 +8104,35 @@
3082 pthread_mutex_unlock(&LOCK_active_mi);
3085 - if (options & REFRESH_USER_RESOURCES)
3086 - reset_mqh((LEX_USER *) NULL);
3087 + if (options & REFRESH_TABLE_STATS)
3089 + pthread_mutex_lock(&LOCK_global_table_stats);
3090 + free_global_table_stats();
3091 + init_global_table_stats();
3092 + pthread_mutex_unlock(&LOCK_global_table_stats);
3094 + if (options & REFRESH_INDEX_STATS)
3096 + pthread_mutex_lock(&LOCK_global_index_stats);
3097 + free_global_index_stats();
3098 + init_global_index_stats();
3099 + pthread_mutex_unlock(&LOCK_global_index_stats);
3101 + if (options & (REFRESH_USER_STATS | REFRESH_CLIENT_STATS))
3103 + pthread_mutex_lock(&LOCK_global_user_client_stats);
3104 + if (options & REFRESH_USER_STATS)
3106 + free_global_user_stats();
3107 + init_global_user_stats();
3109 + if (options & REFRESH_CLIENT_STATS)
3111 + free_global_client_stats();
3112 + init_global_client_stats();
3114 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
3116 *write_to_binlog= tmp_write_to_binlog;
3119 diff -ruN a/sql/sql_prepare.cc b/sql/sql_prepare.cc
3120 --- a/sql/sql_prepare.cc Wed Jul 29 13:33:34 2009 -0700
3121 +++ b/sql/sql_prepare.cc Wed Jul 29 13:34:11 2009 -0700
3123 #include <mysql_com.h>
3126 +// Uses the THD to update the global stats by user name and client IP
3127 +void update_global_user_stats(THD* thd, bool create_user, time_t now);
3129 /* A result class used to send cursor rows using the binary protocol. */
3131 class Select_fetch_protocol_prep: public select_send
3132 @@ -1910,8 +1913,32 @@
3133 /* First of all clear possible warnings from the previous command */
3134 mysql_reset_thd_for_next_command(thd);
3136 + int start_time_error = 0;
3137 + int end_time_error = 0;
3138 + struct timeval start_time, end_time;
3139 + double start_usecs = 0;
3140 + double end_usecs = 0;
3142 + int cputime_error = 0;
3143 + struct timespec tp;
3144 + double start_cpu_nsecs = 0;
3145 + double end_cpu_nsecs = 0;
3147 + if (opt_userstat_running) {
3148 +#ifdef HAVE_CLOCK_GETTIME
3149 + /* get start cputime */
3150 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3151 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3154 + // Gets the start time, in order to measure how long this command takes.
3155 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3156 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3160 if (! (stmt= new Prepared_statement(thd, &thd->protocol_prep)))
3161 - DBUG_VOID_RETURN; /* out of memory: error is set in Sql_alloc */
3162 + goto end; /* out of memory: error is set in Sql_alloc */
3164 if (thd->stmt_map.insert(thd, stmt))
3166 @@ -1919,7 +1946,7 @@
3167 The error is set in the insert. The statement itself
3168 will be also deleted there (this is how the hash works).
3174 /* Reset warnings from previous command */
3175 @@ -1941,6 +1968,44 @@
3176 thd->stmt_map.erase(stmt);
3178 /* check_prepared_statemnt sends the metadata packet in case of success */
3180 + if (opt_userstat_running) {
3181 + // Gets the end time.
3182 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3183 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3186 + // Calculates the difference between the end and start times.
3187 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3188 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3189 + // In case there are bad values, 2629743 is the #seconds in a month.
3190 + if (thd->busy_time > 2629743) {
3191 + thd->busy_time = 0;
3194 + // end time went back in time, or gettimeofday() failed.
3195 + thd->busy_time = 0;
3198 +#ifdef HAVE_CLOCK_GETTIME
3199 + /* get end cputime */
3200 + if (!cputime_error &&
3201 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3202 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3204 + if (start_cpu_nsecs && !cputime_error) {
3205 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3206 + // In case there are bad values, 2629743 is the #seconds in a month.
3207 + if (thd->cpu_time > 2629743) {
3208 + thd->cpu_time = 0;
3211 + thd->cpu_time = 0;
3213 + // Updates THD stats and the global user stats.
3214 + thd->update_stats(true);
3215 + update_global_user_stats(thd, true, time(NULL));
3220 @@ -2280,8 +2345,32 @@
3221 /* First of all clear possible warnings from the previous command */
3222 mysql_reset_thd_for_next_command(thd);
3224 + int start_time_error = 0;
3225 + int end_time_error = 0;
3226 + struct timeval start_time, end_time;
3227 + double start_usecs = 0;
3228 + double end_usecs = 0;
3230 + int cputime_error = 0;
3231 + struct timespec tp;
3232 + double start_cpu_nsecs = 0;
3233 + double end_cpu_nsecs = 0;
3235 + if (opt_userstat_running) {
3236 +#ifdef HAVE_CLOCK_GETTIME
3237 + /* get start cputime */
3238 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3239 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3242 + // Gets the start time, in order to measure how long this command takes.
3243 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3244 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3248 if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_execute")))
3252 #if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
3253 thd->profiling.set_query_source(stmt->query, stmt->query_length);
3254 @@ -2324,11 +2413,50 @@
3255 test(flags & (ulong) CURSOR_TYPE_READ_ONLY));
3256 if (!(specialflag & SPECIAL_NO_PRIOR))
3257 my_pthread_setprio(pthread_self(), WAIT_PRIOR);
3261 set_params_data_err:
3262 my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_stmt_execute");
3263 reset_stmt_params(stmt);
3266 + if (opt_userstat_running) {
3267 + // Gets the end time.
3268 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3269 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3272 + // Calculates the difference between the end and start times.
3273 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3274 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3275 + // In case there are bad values, 2629743 is the #seconds in a month.
3276 + if (thd->busy_time > 2629743) {
3277 + thd->busy_time = 0;
3280 + // end time went back in time, or gettimeofday() failed.
3281 + thd->busy_time = 0;
3284 +#ifdef HAVE_CLOCK_GETTIME
3285 + /* get end cputime */
3286 + if (!cputime_error &&
3287 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3288 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3290 + if (start_cpu_nsecs && !cputime_error) {
3291 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3292 + // In case there are bad values, 2629743 is the #seconds in a month.
3293 + if (thd->cpu_time > 2629743) {
3294 + thd->cpu_time = 0;
3297 + thd->cpu_time = 0;
3299 + // Updates THD stats and the global user stats.
3300 + thd->update_stats(true);
3301 + update_global_user_stats(thd, true, time(NULL));
3306 @@ -2422,6 +2550,31 @@
3308 /* First of all clear possible warnings from the previous command */
3309 mysql_reset_thd_for_next_command(thd);
3311 + int start_time_error = 0;
3312 + int end_time_error = 0;
3313 + struct timeval start_time, end_time;
3314 + double start_usecs = 0;
3315 + double end_usecs = 0;
3317 + int cputime_error = 0;
3318 + struct timespec tp;
3319 + double start_cpu_nsecs = 0;
3320 + double end_cpu_nsecs = 0;
3322 + if (opt_userstat_running) {
3323 +#ifdef HAVE_CLOCK_GETTIME
3324 + /* get start cputime */
3325 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3326 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3329 + // Gets the start time, in order to measure how long this command takes.
3330 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3331 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3335 statistic_increment(thd->status_var.com_stmt_fetch, &LOCK_status);
3336 if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_fetch")))
3338 @@ -2454,6 +2607,43 @@
3339 thd->restore_backup_statement(stmt, &stmt_backup);
3340 thd->stmt_arena= thd;
3342 + if (opt_userstat_running) {
3343 + // Gets the end time.
3344 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3345 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3348 + // Calculates the difference between the end and start times.
3349 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3350 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3351 + // In case there are bad values, 2629743 is the #seconds in a month.
3352 + if (thd->busy_time > 2629743) {
3353 + thd->busy_time = 0;
3356 + // end time went back in time, or gettimeofday() failed.
3357 + thd->busy_time = 0;
3360 +#ifdef HAVE_CLOCK_GETTIME
3361 + /* get end cputime */
3362 + if (!cputime_error &&
3363 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3364 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3366 + if (start_cpu_nsecs && !cputime_error) {
3367 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3368 + // In case there are bad values, 2629743 is the #seconds in a month.
3369 + if (thd->cpu_time > 2629743) {
3370 + thd->cpu_time = 0;
3373 + thd->cpu_time = 0;
3375 + // Updates THD stats and the global user stats.
3376 + thd->update_stats(true);
3377 + update_global_user_stats(thd, true, time(NULL));
3382 @@ -2486,6 +2676,30 @@
3383 /* First of all clear possible warnings from the previous command */
3384 mysql_reset_thd_for_next_command(thd);
3386 + int start_time_error = 0;
3387 + int end_time_error = 0;
3388 + struct timeval start_time, end_time;
3389 + double start_usecs = 0;
3390 + double end_usecs = 0;
3392 + int cputime_error = 0;
3393 + struct timespec tp;
3394 + double start_cpu_nsecs = 0;
3395 + double end_cpu_nsecs = 0;
3397 + if (opt_userstat_running) {
3398 +#ifdef HAVE_CLOCK_GETTIME
3399 + /* get start cputime */
3400 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3401 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3404 + // Gets the start time, in order to measure how long this command takes.
3405 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3406 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3410 statistic_increment(thd->status_var.com_stmt_reset, &LOCK_status);
3411 if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_reset")))
3413 @@ -2502,6 +2716,43 @@
3417 + if (opt_userstat_running) {
3418 + // Gets the end time.
3419 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3420 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3423 + // Calculates the difference between the end and start times.
3424 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3425 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3426 + // In case there are bad values, 2629743 is the #seconds in a month.
3427 + if (thd->busy_time > 2629743) {
3428 + thd->busy_time = 0;
3431 + // end time went back in time, or gettimeofday() failed.
3432 + thd->busy_time = 0;
3435 +#ifdef HAVE_CLOCK_GETTIME
3436 + /* get end cputime */
3437 + if (!cputime_error &&
3438 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3439 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3441 + if (start_cpu_nsecs && !cputime_error) {
3442 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3443 + // In case there are bad values, 2629743 is the #seconds in a month.
3444 + if (thd->cpu_time > 2629743) {
3445 + thd->cpu_time = 0;
3448 + thd->cpu_time = 0;
3450 + // Updates THD stats and the global user stats.
3451 + thd->update_stats(true);
3452 + update_global_user_stats(thd, true, time(NULL));
3457 --- mysql-5.0.92/sql/sql_show.cc~ 2011-02-24 15:55:10.000000000 +0200
3458 +++ mysql-5.0.92/sql/sql_show.cc 2011-02-24 15:56:28.993570019 +0200
3460 sctx->master_access);
3461 if (!(db_access & DB_ACLS) && (!grant_option || check_grant_db(thd,dbname)))
3463 + thd->diff_access_denied_errors++;
3464 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
3465 sctx->priv_user, sctx->host_or_ip, dbname);
3466 mysql_log.write(thd,COM_INIT_DB,ER(ER_DBACCESS_DENIED_ERROR),
3467 @@ -1888,6 +1889,300 @@
3472 + Aggregate values for mapped_user entries by their role.
3475 + aggregate_user_stats
3476 + all_user_stats - input to aggregate
3477 + agg_user_stats - returns aggregated values
3484 +aggregate_user_stats(HASH *all_user_stats, HASH *agg_user_stats)
3486 + DBUG_ENTER("aggregate_user_stats");
3487 + if (hash_init(agg_user_stats, system_charset_info,
3488 + max(all_user_stats->records, 1),
3489 + 0, 0, (hash_get_key)get_key_user_stats,
3490 + (hash_free_key)free_user_stats, 0))
3492 + sql_print_error("Malloc in aggregate_user_stats failed");
3496 + for (int i = 0; i < all_user_stats->records; ++i) {
3497 + USER_STATS *user = (USER_STATS*)hash_element(all_user_stats, i);
3498 + USER_STATS *agg_user;
3499 + if (!(agg_user = (USER_STATS*)hash_search(agg_user_stats,
3500 + (byte*)user->priv_user,
3501 + strlen(user->priv_user))))
3503 + // First entry for this role.
3505 + (USER_STATS*) my_malloc(sizeof(USER_STATS), MYF(MY_WME | MY_ZEROFILL))))
3507 + sql_print_error("Malloc in aggregate_user_stats failed");
3511 + init_user_stats(agg_user, user->priv_user, user->priv_user,
3512 + user->total_connections, user->concurrent_connections,
3513 + user->connected_time, user->busy_time, user->cpu_time,
3514 + user->bytes_received, user->bytes_sent,
3515 + user->binlog_bytes_written,
3516 + user->rows_fetched, user->rows_updated, user->rows_read,
3517 + user->select_commands, user->update_commands,
3518 + user->other_commands,
3519 + user->commit_trans, user->rollback_trans,
3520 + user->denied_connections, user->lost_connections,
3521 + user->access_denied_errors, user->empty_queries);
3523 + if (my_hash_insert(agg_user_stats, (byte*)agg_user))
3526 + my_free((char*)agg_user, 0);
3527 + sql_print_error("Malloc in aggregate_user_stats failed");
3533 + // Aggregate with existing values for this role.
3534 + add_user_stats(agg_user,
3535 + user->total_connections, user->concurrent_connections,
3536 + user->connected_time, user->busy_time, user->cpu_time,
3537 + user->bytes_received, user->bytes_sent,
3538 + user->binlog_bytes_written,
3539 + user->rows_fetched, user->rows_updated, user->rows_read,
3540 + user->select_commands, user->update_commands,
3541 + user->other_commands,
3542 + user->commit_trans, user->rollback_trans,
3543 + user->denied_connections, user->lost_connections,
3544 + user->access_denied_errors, user->empty_queries);
3547 + DBUG_PRINT("exit", ("aggregated %d input into %d output entries",
3548 + all_user_stats->records, agg_user_stats->records));
3553 + Write result to network for SHOW USER_STATISTICS
3557 + all_user_stats - values to return
3564 +int send_user_stats(THD* thd, HASH *all_user_stats, TABLE *table)
3566 + DBUG_ENTER("send_user_stats");
3567 + for (int i = 0; i < all_user_stats->records; ++i) {
3568 + restore_record(table, s->default_values);
3569 + USER_STATS *user_stats = (USER_STATS*)hash_element(all_user_stats, i);
3570 + table->field[0]->store(user_stats->user, strlen(user_stats->user), system_charset_info);
3571 + table->field[1]->store((longlong)user_stats->total_connections);
3572 + table->field[2]->store((longlong)user_stats->concurrent_connections);
3573 + table->field[3]->store((longlong)user_stats->connected_time);
3574 + table->field[4]->store((longlong)user_stats->busy_time);
3575 + table->field[5]->store((longlong)user_stats->cpu_time);
3576 + table->field[6]->store((longlong)user_stats->bytes_received);
3577 + table->field[7]->store((longlong)user_stats->bytes_sent);
3578 + table->field[8]->store((longlong)user_stats->binlog_bytes_written);
3579 + table->field[9]->store((longlong)user_stats->rows_fetched);
3580 + table->field[10]->store((longlong)user_stats->rows_updated);
3581 + table->field[11]->store((longlong)user_stats->rows_read);
3582 + table->field[12]->store((longlong)user_stats->select_commands);
3583 + table->field[13]->store((longlong)user_stats->update_commands);
3584 + table->field[14]->store((longlong)user_stats->other_commands);
3585 + table->field[15]->store((longlong)user_stats->commit_trans);
3586 + table->field[16]->store((longlong)user_stats->rollback_trans);
3587 + table->field[17]->store((longlong)user_stats->denied_connections);
3588 + table->field[18]->store((longlong)user_stats->lost_connections);
3589 + table->field[19]->store((longlong)user_stats->access_denied_errors);
3590 + table->field[20]->store((longlong)user_stats->empty_queries);
3591 + if (schema_table_store_record(thd, table))
3593 + DBUG_PRINT("error", ("store record error"));
3601 + Process SHOW USER_STATISTICS
3604 + mysqld_show_user_stats
3605 + thd - current thread
3606 + wild - limit results to the entry for this user
3607 + with_roles - when true, display role for mapped users
3615 +int fill_schema_user_stats(THD* thd, TABLE_LIST* tables, COND* cond)
3617 + TABLE *table= tables->table;
3618 + DBUG_ENTER("fill_schema_user_stats");
3620 + if (check_global_access(thd, SUPER_ACL | PROCESS_ACL))
3623 + // Iterates through all the global stats and sends them to the client.
3624 + // Pattern matching on the client IP is supported.
3626 + pthread_mutex_lock(&LOCK_global_user_client_stats);
3627 + int result= send_user_stats(thd, &global_user_stats, table);
3628 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
3632 + DBUG_PRINT("exit", ("fill_schema_user_stats result is 0"));
3636 + DBUG_PRINT("exit", ("fill_schema_user_stats result is 1"));
3641 + Process SHOW CLIENT_STATISTICS
3644 + mysqld_show_client_stats
3645 + thd - current thread
3646 + wild - limit results to the entry for this client
3654 +int fill_schema_client_stats(THD* thd, TABLE_LIST* tables, COND* cond)
3656 + TABLE *table= tables->table;
3657 + DBUG_ENTER("fill_schema_client_stats");
3659 + if (check_global_access(thd, SUPER_ACL | PROCESS_ACL))
3662 + // Iterates through all the global stats and sends them to the client.
3663 + // Pattern matching on the client IP is supported.
3665 + pthread_mutex_lock(&LOCK_global_user_client_stats);
3666 + int result= send_user_stats(thd, &global_client_stats, table);
3667 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
3671 + DBUG_PRINT("exit", ("mysqld_show_client_stats result is 0"));
3675 + DBUG_PRINT("exit", ("mysqld_show_client_stats result is 1"));
3680 +// Sends the global table stats back to the client.
3681 +int fill_schema_table_stats(THD* thd, TABLE_LIST* tables, COND* cond)
3683 + TABLE *table= tables->table;
3684 + DBUG_ENTER("fill_schema_table_stats");
3685 + char *table_full_name, *table_schema;
3687 + pthread_mutex_lock(&LOCK_global_table_stats);
3688 + for (int i = 0; i < global_table_stats.records; ++i) {
3689 + restore_record(table, s->default_values);
3690 + TABLE_STATS *table_stats =
3691 + (TABLE_STATS*)hash_element(&global_table_stats, i);
3693 + table_full_name= thd->strdup(table_stats->table);
3694 + table_schema= strsep(&table_full_name, ".");
3696 + TABLE_LIST tmp_table;
3697 + bzero((char*) &tmp_table,sizeof(tmp_table));
3698 + tmp_table.table_name= table_full_name;
3699 + tmp_table.db= table_schema;
3700 + tmp_table.grant.privilege= 0;
3701 + if (check_access(thd, SELECT_ACL | EXTRA_ACL, tmp_table.db,
3702 + &tmp_table.grant.privilege, 0, 0,
3703 + is_schema_db(table_schema)) ||
3704 + grant_option && check_grant(thd, SELECT_ACL, &tmp_table, 1, UINT_MAX, 1))
3707 + table->field[0]->store(table_schema, strlen(table_schema), system_charset_info);
3708 + table->field[1]->store(table_full_name, strlen(table_full_name), system_charset_info);
3709 + table->field[2]->store((longlong)table_stats->rows_read, TRUE);
3710 + table->field[3]->store((longlong)table_stats->rows_changed, TRUE);
3711 + table->field[4]->store((longlong)table_stats->rows_changed_x_indexes, TRUE);
3713 + if (schema_table_store_record(thd, table))
3715 + VOID(pthread_mutex_unlock(&LOCK_global_table_stats));
3719 + pthread_mutex_unlock(&LOCK_global_table_stats);
3723 +// Sends the global index stats back to the client.
3724 +int fill_schema_index_stats(THD* thd, TABLE_LIST* tables, COND* cond)
3726 + TABLE *table= tables->table;
3727 + DBUG_ENTER("fill_schema_index_stats");
3728 + char *index_full_name, *table_schema, *table_name;
3730 + pthread_mutex_lock(&LOCK_global_index_stats);
3731 + for (int i = 0; i < global_index_stats.records; ++i) {
3732 + restore_record(table, s->default_values);
3733 + INDEX_STATS *index_stats =
3734 + (INDEX_STATS*)hash_element(&global_index_stats, i);
3736 + index_full_name= thd->strdup(index_stats->index);
3737 + table_schema= strsep(&index_full_name, ".");
3738 + table_name= strsep(&index_full_name, ".");
3740 + TABLE_LIST tmp_table;
3741 + bzero((char*) &tmp_table,sizeof(tmp_table));
3742 + tmp_table.table_name= table_name;
3743 + tmp_table.db= table_schema;
3744 + tmp_table.grant.privilege= 0;
3745 + if (check_access(thd, SELECT_ACL | EXTRA_ACL, tmp_table.db,
3746 + &tmp_table.grant.privilege, 0, 0,
3747 + is_schema_db(table_schema)) ||
3748 + grant_option && check_grant(thd, SELECT_ACL, &tmp_table, 1, UINT_MAX, 1))
3751 + table->field[0]->store(table_schema, strlen(table_schema), system_charset_info);
3752 + table->field[1]->store(table_name, strlen(table_name), system_charset_info);
3753 + table->field[2]->store(index_full_name, strlen(index_full_name), system_charset_info);
3754 + table->field[3]->store((longlong)index_stats->rows_read, TRUE);
3756 + if (schema_table_store_record(thd, table))
3758 + VOID(pthread_mutex_unlock(&LOCK_global_index_stats));
3762 + pthread_mutex_unlock(&LOCK_global_index_stats);
3766 /* collect status for all running threads */
3768 @@ -4495,6 +4790,77 @@
3769 {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3772 +ST_FIELD_INFO user_stats_fields_info[]=
3774 + {"USER", USERNAME_LENGTH, MYSQL_TYPE_STRING, 0, 0, "User"},
3775 + {"TOTAL_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Total_connections"},
3776 + {"CONCURRENT_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Concurrent_connections"},
3777 + {"CONNECTED_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Connected_time"},
3778 + {"BUSY_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Busy_time"},
3779 + {"CPU_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Cpu_time"},
3780 + {"BYTES_RECEIVED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_received"},
3781 + {"BYTES_SENT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_sent"},
3782 + {"BINLOG_BYTES_WRITTEN", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Binlog_bytes_written"},
3783 + {"ROWS_FETCHED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_fetched"},
3784 + {"ROWS_UPDATED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_updated"},
3785 + {"TABLE_ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Table_rows_read"},
3786 + {"SELECT_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Select_commands"},
3787 + {"UPDATE_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Update_commands"},
3788 + {"OTHER_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Other_commands"},
3789 + {"COMMIT_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Commit_transactions"},
3790 + {"ROLLBACK_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rollback_transactions"},
3791 + {"DENIED_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Denied_connections"},
3792 + {"LOST_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Lost_connections"},
3793 + {"ACCESS_DENIED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Access_denied"},
3794 + {"EMPTY_QUERIES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Empty_queries"},
3795 + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3798 +ST_FIELD_INFO client_stats_fields_info[]=
3800 + {"CLIENT", LIST_PROCESS_HOST_LEN, MYSQL_TYPE_STRING, 0, 0, "Client"},
3801 + {"TOTAL_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Total_connections"},
3802 + {"CONCURRENT_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Concurrent_connections"},
3803 + {"CONNECTED_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Connected_time"},
3804 + {"BUSY_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Busy_time"},
3805 + {"CPU_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Cpu_time"},
3806 + {"BYTES_RECEIVED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_received"},
3807 + {"BYTES_SENT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_sent"},
3808 + {"BINLOG_BYTES_WRITTEN", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Binlog_bytes_written"},
3809 + {"ROWS_FETCHED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_fetched"},
3810 + {"ROWS_UPDATED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_updated"},
3811 + {"TABLE_ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Table_rows_read"},
3812 + {"SELECT_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Select_commands"},
3813 + {"UPDATE_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Update_commands"},
3814 + {"OTHER_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Other_commands"},
3815 + {"COMMIT_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Commit_transactions"},
3816 + {"ROLLBACK_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rollback_transactions"},
3817 + {"DENIED_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Denied_connections"},
3818 + {"LOST_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Lost_connections"},
3819 + {"ACCESS_DENIED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Access_denied"},
3820 + {"EMPTY_QUERIES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Empty_queries"},
3821 + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3825 +ST_FIELD_INFO table_stats_fields_info[]=
3827 + {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_schema"},
3828 + {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_name"},
3829 + {"ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_read"},
3830 + {"ROWS_CHANGED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_changed"},
3831 + {"ROWS_CHANGED_X_INDEXES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_changed_x_#indexes"},
3832 + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3835 +ST_FIELD_INFO index_stats_fields_info[]=
3837 + {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_schema"},
3838 + {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_name"},
3839 + {"INDEX_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Index_name"},
3840 + {"ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_read"},
3841 + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3845 Description of ST_FIELD_INFO in table.h
3846 @@ -4906,6 +4906,8 @@
3848 {"CHARACTER_SETS", charsets_fields_info, create_schema_table,
3849 fill_schema_charsets, make_character_sets_old_format, 0, -1, -1, 0},
3850 + {"CLIENT_STATISTICS", client_stats_fields_info, create_schema_table,
3851 + fill_schema_client_stats, make_old_format, 0, -1, -1, 0},
3852 {"COLLATIONS", collation_fields_info, create_schema_table,
3853 fill_schema_collation, make_old_format, 0, -1, -1, 0},
3854 {"COLLATION_CHARACTER_SET_APPLICABILITY", coll_charset_app_fields_info,
3855 @@ -4512,6 +4880,8 @@
3856 get_all_tables, make_columns_old_format, get_schema_column_record, 1, 2, 0},
3857 {"COLUMN_PRIVILEGES", column_privileges_fields_info, create_schema_table,
3858 fill_schema_column_privileges, 0, 0, -1, -1, 0},
3859 + {"INDEX_STATISTICS", index_stats_fields_info, create_schema_table,
3860 + fill_schema_index_stats, make_old_format, 0, -1, -1, 0},
3861 {"KEY_COLUMN_USAGE", key_column_usage_fields_info, create_schema_table,
3862 get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0},
3863 {"OPEN_TABLES", open_tables_fields_info, create_schema_table,
3864 @@ -4941,10 +4943,14 @@
3865 get_all_tables, make_table_names_old_format, 0, 1, 2, 1},
3866 {"TABLE_PRIVILEGES", table_privileges_fields_info, create_schema_table,
3867 fill_schema_table_privileges, 0, 0, -1, -1, 0},
3868 + {"TABLE_STATISTICS", table_stats_fields_info, create_schema_table,
3869 + fill_schema_table_stats, make_old_format, 0, -1, -1, 0},
3870 {"TRIGGERS", triggers_fields_info, create_schema_table,
3871 get_all_tables, make_old_format, get_schema_triggers_record, 5, 6, 0},
3872 {"USER_PRIVILEGES", user_privileges_fields_info, create_schema_table,
3873 fill_schema_user_privileges, 0, 0, -1, -1, 0},
3874 + {"USER_STATISTICS", user_stats_fields_info, create_schema_table,
3875 + fill_schema_user_stats, make_old_format, 0, -1, -1, 0},
3876 {"VARIABLES", variables_fields_info, create_schema_table, fill_variables,
3877 make_old_format, 0, -1, -1, 1},
3878 {"VIEWS", view_fields_info, create_schema_table,
3879 diff -ruN a/sql/sql_update.cc b/sql/sql_update.cc
3880 --- a/sql/sql_update.cc Wed Jul 29 13:33:34 2009 -0700
3881 +++ b/sql/sql_update.cc Wed Jul 29 13:34:11 2009 -0700
3883 (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
3884 send_ok(thd, (ulong) thd->row_count_func,
3885 thd->insert_id_used ? thd->last_insert_id : 0L,buff);
3886 - DBUG_PRINT("info",("%ld records updated", (long) updated));
3887 + thd->updated_row_count += thd->row_count_func;
3888 + DBUG_PRINT("info",("%d records updated",updated));
3890 thd->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */
3891 thd->abort_on_warning= 0;
3892 @@ -1838,5 +1839,6 @@
3893 (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
3894 ::send_ok(thd, (ulong) thd->row_count_func,
3895 thd->insert_id_used ? thd->last_insert_id : 0L,buff);
3896 + thd->updated_row_count += thd->row_count_func;
3899 diff -ruN a/sql/sql_yacc.yy b/sql/sql_yacc.yy
3900 --- a/sql/sql_yacc.yy Wed Jul 29 13:33:34 2009 -0700
3901 +++ b/sql/sql_yacc.yy Wed Jul 29 13:34:11 2009 -0700
3906 +%token CLIENT_STATS_SYM
3914 +%token INDEX_STATS_SYM
3930 +%token TABLE_STATS_SYM
3932 %token TEMPTABLE_SYM
3934 @@ -1025,6 +1029,7 @@
3938 +%token USER_STATS_SYM
3942 @@ -8285,6 +8290,38 @@
3944 Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
3946 + | CLIENT_STATS_SYM wild_and_where
3949 + Lex->sql_command = SQLCOM_SELECT;
3950 + lex->orig_sql_command= SQLCOM_SHOW_CLIENT_STATS;
3951 + if (prepare_schema_table(YYTHD, lex, 0, SCH_CLIENT_STATS))
3954 + | USER_STATS_SYM wild_and_where
3957 + lex->sql_command = SQLCOM_SELECT;
3958 + lex->orig_sql_command= SQLCOM_SHOW_USER_STATS;
3959 + if (prepare_schema_table(YYTHD, lex, 0, SCH_USER_STATS))
3962 + | TABLE_STATS_SYM wild_and_where
3965 + lex->sql_command= SQLCOM_SELECT;
3966 + lex->orig_sql_command= SQLCOM_SHOW_TABLE_STATS;
3967 + if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_STATS))
3970 + | INDEX_STATS_SYM wild_and_where
3973 + lex->sql_command= SQLCOM_SELECT;
3974 + lex->orig_sql_command= SQLCOM_SHOW_INDEX_STATS;
3975 + if (prepare_schema_table(YYTHD, lex, 0, SCH_INDEX_STATS))
3978 | CREATE PROCEDURE sp_name
3981 @@ -8485,9 +8522,14 @@
3982 | LOGS_SYM { Lex->type|= REFRESH_LOG; }
3983 | STATUS_SYM { Lex->type|= REFRESH_STATUS; }
3984 | SLAVE { Lex->type|= REFRESH_SLAVE; }
3985 + | SLOW_SYM QUERY_SYM LOGS_SYM { Lex->type |= REFRESH_SLOW_QUERY_LOG; }
3986 | MASTER_SYM { Lex->type|= REFRESH_MASTER; }
3987 | DES_KEY_FILE { Lex->type|= REFRESH_DES_KEY_FILE; }
3988 - | RESOURCES { Lex->type|= REFRESH_USER_RESOURCES; };
3989 + | RESOURCES { Lex->type|= REFRESH_USER_RESOURCES; }
3990 + | CLIENT_STATS_SYM { Lex->type|= REFRESH_CLIENT_STATS; }
3991 + | USER_STATS_SYM { Lex->type|= REFRESH_USER_STATS; }
3992 + | TABLE_STATS_SYM { Lex->type|= REFRESH_TABLE_STATS; }
3993 + | INDEX_STATS_SYM { Lex->type|= REFRESH_INDEX_STATS; };
3997 @@ -9477,6 +9519,7 @@
4001 + | CLIENT_STATS_SYM {}
4005 @@ -9529,6 +9572,7 @@
4009 + | INDEX_STATS_SYM {}
4013 @@ -9638,6 +9682,7 @@
4021 @@ -9654,6 +9699,7 @@
4025 + | TABLE_STATS_SYM {}
4029 @@ -9674,6 +9720,7 @@
4033 + | USER_STATS_SYM {}
4037 diff -ruN a/sql/structs.h b/sql/structs.h
4038 --- a/sql/structs.h Wed Jul 29 13:33:34 2009 -0700
4039 +++ b/sql/structs.h Wed Jul 29 13:34:11 2009 -0700
4040 @@ -279,6 +279,98 @@
4044 +typedef struct st_user_stats {
4045 + char user[max(USERNAME_LENGTH, LIST_PROCESS_HOST_LEN) + 1];
4046 + // Account name the user is mapped to when this is a user from mapped_user.
4047 + // Otherwise, the same value as user.
4048 + char priv_user[max(USERNAME_LENGTH, LIST_PROCESS_HOST_LEN) + 1];
4049 + uint total_connections;
4050 + uint concurrent_connections;
4051 + time_t connected_time; // in seconds
4052 + double busy_time; // in seconds
4053 + double cpu_time; // in seconds
4054 + ulonglong bytes_received;
4055 + ulonglong bytes_sent;
4056 + ulonglong binlog_bytes_written;
4057 + ha_rows rows_fetched, rows_updated, rows_read;
4058 + ulonglong select_commands, update_commands, other_commands;
4059 + ulonglong commit_trans, rollback_trans;
4060 + ulonglong denied_connections, lost_connections;
4061 + ulonglong access_denied_errors;
4062 + ulonglong empty_queries;
4065 +/* Lookup function for hash tables with USER_STATS entries */
4066 +extern byte *get_key_user_stats(USER_STATS *user_stats, uint *length,
4067 + my_bool not_used __attribute__((unused)));
4069 +/* Free all memory for a hash table with USER_STATS entries */
4070 +extern void free_user_stats(USER_STATS* user_stats);
4072 +/* Intialize an instance of USER_STATS */
4074 +init_user_stats(USER_STATS *user_stats,
4076 + const char *priv_user,
4077 + uint total_connections,
4078 + uint concurrent_connections,
4079 + time_t connected_time,
4082 + ulonglong bytes_received,
4083 + ulonglong bytes_sent,
4084 + ulonglong binlog_bytes_written,
4085 + ha_rows rows_fetched,
4086 + ha_rows rows_updated,
4087 + ha_rows rows_read,
4088 + ulonglong select_commands,
4089 + ulonglong update_commands,
4090 + ulonglong other_commands,
4091 + ulonglong commit_trans,
4092 + ulonglong rollback_trans,
4093 + ulonglong denied_connections,
4094 + ulonglong lost_connections,
4095 + ulonglong access_denied_errors,
4096 + ulonglong empty_queries);
4098 +/* Increment values of an instance of USER_STATS */
4100 +add_user_stats(USER_STATS *user_stats,
4101 + uint total_connections,
4102 + uint concurrent_connections,
4103 + time_t connected_time,
4106 + ulonglong bytes_received,
4107 + ulonglong bytes_sent,
4108 + ulonglong binlog_bytes_written,
4109 + ha_rows rows_fetched,
4110 + ha_rows rows_updated,
4111 + ha_rows rows_read,
4112 + ulonglong select_commands,
4113 + ulonglong update_commands,
4114 + ulonglong other_commands,
4115 + ulonglong commit_trans,
4116 + ulonglong rollback_trans,
4117 + ulonglong denied_connections,
4118 + ulonglong lost_connections,
4119 + ulonglong access_denied_errors,
4120 + ulonglong empty_queries);
4122 +typedef struct st_table_stats {
4123 + char table[NAME_LEN * 2 + 2]; // [db] + '.' + [table] + '\0'
4124 + ulonglong rows_read, rows_changed;
4125 + ulonglong rows_changed_x_indexes;
4126 + /* Stores enum db_type, but forward declarations cannot be done */
4130 +typedef struct st_index_stats {
4131 + char index[NAME_LEN * 3 + 3]; // [db] + '.' + [table] + '.' + [index] + '\0'
4132 + ulonglong rows_read;
4136 /* Bits in form->update */
4137 #define REG_MAKE_DUPP 1 /* Make a copy of record when read */
4138 #define REG_NEW_RECORD 2 /* Write a new record if not found */
4139 diff -ruN a/sql/table.h b/sql/table.h
4140 --- a/sql/table.h Wed Jul 29 13:33:34 2009 -0700
4141 +++ b/sql/table.h Wed Jul 29 13:34:11 2009 -0700
4142 @@ -371,10 +371,12 @@
4143 enum enum_schema_tables
4148 SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
4150 SCH_COLUMN_PRIVILEGES,
4152 SCH_KEY_COLUMN_USAGE,
4155 @@ -387,8 +389,10 @@
4156 SCH_TABLE_CONSTRAINTS,
4158 SCH_TABLE_PRIVILEGES,
4161 SCH_USER_PRIVILEGES,
4166 diff -ruN a/strings/Makefile.in b/strings/Makefile.in
4167 --- a/strings/Makefile.in Wed Jul 29 13:33:34 2009 -0700
4168 +++ b/strings/Makefile.in Wed Jul 29 13:34:11 2009 -0700
4171 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4176 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4177 diff -ruN a/support-files/MacOSX/Makefile.in b/support-files/MacOSX/Makefile.in
4178 --- a/support-files/MacOSX/Makefile.in Wed Jul 29 13:33:34 2009 -0700
4179 +++ b/support-files/MacOSX/Makefile.in Wed Jul 29 13:34:11 2009 -0700
4182 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4187 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4188 diff -ruN a/support-files/Makefile.in b/support-files/Makefile.in
4189 --- a/support-files/Makefile.in Wed Jul 29 13:33:34 2009 -0700
4190 +++ b/support-files/Makefile.in Wed Jul 29 13:34:11 2009 -0700
4193 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4198 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4199 diff -ruN a/support-files/RHEL4-SElinux/Makefile.in b/support-files/RHEL4-SElinux/Makefile.in
4200 --- a/support-files/RHEL4-SElinux/Makefile.in Wed Jul 29 13:33:34 2009 -0700
4201 +++ b/support-files/RHEL4-SElinux/Makefile.in Wed Jul 29 13:34:11 2009 -0700
4204 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4209 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4210 diff -ruN a/tests/Makefile.in b/tests/Makefile.in
4211 --- a/tests/Makefile.in Wed Jul 29 13:33:34 2009 -0700
4212 +++ b/tests/Makefile.in Wed Jul 29 13:34:11 2009 -0700
4215 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4218 LIBS = @CLIENT_LIBS@
4220 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4221 diff -ruN a/tools/Makefile.in b/tools/Makefile.in
4222 --- a/tools/Makefile.in Wed Jul 29 13:33:34 2009 -0700
4223 +++ b/tools/Makefile.in Wed Jul 29 13:34:11 2009 -0700
4226 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4231 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4232 diff -ruN a/vio/Makefile.in b/vio/Makefile.in
4233 --- a/vio/Makefile.in Wed Jul 29 13:33:34 2009 -0700
4234 +++ b/vio/Makefile.in Wed Jul 29 13:34:11 2009 -0700
4237 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4242 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4243 diff -ruN a/win/Makefile.in b/win/Makefile.in
4244 --- a/win/Makefile.in Wed Jul 29 13:33:34 2009 -0700
4245 +++ b/win/Makefile.in Wed Jul 29 13:34:11 2009 -0700
4248 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4253 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4254 diff -ruN a/zlib/Makefile.in b/zlib/Makefile.in
4255 --- a/zlib/Makefile.in Wed Jul 29 13:33:34 2009 -0700
4256 +++ b/zlib/Makefile.in Wed Jul 29 13:34:11 2009 -0700
4259 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4262 LIBS = $(NON_THREADED_LIBS)
4264 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@