1 diff -r 1ac0113deff5 BUILD/Makefile.in
2 --- a/BUILD/Makefile.in Mon Jun 01 00:35:44 2009 -0700
3 +++ b/BUILD/Makefile.in Mon Jun 01 00:36:01 2009 -0700
6 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
11 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
12 diff -r 1ac0113deff5 Docs/Makefile.in
13 --- a/Docs/Makefile.in Mon Jun 01 00:35:44 2009 -0700
14 +++ b/Docs/Makefile.in Mon Jun 01 00:36:01 2009 -0700
17 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
22 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
23 diff -r 1ac0113deff5 Makefile.in
24 --- a/Makefile.in Mon Jun 01 00:35:44 2009 -0700
25 +++ b/Makefile.in Mon Jun 01 00:36:01 2009 -0700
28 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
33 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
34 diff -r 1ac0113deff5 SSL/Makefile.in
35 --- a/SSL/Makefile.in Mon Jun 01 00:35:44 2009 -0700
36 +++ b/SSL/Makefile.in Mon Jun 01 00:36:01 2009 -0700
39 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
44 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
45 diff -r 1ac0113deff5 client/Makefile.in
46 --- a/client/Makefile.in Mon Jun 01 00:35:44 2009 -0700
47 +++ b/client/Makefile.in Mon Jun 01 00:36:01 2009 -0700
50 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
55 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
56 diff -r 1ac0113deff5 cmd-line-utils/Makefile.in
57 --- a/cmd-line-utils/Makefile.in Mon Jun 01 00:35:44 2009 -0700
58 +++ b/cmd-line-utils/Makefile.in Mon Jun 01 00:36:01 2009 -0700
61 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
66 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
67 diff -r 1ac0113deff5 cmd-line-utils/libedit/Makefile.in
68 --- a/cmd-line-utils/libedit/Makefile.in Mon Jun 01 00:35:44 2009 -0700
69 +++ b/cmd-line-utils/libedit/Makefile.in Mon Jun 01 00:36:01 2009 -0700
72 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
77 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
78 diff -r 1ac0113deff5 cmd-line-utils/readline/Makefile.in
79 --- a/cmd-line-utils/readline/Makefile.in Mon Jun 01 00:35:44 2009 -0700
80 +++ b/cmd-line-utils/readline/Makefile.in Mon Jun 01 00:36:01 2009 -0700
83 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
88 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
89 diff -r 1ac0113deff5 configure
90 --- a/configure Mon Jun 01 00:35:44 2009 -0700
91 +++ b/configure Mon Jun 01 00:36:01 2009 -0700
92 @@ -35333,7 +35333,91 @@
93 # We also disable for SCO for the time being, the headers for the
94 # thread library we use conflicts with other headers.
98 + # most systems require the program be linked with librt library to use
99 + # the function clock_gettime
100 + my_save_LIBS="$LIBS"
103 +echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5
104 +echo $ECHO_N "checking for clock_gettime in -lrt... $ECHO_C" >&6
105 +if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then
106 + echo $ECHO_N "(cached) $ECHO_C" >&6
108 + ac_check_lib_save_LIBS=$LIBS
110 +cat >conftest.$ac_ext <<_ACEOF
113 +cat confdefs.h >>conftest.$ac_ext
114 +cat >>conftest.$ac_ext <<_ACEOF
115 +/* end confdefs.h. */
117 +/* Override any gcc2 internal prototype to avoid an error. */
121 +/* We use char because int might match the return type of a gcc2
122 + builtin and then its argument prototype would still apply. */
123 +char clock_gettime ();
132 +rm -f conftest.$ac_objext conftest$ac_exeext
133 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
134 + (eval $ac_link) 2>conftest.er1
136 + grep -v '^ *+' conftest.er1 >conftest.err
138 + cat conftest.err >&5
139 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
140 + (exit $ac_status); } &&
141 + { ac_try='test -z "$ac_c_werror_flag"
142 + || test ! -s conftest.err'
143 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
144 + (eval $ac_try) 2>&5
146 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
147 + (exit $ac_status); }; } &&
148 + { ac_try='test -s conftest$ac_exeext'
149 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
150 + (eval $ac_try) 2>&5
152 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
153 + (exit $ac_status); }; }; then
154 + ac_cv_lib_rt_clock_gettime=yes
156 + echo "$as_me: failed program was:" >&5
157 +sed 's/^/| /' conftest.$ac_ext >&5
159 +ac_cv_lib_rt_clock_gettime=no
161 +rm -f conftest.err conftest.$ac_objext \
162 + conftest$ac_exeext conftest.$ac_ext
163 +LIBS=$ac_check_lib_save_LIBS
165 +echo "$as_me:$LINENO: result: $ac_cv_lib_rt_clock_gettime" >&5
166 +echo "${ECHO_T}$ac_cv_lib_rt_clock_gettime" >&6
167 +if test $ac_cv_lib_rt_clock_gettime = yes; then
168 + cat >>confdefs.h <<_ACEOF
169 +#define HAVE_LIBRT 1
177 + LIBS="$my_save_LIBS"
180 + LIBS="$LIBS $LIBRT"
182 for ac_func in clock_gettime
184 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
185 @@ -38777,7 +38861,7 @@
189 -CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS"
190 +CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS $LIBRT"
194 diff -r 1ac0113deff5 configure.in
195 --- a/configure.in Mon Jun 01 00:35:44 2009 -0700
196 +++ b/configure.in Mon Jun 01 00:36:01 2009 -0700
197 @@ -2122,7 +2122,18 @@
198 # We also disable for SCO for the time being, the headers for the
199 # thread library we use conflicts with other headers.
201 - *) AC_CHECK_FUNCS(clock_gettime)
203 + # most systems require the program be linked with librt library to use
204 + # the function clock_gettime
205 + my_save_LIBS="$LIBS"
207 + AC_CHECK_LIB(rt,clock_gettime)
209 + LIBS="$my_save_LIBS"
212 + LIBS="$LIBS $LIBRT"
213 + AC_CHECK_FUNCS(clock_gettime)
217 @@ -2758,7 +2769,7 @@
218 AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe])
221 -CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS"
222 +CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS $LIBRT"
224 AC_SUBST(CLIENT_LIBS)
225 AC_SUBST(NON_THREADED_LIBS)
226 diff -r 1ac0113deff5 dbug/Makefile.in
227 --- a/dbug/Makefile.in Mon Jun 01 00:35:44 2009 -0700
228 +++ b/dbug/Makefile.in Mon Jun 01 00:36:01 2009 -0700
231 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
236 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
237 diff -r 1ac0113deff5 extra/Makefile.in
238 --- a/extra/Makefile.in Mon Jun 01 00:35:44 2009 -0700
239 +++ b/extra/Makefile.in Mon Jun 01 00:36:01 2009 -0700
242 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
247 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
248 diff -r 1ac0113deff5 extra/yassl/Makefile.in
249 --- a/extra/yassl/Makefile.in Mon Jun 01 00:35:44 2009 -0700
250 +++ b/extra/yassl/Makefile.in Mon Jun 01 00:36:01 2009 -0700
253 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
258 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
259 diff -r 1ac0113deff5 extra/yassl/src/Makefile.in
260 --- a/extra/yassl/src/Makefile.in Mon Jun 01 00:35:44 2009 -0700
261 +++ b/extra/yassl/src/Makefile.in Mon Jun 01 00:36:01 2009 -0700
264 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
269 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
270 diff -r 1ac0113deff5 extra/yassl/taocrypt/Makefile.in
271 --- a/extra/yassl/taocrypt/Makefile.in Mon Jun 01 00:35:44 2009 -0700
272 +++ b/extra/yassl/taocrypt/Makefile.in Mon Jun 01 00:36:01 2009 -0700
275 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
280 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
281 diff -r 1ac0113deff5 extra/yassl/taocrypt/benchmark/Makefile.in
282 --- a/extra/yassl/taocrypt/benchmark/Makefile.in Mon Jun 01 00:35:44 2009 -0700
283 +++ b/extra/yassl/taocrypt/benchmark/Makefile.in Mon Jun 01 00:36:01 2009 -0700
286 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
291 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
292 diff -r 1ac0113deff5 extra/yassl/taocrypt/src/Makefile.in
293 --- a/extra/yassl/taocrypt/src/Makefile.in Mon Jun 01 00:35:44 2009 -0700
294 +++ b/extra/yassl/taocrypt/src/Makefile.in Mon Jun 01 00:36:01 2009 -0700
297 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
302 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
303 diff -r 1ac0113deff5 extra/yassl/taocrypt/test/Makefile.in
304 --- a/extra/yassl/taocrypt/test/Makefile.in Mon Jun 01 00:35:44 2009 -0700
305 +++ b/extra/yassl/taocrypt/test/Makefile.in Mon Jun 01 00:36:01 2009 -0700
308 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
313 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
314 diff -r 1ac0113deff5 extra/yassl/testsuite/Makefile.in
315 --- a/extra/yassl/testsuite/Makefile.in Mon Jun 01 00:35:44 2009 -0700
316 +++ b/extra/yassl/testsuite/Makefile.in Mon Jun 01 00:36:01 2009 -0700
319 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
324 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
325 diff -r 1ac0113deff5 heap/Makefile.in
326 --- a/heap/Makefile.in Mon Jun 01 00:35:44 2009 -0700
327 +++ b/heap/Makefile.in Mon Jun 01 00:36:01 2009 -0700
330 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
335 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
336 diff -r 1ac0113deff5 include/Makefile.in
337 --- a/include/Makefile.in Mon Jun 01 00:35:44 2009 -0700
338 +++ b/include/Makefile.in Mon Jun 01 00:36:01 2009 -0700
341 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
346 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
347 diff -r 1ac0113deff5 include/mysql_com.h
348 --- a/include/mysql_com.h Mon Jun 01 00:35:44 2009 -0700
349 +++ b/include/mysql_com.h Mon Jun 01 00:36:01 2009 -0700
352 #define REFRESH_MASTER 128 /* Remove all bin logs in the index
353 and truncate the index */
354 +#define REFRESH_TABLE_STATS 256 /* Refresh table stats hash table */
355 +#define REFRESH_INDEX_STATS 512 /* Refresh index stats hash table */
356 +#define REFRESH_USER_STATS 1024 /* Refresh user stats hash table */
357 +#define REFRESH_SLOW_QUERY_LOG 4096 /* Flush slow query log and rotate*/
358 +#define REFRESH_CLIENT_STATS 8192 /* Refresh client stats hash table */
360 /* The following can't be set with mysql_refresh() */
361 #define REFRESH_READ_LOCK 16384 /* Lock tables for read */
362 diff -r 1ac0113deff5 libmysql/Makefile.in
363 --- a/libmysql/Makefile.in Mon Jun 01 00:35:44 2009 -0700
364 +++ b/libmysql/Makefile.in Mon Jun 01 00:36:01 2009 -0700
367 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
372 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
373 diff -r 1ac0113deff5 libmysql_r/Makefile.in
374 --- a/libmysql_r/Makefile.in Mon Jun 01 00:35:44 2009 -0700
375 +++ b/libmysql_r/Makefile.in Mon Jun 01 00:36:01 2009 -0700
378 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
381 LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
383 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
384 diff -r 1ac0113deff5 libmysqld/Makefile.in
385 --- a/libmysqld/Makefile.in Mon Jun 01 00:35:44 2009 -0700
386 +++ b/libmysqld/Makefile.in Mon Jun 01 00:36:01 2009 -0700
389 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
394 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
395 diff -r 1ac0113deff5 libmysqld/examples/Makefile.in
396 --- a/libmysqld/examples/Makefile.in Mon Jun 01 00:35:44 2009 -0700
397 +++ b/libmysqld/examples/Makefile.in Mon Jun 01 00:36:01 2009 -0700
400 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
403 LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs)
405 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
406 diff -r 1ac0113deff5 man/Makefile.in
407 --- a/man/Makefile.in Mon Jun 01 00:35:44 2009 -0700
408 +++ b/man/Makefile.in Mon Jun 01 00:36:01 2009 -0700
411 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
416 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
417 diff -r 1ac0113deff5 myisam/Makefile.in
418 --- a/myisam/Makefile.in Mon Jun 01 00:35:44 2009 -0700
419 +++ b/myisam/Makefile.in Mon Jun 01 00:36:01 2009 -0700
422 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
427 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
428 diff -r 1ac0113deff5 myisammrg/Makefile.in
429 --- a/myisammrg/Makefile.in Mon Jun 01 00:35:44 2009 -0700
430 +++ b/myisammrg/Makefile.in Mon Jun 01 00:36:01 2009 -0700
433 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
438 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
439 diff -r 1ac0113deff5 mysql-test/Makefile.in
440 --- a/mysql-test/Makefile.in Mon Jun 01 00:35:44 2009 -0700
441 +++ b/mysql-test/Makefile.in Mon Jun 01 00:36:01 2009 -0700
444 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
449 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
450 diff -r 1ac0113deff5 mysql-test/ndb/Makefile.in
451 --- a/mysql-test/ndb/Makefile.in Mon Jun 01 00:35:44 2009 -0700
452 +++ b/mysql-test/ndb/Makefile.in Mon Jun 01 00:36:01 2009 -0700
455 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
460 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
461 diff -r 1ac0113deff5 mysql-test/r/information_schema.result
462 --- a/mysql-test/r/information_schema.result Mon Jun 01 00:35:44 2009 -0700
463 +++ b/mysql-test/r/information_schema.result Mon Jun 01 00:36:01 2009 -0700
470 COLLATION_CHARACTER_SET_APPLICABILITY
490 TABLE_CONSTRAINTS TABLE_CONSTRAINTS
491 TABLE_PRIVILEGES TABLE_PRIVILEGES
492 +TABLE_STATISTICS TABLE_STATISTICS
494 tables_priv tables_priv
498 TABLE_CONSTRAINTS TABLE_CONSTRAINTS
499 TABLE_PRIVILEGES TABLE_PRIVILEGES
500 +TABLE_STATISTICS TABLE_STATISTICS
502 tables_priv tables_priv
506 TABLE_CONSTRAINTS TABLE_CONSTRAINTS
507 TABLE_PRIVILEGES TABLE_PRIVILEGES
508 +TABLE_STATISTICS TABLE_STATISTICS
510 tables_priv tables_priv
512 @@ -594,12 +601,13 @@
513 where table_schema='information_schema' limit 2;
514 TABLE_NAME TABLE_TYPE ENGINE
515 CHARACTER_SETS SYSTEM VIEW MEMORY
516 -COLLATIONS SYSTEM VIEW MEMORY
517 +CLIENT_STATISTICS SYSTEM VIEW MEMORY
518 show tables from information_schema like "T%";
519 Tables_in_information_schema (T%)
525 create database information_schema;
526 ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
529 TABLE_CONSTRAINTS SYSTEM VIEW
530 TABLE_PRIVILEGES SYSTEM VIEW
531 +TABLE_STATISTICS SYSTEM VIEW
533 create table t1(a int);
534 ERROR 42S02: Unknown table 't1' in information_schema
541 select table_name from tables where table_name='user';
544 CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1;
545 CREATE VIEW a2 AS SELECT t_CRASHME FROM a1;
550 drop table t_crashme;
551 select table_schema,table_name, column_name from
552 @@ -790,18 +800,20 @@
553 TABLE_NAME COLUMN_NAME PRIVILEGES
554 COLUMNS TABLE_NAME select
555 COLUMN_PRIVILEGES TABLE_NAME select
556 +INDEX_STATISTICS TABLE_NAME select
557 KEY_COLUMN_USAGE TABLE_NAME select
558 STATISTICS TABLE_NAME select
559 TABLES TABLE_NAME select
560 TABLE_CONSTRAINTS TABLE_NAME select
561 TABLE_PRIVILEGES TABLE_NAME select
562 +TABLE_STATISTICS TABLE_NAME select
563 VIEWS TABLE_NAME select
564 delete from mysql.user where user='mysqltest_4';
565 delete from mysql.db where user='mysqltest_4';
567 SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
568 table_schema count(*)
569 -information_schema 17
570 +information_schema 21
572 create table t1 (i int, j int);
573 create trigger trg1 before insert on t1 for each row
574 @@ -1187,10 +1199,12 @@
576 table_name column_name
577 CHARACTER_SETS CHARACTER_SET_NAME
578 +CLIENT_STATISTICS CLIENT
579 COLLATIONS COLLATION_NAME
580 COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
582 COLUMN_PRIVILEGES TABLE_SCHEMA
583 +INDEX_STATISTICS TABLE_SCHEMA
584 KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
586 ROUTINES ROUTINE_SCHEMA
587 @@ -1200,8 +1214,10 @@
589 TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
590 TABLE_PRIVILEGES TABLE_SCHEMA
591 +TABLE_STATISTICS TABLE_SCHEMA
592 TRIGGERS TRIGGER_SCHEMA
593 USER_PRIVILEGES GRANTEE
594 +USER_STATISTICS USER
596 SELECT t.table_name, c1.column_name
597 FROM information_schema.tables t
598 @@ -1219,10 +1235,12 @@
600 table_name column_name
601 CHARACTER_SETS CHARACTER_SET_NAME
602 +CLIENT_STATISTICS CLIENT
603 COLLATIONS COLLATION_NAME
604 COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
606 COLUMN_PRIVILEGES TABLE_SCHEMA
607 +INDEX_STATISTICS TABLE_SCHEMA
608 KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
610 ROUTINES ROUTINE_SCHEMA
611 @@ -1232,8 +1250,10 @@
613 TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
614 TABLE_PRIVILEGES TABLE_SCHEMA
615 +TABLE_STATISTICS TABLE_SCHEMA
616 TRIGGERS TRIGGER_SCHEMA
617 USER_PRIVILEGES GRANTEE
618 +USER_STATISTICS USER
620 SELECT MAX(table_name) FROM information_schema.tables;
622 @@ -1302,10 +1322,12 @@
623 group by t.table_name order by num1, t.table_name;
624 table_name group_concat(t.table_schema, '.', t.table_name) num1
625 CHARACTER_SETS information_schema.CHARACTER_SETS 1
626 +CLIENT_STATISTICS information_schema.CLIENT_STATISTICS 1
627 COLLATIONS information_schema.COLLATIONS 1
628 COLLATION_CHARACTER_SET_APPLICABILITY information_schema.COLLATION_CHARACTER_SET_APPLICABILITY 1
629 COLUMNS information_schema.COLUMNS 1
630 COLUMN_PRIVILEGES information_schema.COLUMN_PRIVILEGES 1
631 +INDEX_STATISTICS information_schema.INDEX_STATISTICS 1
632 KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
633 PROFILING information_schema.PROFILING 1
634 ROUTINES information_schema.ROUTINES 1
635 @@ -1315,8 +1337,10 @@
636 TABLES information_schema.TABLES 1
637 TABLE_CONSTRAINTS information_schema.TABLE_CONSTRAINTS 1
638 TABLE_PRIVILEGES information_schema.TABLE_PRIVILEGES 1
639 +TABLE_STATISTICS information_schema.TABLE_STATISTICS 1
640 TRIGGERS information_schema.TRIGGERS 1
641 USER_PRIVILEGES information_schema.USER_PRIVILEGES 1
642 +USER_STATISTICS information_schema.USER_STATISTICS 1
643 VIEWS information_schema.VIEWS 1
644 show global status like "Uptime_%";
646 diff -r 1ac0113deff5 mysql-test/r/information_schema_db.result
647 --- a/mysql-test/r/information_schema_db.result Mon Jun 01 00:35:44 2009 -0700
648 +++ b/mysql-test/r/information_schema_db.result Mon Jun 01 00:36:01 2009 -0700
651 Tables_in_information_schema
655 COLLATION_CHARACTER_SET_APPLICABILITY
671 show tables from INFORMATION_SCHEMA like 'T%';
672 Tables_in_information_schema (T%)
678 create database `inf%`;
679 create database mbase;
680 diff -r 1ac0113deff5 mysql-test/r/mysqlshow.result
681 --- a/mysql-test/r/mysqlshow.result Mon Jun 01 00:35:44 2009 -0700
682 +++ b/mysql-test/r/mysqlshow.result Mon Jun 01 00:36:01 2009 -0700
685 +---------------------------------------+
687 +| CLIENT_STATISTICS |
689 | COLLATION_CHARACTER_SET_APPLICABILITY |
691 | COLUMN_PRIVILEGES |
692 +| INDEX_STATISTICS |
698 | TABLE_CONSTRAINTS |
700 +| TABLE_STATISTICS |
705 +---------------------------------------+
706 Database: INFORMATION_SCHEMA
707 @@ -102,10 +106,12 @@
709 +---------------------------------------+
711 +| CLIENT_STATISTICS |
713 | COLLATION_CHARACTER_SET_APPLICABILITY |
715 | COLUMN_PRIVILEGES |
716 +| INDEX_STATISTICS |
722 | TABLE_CONSTRAINTS |
724 +| TABLE_STATISTICS |
729 +---------------------------------------+
730 Wildcard: inf_rmation_schema
731 diff -r 1ac0113deff5 mysys/Makefile.in
732 --- a/mysys/Makefile.in Mon Jun 01 00:35:44 2009 -0700
733 +++ b/mysys/Makefile.in Mon Jun 01 00:36:01 2009 -0700
736 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
741 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
742 diff -r 1ac0113deff5 ndb/Makefile.in
743 --- a/ndb/Makefile.in Mon Jun 01 00:35:44 2009 -0700
744 +++ b/ndb/Makefile.in Mon Jun 01 00:36:01 2009 -0700
747 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
752 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
753 diff -r 1ac0113deff5 ndb/docs/Makefile.in
754 --- a/ndb/docs/Makefile.in Mon Jun 01 00:35:44 2009 -0700
755 +++ b/ndb/docs/Makefile.in Mon Jun 01 00:36:01 2009 -0700
758 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
763 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
764 diff -r 1ac0113deff5 ndb/include/Makefile.in
765 --- a/ndb/include/Makefile.in Mon Jun 01 00:35:44 2009 -0700
766 +++ b/ndb/include/Makefile.in Mon Jun 01 00:36:01 2009 -0700
769 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
774 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
775 diff -r 1ac0113deff5 ndb/src/Makefile.in
776 --- a/ndb/src/Makefile.in Mon Jun 01 00:35:44 2009 -0700
777 +++ b/ndb/src/Makefile.in Mon Jun 01 00:36:01 2009 -0700
780 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
785 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
786 diff -r 1ac0113deff5 ndb/src/common/Makefile.in
787 --- a/ndb/src/common/Makefile.in Mon Jun 01 00:35:44 2009 -0700
788 +++ b/ndb/src/common/Makefile.in Mon Jun 01 00:36:01 2009 -0700
791 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
796 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
797 diff -r 1ac0113deff5 ndb/src/common/debugger/Makefile.in
798 --- a/ndb/src/common/debugger/Makefile.in Mon Jun 01 00:35:44 2009 -0700
799 +++ b/ndb/src/common/debugger/Makefile.in Mon Jun 01 00:36:01 2009 -0700
802 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
807 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
808 diff -r 1ac0113deff5 ndb/src/common/debugger/signaldata/Makefile.in
809 --- a/ndb/src/common/debugger/signaldata/Makefile.in Mon Jun 01 00:35:44 2009 -0700
810 +++ b/ndb/src/common/debugger/signaldata/Makefile.in Mon Jun 01 00:36:01 2009 -0700
813 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
818 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
819 diff -r 1ac0113deff5 ndb/src/common/logger/Makefile.in
820 --- a/ndb/src/common/logger/Makefile.in Mon Jun 01 00:35:44 2009 -0700
821 +++ b/ndb/src/common/logger/Makefile.in Mon Jun 01 00:36:01 2009 -0700
824 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
829 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
830 diff -r 1ac0113deff5 ndb/src/common/mgmcommon/Makefile.in
831 --- a/ndb/src/common/mgmcommon/Makefile.in Mon Jun 01 00:35:44 2009 -0700
832 +++ b/ndb/src/common/mgmcommon/Makefile.in Mon Jun 01 00:36:01 2009 -0700
835 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
840 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
841 diff -r 1ac0113deff5 ndb/src/common/portlib/Makefile.in
842 --- a/ndb/src/common/portlib/Makefile.in Mon Jun 01 00:35:44 2009 -0700
843 +++ b/ndb/src/common/portlib/Makefile.in Mon Jun 01 00:36:01 2009 -0700
846 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
851 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
852 diff -r 1ac0113deff5 ndb/src/common/transporter/Makefile.in
853 --- a/ndb/src/common/transporter/Makefile.in Mon Jun 01 00:35:44 2009 -0700
854 +++ b/ndb/src/common/transporter/Makefile.in Mon Jun 01 00:36:01 2009 -0700
857 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
862 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
863 diff -r 1ac0113deff5 ndb/src/common/util/Makefile.in
864 --- a/ndb/src/common/util/Makefile.in Mon Jun 01 00:35:44 2009 -0700
865 +++ b/ndb/src/common/util/Makefile.in Mon Jun 01 00:36:01 2009 -0700
868 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
873 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
874 diff -r 1ac0113deff5 ndb/src/cw/Makefile.in
875 --- a/ndb/src/cw/Makefile.in Mon Jun 01 00:35:44 2009 -0700
876 +++ b/ndb/src/cw/Makefile.in Mon Jun 01 00:36:01 2009 -0700
879 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
884 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
885 diff -r 1ac0113deff5 ndb/src/cw/cpcd/Makefile.in
886 --- a/ndb/src/cw/cpcd/Makefile.in Mon Jun 01 00:35:44 2009 -0700
887 +++ b/ndb/src/cw/cpcd/Makefile.in Mon Jun 01 00:36:01 2009 -0700
890 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
895 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
896 diff -r 1ac0113deff5 ndb/src/kernel/Makefile.in
897 --- a/ndb/src/kernel/Makefile.in Mon Jun 01 00:35:44 2009 -0700
898 +++ b/ndb/src/kernel/Makefile.in Mon Jun 01 00:36:01 2009 -0700
901 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
906 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
907 diff -r 1ac0113deff5 ndb/src/kernel/blocks/Makefile.in
908 --- a/ndb/src/kernel/blocks/Makefile.in Mon Jun 01 00:35:44 2009 -0700
909 +++ b/ndb/src/kernel/blocks/Makefile.in Mon Jun 01 00:36:01 2009 -0700
912 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
917 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
918 diff -r 1ac0113deff5 ndb/src/kernel/blocks/backup/Makefile.in
919 --- a/ndb/src/kernel/blocks/backup/Makefile.in Mon Jun 01 00:35:44 2009 -0700
920 +++ b/ndb/src/kernel/blocks/backup/Makefile.in Mon Jun 01 00:36:01 2009 -0700
923 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
928 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
929 diff -r 1ac0113deff5 ndb/src/kernel/blocks/cmvmi/Makefile.in
930 --- a/ndb/src/kernel/blocks/cmvmi/Makefile.in Mon Jun 01 00:35:44 2009 -0700
931 +++ b/ndb/src/kernel/blocks/cmvmi/Makefile.in Mon Jun 01 00:36:01 2009 -0700
934 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
939 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
940 diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbacc/Makefile.in
941 --- a/ndb/src/kernel/blocks/dbacc/Makefile.in Mon Jun 01 00:35:44 2009 -0700
942 +++ b/ndb/src/kernel/blocks/dbacc/Makefile.in Mon Jun 01 00:36:01 2009 -0700
945 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
950 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
951 diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbdict/Makefile.in
952 --- a/ndb/src/kernel/blocks/dbdict/Makefile.in Mon Jun 01 00:35:44 2009 -0700
953 +++ b/ndb/src/kernel/blocks/dbdict/Makefile.in Mon Jun 01 00:36:01 2009 -0700
956 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
961 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
962 diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbdih/Makefile.in
963 --- a/ndb/src/kernel/blocks/dbdih/Makefile.in Mon Jun 01 00:35:44 2009 -0700
964 +++ b/ndb/src/kernel/blocks/dbdih/Makefile.in Mon Jun 01 00:36:01 2009 -0700
967 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
972 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
973 diff -r 1ac0113deff5 ndb/src/kernel/blocks/dblqh/Makefile.in
974 --- a/ndb/src/kernel/blocks/dblqh/Makefile.in Mon Jun 01 00:35:44 2009 -0700
975 +++ b/ndb/src/kernel/blocks/dblqh/Makefile.in Mon Jun 01 00:36:01 2009 -0700
978 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
983 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
984 diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbtc/Makefile.in
985 --- a/ndb/src/kernel/blocks/dbtc/Makefile.in Mon Jun 01 00:35:44 2009 -0700
986 +++ b/ndb/src/kernel/blocks/dbtc/Makefile.in Mon Jun 01 00:36:01 2009 -0700
989 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
994 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
995 diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbtup/Makefile.in
996 --- a/ndb/src/kernel/blocks/dbtup/Makefile.in Mon Jun 01 00:35:44 2009 -0700
997 +++ b/ndb/src/kernel/blocks/dbtup/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1000 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1005 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1006 diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbtux/Makefile.in
1007 --- a/ndb/src/kernel/blocks/dbtux/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1008 +++ b/ndb/src/kernel/blocks/dbtux/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1011 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1016 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1017 diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbutil/Makefile.in
1018 --- a/ndb/src/kernel/blocks/dbutil/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1019 +++ b/ndb/src/kernel/blocks/dbutil/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1022 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1027 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1028 diff -r 1ac0113deff5 ndb/src/kernel/blocks/ndbcntr/Makefile.in
1029 --- a/ndb/src/kernel/blocks/ndbcntr/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1030 +++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1033 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1038 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1039 diff -r 1ac0113deff5 ndb/src/kernel/blocks/ndbfs/Makefile.in
1040 --- a/ndb/src/kernel/blocks/ndbfs/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1041 +++ b/ndb/src/kernel/blocks/ndbfs/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1044 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1049 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1050 diff -r 1ac0113deff5 ndb/src/kernel/blocks/qmgr/Makefile.in
1051 --- a/ndb/src/kernel/blocks/qmgr/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1052 +++ b/ndb/src/kernel/blocks/qmgr/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1055 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1060 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1061 diff -r 1ac0113deff5 ndb/src/kernel/blocks/suma/Makefile.in
1062 --- a/ndb/src/kernel/blocks/suma/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1063 +++ b/ndb/src/kernel/blocks/suma/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1066 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1071 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1072 diff -r 1ac0113deff5 ndb/src/kernel/blocks/trix/Makefile.in
1073 --- a/ndb/src/kernel/blocks/trix/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1074 +++ b/ndb/src/kernel/blocks/trix/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1077 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1082 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1083 diff -r 1ac0113deff5 ndb/src/kernel/error/Makefile.in
1084 --- a/ndb/src/kernel/error/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1085 +++ b/ndb/src/kernel/error/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1088 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1093 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1094 diff -r 1ac0113deff5 ndb/src/kernel/vm/Makefile.in
1095 --- a/ndb/src/kernel/vm/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1096 +++ b/ndb/src/kernel/vm/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1099 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1104 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1105 diff -r 1ac0113deff5 ndb/src/mgmapi/Makefile.in
1106 --- a/ndb/src/mgmapi/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1107 +++ b/ndb/src/mgmapi/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1110 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1115 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1116 diff -r 1ac0113deff5 ndb/src/mgmclient/Makefile.in
1117 --- a/ndb/src/mgmclient/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1118 +++ b/ndb/src/mgmclient/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1121 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1126 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1127 diff -r 1ac0113deff5 ndb/src/mgmsrv/Makefile.in
1128 --- a/ndb/src/mgmsrv/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1129 +++ b/ndb/src/mgmsrv/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1132 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1137 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1138 diff -r 1ac0113deff5 ndb/src/ndbapi/Makefile.in
1139 --- a/ndb/src/ndbapi/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1140 +++ b/ndb/src/ndbapi/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1143 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1148 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1149 diff -r 1ac0113deff5 ndb/test/Makefile.in
1150 --- a/ndb/test/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1151 +++ b/ndb/test/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1154 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1159 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1160 diff -r 1ac0113deff5 ndb/test/ndbapi/Makefile.in
1161 --- a/ndb/test/ndbapi/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1162 +++ b/ndb/test/ndbapi/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1165 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1170 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1171 diff -r 1ac0113deff5 ndb/test/ndbapi/bank/Makefile.in
1172 --- a/ndb/test/ndbapi/bank/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1173 +++ b/ndb/test/ndbapi/bank/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1176 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1181 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1182 diff -r 1ac0113deff5 ndb/test/run-test/Makefile.in
1183 --- a/ndb/test/run-test/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1184 +++ b/ndb/test/run-test/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1187 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1192 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1193 diff -r 1ac0113deff5 ndb/test/src/Makefile.in
1194 --- a/ndb/test/src/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1195 +++ b/ndb/test/src/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1198 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1203 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1204 diff -r 1ac0113deff5 ndb/test/tools/Makefile.in
1205 --- a/ndb/test/tools/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1206 +++ b/ndb/test/tools/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1209 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1214 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1215 diff -r 1ac0113deff5 ndb/tools/Makefile.in
1216 --- a/ndb/tools/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1217 +++ b/ndb/tools/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1220 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1225 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1226 diff -r 1ac0113deff5 netware/Makefile.in
1227 --- a/netware/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1228 +++ b/netware/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1231 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1236 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1237 diff -r 1ac0113deff5 os2/Makefile.in
1238 --- a/os2/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1239 +++ b/os2/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1242 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1247 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1248 diff -r 1ac0113deff5 os2/include/Makefile.in
1249 --- a/os2/include/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1250 +++ b/os2/include/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1253 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1258 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1259 diff -r 1ac0113deff5 os2/include/sys/Makefile.in
1260 --- a/os2/include/sys/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1261 +++ b/os2/include/sys/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1264 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1269 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1270 diff -r 1ac0113deff5 patch_info/userstats.info
1271 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1272 +++ b/patch_info/userstats.info Mon Jun 01 00:36:01 2009 -0700
1274 +File=userstatsv2.patch
1275 +Name=SHOW USER/TABLE/INDEX statistics
1279 +Comment=Added INFORMATION_SCHEMA.*_STATISTICS
1281 +YK: fix behavior for prepared statements
1284 +YK: add switch variable "userstat_running" to control INFORMATION_SCHEMA.*_STATISTICS (default:OFF)
1287 +YK: fixed "Row_sent: 0" problem at microslow_innodb.patch
1288 diff -r 1ac0113deff5 pstack/Makefile.in
1289 --- a/pstack/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1290 +++ b/pstack/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1293 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1298 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1299 diff -r 1ac0113deff5 pstack/aout/Makefile.in
1300 --- a/pstack/aout/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1301 +++ b/pstack/aout/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1304 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1309 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1310 diff -r 1ac0113deff5 regex/Makefile.in
1311 --- a/regex/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1312 +++ b/regex/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1315 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1320 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1321 diff -r 1ac0113deff5 scripts/Makefile.in
1322 --- a/scripts/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1323 +++ b/scripts/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1326 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1331 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1332 diff -r 1ac0113deff5 server-tools/Makefile.in
1333 --- a/server-tools/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1334 +++ b/server-tools/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1337 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1342 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1343 diff -r 1ac0113deff5 server-tools/instance-manager/Makefile.in
1344 --- a/server-tools/instance-manager/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1345 +++ b/server-tools/instance-manager/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1348 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1353 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1354 diff -r 1ac0113deff5 sql/Makefile.in
1355 --- a/sql/Makefile.in Mon Jun 01 00:35:44 2009 -0700
1356 +++ b/sql/Makefile.in Mon Jun 01 00:36:01 2009 -0700
1359 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1364 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1365 diff -r 1ac0113deff5 sql/ha_innodb.cc
1366 --- a/sql/ha_innodb.cc Mon Jun 01 00:35:44 2009 -0700
1367 +++ b/sql/ha_innodb.cc Mon Jun 01 00:36:01 2009 -0700
1368 @@ -3338,6 +3338,8 @@
1370 error = row_insert_for_mysql((byte*) record, prebuilt);
1372 + if (error == DB_SUCCESS) rows_changed++;
1374 if (error == DB_SUCCESS && auto_inc_used) {
1376 /* Fetch the value that was set in the autoincrement field */
1377 @@ -3610,6 +3612,8 @@
1381 + if (error == DB_SUCCESS) rows_changed++;
1383 innodb_srv_conc_exit_innodb(prebuilt->trx);
1385 error = convert_error_code_to_mysql(error, user_thd);
1386 @@ -3658,6 +3662,8 @@
1388 error = row_update_for_mysql((byte*) record, prebuilt);
1390 + if (error == DB_SUCCESS) rows_changed++;
1392 innodb_srv_conc_exit_innodb(prebuilt->trx);
1394 error = convert_error_code_to_mysql(error, user_thd);
1395 @@ -4089,6 +4095,9 @@
1396 if (ret == DB_SUCCESS) {
1400 + if (active_index >= 0 && active_index < MAX_KEY)
1401 + index_rows_read[active_index]++;
1403 } else if (ret == DB_RECORD_NOT_FOUND) {
1404 error = HA_ERR_END_OF_FILE;
1405 diff -r 1ac0113deff5 sql/ha_myisam.cc
1406 --- a/sql/ha_myisam.cc Mon Jun 01 00:35:44 2009 -0700
1407 +++ b/sql/ha_myisam.cc Mon Jun 01 00:36:01 2009 -0700
1409 if ((error= update_auto_increment()))
1412 - return mi_write(file,buf);
1413 + int error=mi_write(file,buf);
1414 + if (!error) rows_changed++;
1418 int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
1419 @@ -1518,13 +1520,17 @@
1420 statistic_increment(table->in_use->status_var.ha_update_count,&LOCK_status);
1421 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
1422 table->timestamp_field->set_time();
1423 - return mi_update(file,old_data,new_data);
1424 + int error=mi_update(file,old_data,new_data);
1425 + if (!error) rows_changed++;
1429 int ha_myisam::delete_row(const byte * buf)
1431 statistic_increment(table->in_use->status_var.ha_delete_count,&LOCK_status);
1432 - return mi_delete(file,buf);
1433 + int error=mi_delete(file,buf);
1434 + if (!error) rows_changed++;
1438 int ha_myisam::index_read(byte * buf, const byte * key,
1439 @@ -1535,6 +1541,13 @@
1441 int error=mi_rkey(file,buf,active_index, key, key_len, find_flag);
1442 table->status=error ? STATUS_NOT_FOUND: 0;
1446 + int inx = (active_index == -1) ? file->lastinx : active_index;
1447 + if (inx >= 0 && inx < MAX_KEY)
1448 + index_rows_read[inx]++;
1453 @@ -1545,6 +1558,13 @@
1455 int error=mi_rkey(file,buf,index, key, key_len, find_flag);
1456 table->status=error ? STATUS_NOT_FOUND: 0;
1461 + if (inx >= 0 && inx < MAX_KEY)
1462 + index_rows_read[inx]++;
1467 @@ -1555,6 +1575,13 @@
1469 int error=mi_rkey(file,buf,active_index, key, key_len, HA_READ_PREFIX_LAST);
1470 table->status=error ? STATUS_NOT_FOUND: 0;
1474 + int inx = (active_index == -1) ? file->lastinx : active_index;
1475 + if (inx >= 0 && inx < MAX_KEY)
1476 + index_rows_read[inx]++;
1481 @@ -1565,6 +1592,13 @@
1483 int error=mi_rnext(file,buf,active_index);
1484 table->status=error ? STATUS_NOT_FOUND: 0;
1488 + int inx = (active_index == -1) ? file->lastinx : active_index;
1489 + if (inx >= 0 && inx < MAX_KEY)
1490 + index_rows_read[inx]++;
1495 @@ -1575,6 +1609,13 @@
1497 int error=mi_rprev(file,buf, active_index);
1498 table->status=error ? STATUS_NOT_FOUND: 0;
1502 + int inx = (active_index == -1) ? file->lastinx : active_index;
1503 + if (inx >= 0 && inx < MAX_KEY)
1504 + index_rows_read[inx]++;
1509 @@ -1585,6 +1626,13 @@
1511 int error=mi_rfirst(file, buf, active_index);
1512 table->status=error ? STATUS_NOT_FOUND: 0;
1516 + int inx = (active_index == -1) ? file->lastinx : active_index;
1517 + if (inx >= 0 && inx < MAX_KEY)
1518 + index_rows_read[inx]++;
1523 @@ -1595,6 +1643,13 @@
1525 int error=mi_rlast(file, buf, active_index);
1526 table->status=error ? STATUS_NOT_FOUND: 0;
1530 + int inx = (active_index == -1) ? file->lastinx : active_index;
1531 + if (inx >= 0 && inx < MAX_KEY)
1532 + index_rows_read[inx]++;
1537 @@ -1611,6 +1666,13 @@
1538 error= mi_rnext_same(file,buf);
1539 } while (error == HA_ERR_RECORD_DELETED);
1540 table->status=error ? STATUS_NOT_FOUND: 0;
1544 + int inx = (active_index == -1) ? file->lastinx : active_index;
1545 + if (inx >= 0 && inx < MAX_KEY)
1546 + index_rows_read[inx]++;
1551 @@ -1628,6 +1690,7 @@
1553 int error=mi_scan(file, buf);
1554 table->status=error ? STATUS_NOT_FOUND: 0;
1555 + if (!error) rows_read++;
1559 @@ -1642,6 +1705,7 @@
1561 int error=mi_rrnd(file, buf, my_get_ptr(pos,ref_length));
1562 table->status=error ? STATUS_NOT_FOUND: 0;
1563 + if (!error) rows_read++;
1567 diff -r 1ac0113deff5 sql/handler.cc
1568 --- a/sql/handler.cc Mon Jun 01 00:35:44 2009 -0700
1569 +++ b/sql/handler.cc Mon Jun 01 00:36:01 2009 -0700
1572 tc_log->unlog(cookie, xid);
1573 DBUG_EXECUTE_IF("crash_commit_after", abort(););
1574 + if (is_real_trans)
1575 + thd->diff_commit_trans++;
1578 start_waiting_global_read_lock(thd);
1580 thd->transaction.cleanup();
1583 + thd->diff_rollback_trans++;
1584 #endif /* USING_TRANSACTIONS */
1587 @@ -1223,6 +1226,7 @@
1588 statistic_increment(thd->status_var.ha_rollback_count,&LOCK_status);
1589 *ht=0; // keep it conveniently zero-filled
1591 + thd->diff_rollback_trans++;
1595 @@ -1453,6 +1457,8 @@
1597 dupp_ref=ref+ALIGN_SIZE(ref_length);
1599 + rows_read = rows_changed = 0;
1600 + memset(index_rows_read, 0, sizeof(index_rows_read));
1604 @@ -2287,6 +2293,111 @@
1608 +// Updates the global table stats with the TABLE this handler represents.
1609 +void handler::update_global_table_stats() {
1610 + if (!opt_userstat_running) {
1611 + rows_read = rows_changed = 0;
1615 + if (!rows_read && !rows_changed) return; // Nothing to update.
1616 + // table_cache_key is db_name + '\0' + table_name + '\0'.
1617 + if (!table->s || !table->s->table_cache_key || !table->s->table_name) return;
1619 + TABLE_STATS* table_stats;
1620 + char key[NAME_LEN * 2 + 2];
1621 + // [db] + '.' + [table]
1622 + sprintf(key, "%s.%s", table->s->table_cache_key, table->s->table_name);
1624 + pthread_mutex_lock(&LOCK_global_table_stats);
1625 + // Gets the global table stats, creating one if necessary.
1626 + if (!(table_stats = (TABLE_STATS*)hash_search(&global_table_stats,
1629 + if (!(table_stats = ((TABLE_STATS*)
1630 + my_malloc(sizeof(TABLE_STATS), MYF(MY_WME | MY_ZEROFILL))))) {
1632 + sql_print_error("Allocating table stats failed.");
1635 + strncpy(table_stats->table, key, sizeof(table_stats->table));
1636 + table_stats->rows_read = 0;
1637 + table_stats->rows_changed = 0;
1638 + table_stats->rows_changed_x_indexes = 0;
1639 + table_stats->engine_type = (int) ht->db_type;
1641 + if (my_hash_insert(&global_table_stats, (byte*)table_stats)) {
1643 + sql_print_error("Inserting table stats failed.");
1644 + my_free((char*)table_stats, 0);
1648 + // Updates the global table stats.
1649 + table_stats->rows_read += rows_read;
1650 + table_stats->rows_changed += rows_changed;
1651 + table_stats->rows_changed_x_indexes +=
1652 + rows_changed * (table->s->keys ? table->s->keys : 1);
1653 + current_thd->diff_total_read_rows += rows_read;
1654 + rows_read = rows_changed = 0;
1656 + pthread_mutex_unlock(&LOCK_global_table_stats);
1659 +// Updates the global index stats with this handler's accumulated index reads.
1660 +void handler::update_global_index_stats() {
1661 + // table_cache_key is db_name + '\0' + table_name + '\0'.
1662 + if (!table->s || !table->s->table_cache_key || !table->s->table_name) return;
1664 + if (!opt_userstat_running) {
1665 + for (int x = 0; x < table->s->keys; x++) {
1666 + index_rows_read[x] = 0;
1671 + for (int x = 0; x < table->s->keys; x++) {
1672 + if (index_rows_read[x]) {
1673 + // Rows were read using this index.
1674 + KEY* key_info = &table->key_info[x];
1676 + if (!key_info->name) continue;
1678 + INDEX_STATS* index_stats;
1679 + char key[NAME_LEN * 3 + 3];
1680 + // [db] + '.' + [table] + '.' + [index]
1681 + sprintf(key, "%s.%s.%s", table->s->table_cache_key,
1682 + table->s->table_name, key_info->name);
1684 + pthread_mutex_lock(&LOCK_global_index_stats);
1685 + // Gets the global index stats, creating one if necessary.
1686 + if (!(index_stats = (INDEX_STATS*)hash_search(&global_index_stats,
1689 + if (!(index_stats = ((INDEX_STATS*)
1690 + my_malloc(sizeof(INDEX_STATS), MYF(MY_WME | MY_ZEROFILL))))) {
1692 + sql_print_error("Allocating index stats failed.");
1695 + strncpy(index_stats->index, key, sizeof(index_stats->index));
1696 + index_stats->rows_read = 0;
1698 + if (my_hash_insert(&global_index_stats, (byte*)index_stats)) {
1700 + sql_print_error("Inserting index stats failed.");
1701 + my_free((char*)index_stats, 0);
1705 + // Updates the global index stats.
1706 + index_stats->rows_read += index_rows_read[x];
1707 + index_rows_read[x] = 0;
1709 + pthread_mutex_unlock(&LOCK_global_index_stats);
1714 /****************************************************************************
1715 ** Some general functions that isn't in the handler class
1716 diff -r 1ac0113deff5 sql/handler.h
1717 --- a/sql/handler.h Mon Jun 01 00:35:44 2009 -0700
1718 +++ b/sql/handler.h Mon Jun 01 00:36:01 2009 -0700
1720 #define USING_TRANSACTIONS
1724 +#error MAX_KEY is too large. Values up to 128 are supported.
1727 // the following is for checking tables
1729 #define HA_ADMIN_ALREADY_DONE 1
1731 bool auto_increment_column_changed;
1732 bool implicit_emptied; /* Can be !=0 only if HEAP */
1733 const COND *pushed_cond;
1734 + ulonglong rows_read;
1735 + ulonglong rows_changed;
1736 + ulonglong index_rows_read[MAX_KEY];
1738 handler(const handlerton *ht_arg, TABLE *table_arg) :table(table_arg),
1740 @@ -615,8 +622,10 @@
1741 ref_length(sizeof(my_off_t)), block_size(0),
1742 raid_type(0), ft_handler(0), inited(NONE),
1743 locked(FALSE), implicit_emptied(0),
1746 + pushed_cond(NULL), rows_read(0), rows_changed(0)
1748 + memset(index_rows_read, 0, sizeof(index_rows_read));
1750 virtual ~handler(void) { DBUG_ASSERT(locked == FALSE); /* TODO: DBUG_ASSERT(inited == NONE); */ }
1751 virtual handler *clone(MEM_ROOT *mem_root);
1752 int ha_open(const char *name, int mode, int test_if_locked);
1753 @@ -625,7 +634,11 @@
1754 virtual void print_error(int error, myf errflag);
1755 virtual bool get_error_message(int error, String *buf);
1756 uint get_dup_key(int error);
1757 - void change_table_ptr(TABLE *table_arg) { table=table_arg; }
1758 + void change_table_ptr(TABLE *table_arg) {
1760 + rows_read = rows_changed = 0;
1761 + memset(index_rows_read, 0, sizeof(index_rows_read));
1763 virtual double scan_time()
1764 { return ulonglong2double(data_file_length) / IO_SIZE + 2; }
1765 virtual double read_time(uint index, uint ranges, ha_rows rows)
1767 virtual bool is_crashed() const { return 0; }
1768 virtual bool auto_repair() const { return 0; }
1770 + void update_global_table_stats();
1771 + void update_global_index_stats();
1774 default rename_table() and delete_table() rename/delete files with a
1775 given name and extensions from bas_ext()
1776 diff -r 1ac0113deff5 sql/lex.h
1777 --- a/sql/lex.h Mon Jun 01 00:35:44 2009 -0700
1778 +++ b/sql/lex.h Mon Jun 01 00:36:01 2009 -0700
1780 { "CHECKSUM", SYM(CHECKSUM_SYM)},
1781 { "CIPHER", SYM(CIPHER_SYM)},
1782 { "CLIENT", SYM(CLIENT_SYM)},
1783 + { "CLIENT_STATISTICS", SYM(CLIENT_STATS_SYM)},
1784 { "CLOSE", SYM(CLOSE_SYM)},
1785 { "CODE", SYM(CODE_SYM)},
1786 { "COLLATE", SYM(COLLATE_SYM)},
1788 { "IN", SYM(IN_SYM)},
1789 { "INDEX", SYM(INDEX_SYM)},
1790 { "INDEXES", SYM(INDEXES)},
1791 + { "INDEX_STATISTICS", SYM(INDEX_STATS_SYM)},
1792 { "INFILE", SYM(INFILE)},
1793 { "INNER", SYM(INNER_SYM)},
1794 { "INNOBASE", SYM(INNOBASE_SYM)},
1796 { "SIGNED", SYM(SIGNED_SYM)},
1797 { "SIMPLE", SYM(SIMPLE_SYM)},
1798 { "SLAVE", SYM(SLAVE)},
1799 + { "SLOW", SYM(SLOW_SYM)},
1800 { "SNAPSHOT", SYM(SNAPSHOT_SYM)},
1801 { "SMALLINT", SYM(SMALLINT)},
1802 { "SOME", SYM(ANY_SYM)},
1804 { "TABLE", SYM(TABLE_SYM)},
1805 { "TABLES", SYM(TABLES)},
1806 { "TABLESPACE", SYM(TABLESPACE)},
1807 + { "TABLE_STATISTICS", SYM(TABLE_STATS_SYM)},
1808 { "TEMPORARY", SYM(TEMPORARY)},
1809 { "TEMPTABLE", SYM(TEMPTABLE_SYM)},
1810 { "TERMINATED", SYM(TERMINATED)},
1812 { "USE", SYM(USE_SYM)},
1813 { "USER", SYM(USER)},
1814 { "USER_RESOURCES", SYM(RESOURCES)},
1815 + { "USER_STATISTICS", SYM(USER_STATS_SYM)},
1816 { "USE_FRM", SYM(USE_FRM)},
1817 { "USING", SYM(USING)},
1818 { "UTC_DATE", SYM(UTC_DATE_SYM)},
1819 diff -r 1ac0113deff5 sql/log.cc
1820 --- a/sql/log.cc Mon Jun 01 00:35:44 2009 -0700
1821 +++ b/sql/log.cc Mon Jun 01 00:36:01 2009 -0700
1822 @@ -1958,18 +1958,24 @@
1823 thd->current_insert_id);
1826 + if (file == &log_file)
1827 + thd->binlog_bytes_written += e.data_written;
1829 if (thd->insert_id_used)
1831 Intvar_log_event e(thd,(uchar) INSERT_ID_EVENT,thd->last_insert_id);
1834 + if (file == &log_file)
1835 + thd->binlog_bytes_written += e.data_written;
1839 Rand_log_event e(thd,thd->rand_saved_seed1,thd->rand_saved_seed2);
1842 + if (file == &log_file)
1843 + thd->binlog_bytes_written += e.data_written;
1845 if (thd->user_var_events.elements)
1847 @@ -1985,6 +1991,8 @@
1848 user_var_event->charset_number);
1851 + if (file == &log_file)
1852 + thd->binlog_bytes_written += e.data_written;
1856 @@ -1995,6 +2003,8 @@
1858 if (event_info->write(file))
1860 + if (file == &log_file)
1861 + thd->binlog_bytes_written += event_info->data_written;
1863 if (file == &log_file) // we are writing to the real log (disk)
1865 @@ -2117,6 +2127,7 @@
1867 if (qinfo.write(&log_file))
1869 + thd->binlog_bytes_written += qinfo.data_written;
1871 /* Read from the file used to cache the queries .*/
1872 if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
1873 @@ -2163,6 +2174,7 @@
1874 /* write the first half of the split header */
1875 if (my_b_write(&log_file, header, carry))
1877 + thd->binlog_bytes_written += carry;
1880 copy fixed second half of header to cache so the correct
1881 @@ -2231,6 +2243,8 @@
1882 /* Write data to the binary log file */
1883 if (my_b_write(&log_file, cache->read_pos, length))
1885 + thd->binlog_bytes_written += length;
1887 cache->read_pos=cache->read_end; // Mark buffer used up
1888 DBUG_EXECUTE_IF("half_binlogged_transaction", goto DBUG_skip_commit;);
1889 } while ((length=my_b_fill(cache)));
1890 @@ -2239,6 +2253,8 @@
1892 if (commit_event->write(&log_file))
1894 + thd->binlog_bytes_written += commit_event->data_written;
1899 diff -r 1ac0113deff5 sql/mysql_priv.h
1900 --- a/sql/mysql_priv.h Mon Jun 01 00:35:44 2009 -0700
1901 +++ b/sql/mysql_priv.h Mon Jun 01 00:36:01 2009 -0700
1902 @@ -837,7 +837,15 @@
1903 bool multi_delete_set_locks_and_link_aux_tables(LEX *lex);
1904 void init_max_user_conn(void);
1905 void init_update_queries(void);
1906 +void init_global_user_stats(void);
1907 +void init_global_table_stats(void);
1908 +void init_global_index_stats(void);
1909 +void init_global_client_stats(void);
1910 void free_max_user_conn(void);
1911 +void free_global_user_stats(void);
1912 +void free_global_table_stats(void);
1913 +void free_global_index_stats(void);
1914 +void free_global_client_stats(void);
1915 pthread_handler_t handle_one_connection(void *arg);
1916 pthread_handler_t handle_bootstrap(void *arg);
1917 void end_thread(THD *thd,bool put_in_cache);
1918 @@ -1416,6 +1424,7 @@
1919 extern ulong max_connections,max_connect_errors, connect_timeout;
1920 extern ulong slave_net_timeout, slave_trans_retries;
1921 extern uint max_user_connections;
1922 +extern ulonglong denied_connections;
1923 extern ulong what_to_log,flush_time;
1924 extern ulong query_buff_size, thread_stack;
1925 extern ulong max_prepared_stmt_count, prepared_stmt_count;
1926 @@ -1446,6 +1455,7 @@
1927 extern my_bool opt_safe_show_db, opt_local_infile;
1928 extern my_bool opt_slave_compressed_protocol, use_temp_pool;
1929 extern my_bool opt_readonly, lower_case_file_system;
1930 +extern my_bool opt_userstat_running;
1931 extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
1932 extern my_bool opt_secure_auth;
1933 extern char* opt_secure_file_priv;
1934 @@ -1493,6 +1503,14 @@
1935 extern struct system_variables max_system_variables;
1936 extern struct system_status_var global_status_var;
1937 extern struct rand_struct sql_rand;
1938 +extern HASH global_user_stats;
1939 +extern HASH global_client_stats;
1940 +extern pthread_mutex_t LOCK_global_user_client_stats;
1941 +extern HASH global_table_stats;
1942 +extern pthread_mutex_t LOCK_global_table_stats;
1943 +extern HASH global_index_stats;
1944 +extern pthread_mutex_t LOCK_global_index_stats;
1945 +extern pthread_mutex_t LOCK_stats;
1947 extern const char *opt_date_time_formats[];
1948 extern KNOWN_DATE_TIME_FORMAT known_date_time_formats[];
1949 diff -r 1ac0113deff5 sql/mysqld.cc
1950 --- a/sql/mysqld.cc Mon Jun 01 00:35:44 2009 -0700
1951 +++ b/sql/mysqld.cc Mon Jun 01 00:36:01 2009 -0700
1953 uint opt_large_page_size= 0;
1954 my_bool opt_old_style_user_limits= 0, trust_function_creators= 0;
1955 char* opt_slow_logname= 0;
1956 +my_bool opt_userstat_running= 0;
1958 True if there is at least one per-hour limit for some user, so we should
1959 check them before each query (and possibly reset counters when hour is
1961 ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
1962 ulong max_connections, max_connect_errors;
1963 uint max_user_connections= 0;
1964 +ulonglong denied_connections = 0;
1966 Limit of the total number of prepared statements in the server.
1967 Is necessary to protect the server against out-of-memory attacks.
1968 @@ -555,6 +557,10 @@
1969 LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
1970 LOCK_global_system_variables,
1971 LOCK_user_conn, LOCK_slave_list, LOCK_active_mi;
1972 +pthread_mutex_t LOCK_stats;
1973 +pthread_mutex_t LOCK_global_user_client_stats;
1974 +pthread_mutex_t LOCK_global_table_stats;
1975 +pthread_mutex_t LOCK_global_index_stats;
1977 The below lock protects access to two global server variables:
1978 max_prepared_stmt_count and prepared_stmt_count. These variables
1979 @@ -1196,6 +1202,10 @@
1980 x_free(opt_secure_file_priv);
1981 bitmap_free(&temp_pool);
1982 free_max_user_conn();
1983 + free_global_user_stats();
1984 + free_global_client_stats();
1985 + free_global_table_stats();
1986 + free_global_index_stats();
1987 #ifdef HAVE_REPLICATION
1989 free_list(&replicate_do_db);
1990 @@ -1310,6 +1320,10 @@
1991 (void) pthread_cond_destroy(&COND_thread_cache);
1992 (void) pthread_cond_destroy(&COND_flush_thread_cache);
1993 (void) pthread_cond_destroy(&COND_manager);
1994 + (void) pthread_mutex_destroy(&LOCK_stats);
1995 + (void) pthread_mutex_destroy(&LOCK_global_user_client_stats);
1996 + (void) pthread_mutex_destroy(&LOCK_global_table_stats);
1997 + (void) pthread_mutex_destroy(&LOCK_global_index_stats);
2000 #endif /*EMBEDDED_LIBRARY*/
2001 @@ -3157,6 +3171,10 @@
2002 (void) pthread_mutex_init(&LOCK_rpl_status, MY_MUTEX_INIT_FAST);
2003 (void) pthread_cond_init(&COND_rpl_status, NULL);
2005 + (void) pthread_mutex_init(&LOCK_stats, MY_MUTEX_INIT_FAST);
2006 + (void) pthread_mutex_init(&LOCK_global_user_client_stats, MY_MUTEX_INIT_FAST);
2007 + (void) pthread_mutex_init(&LOCK_global_table_stats, MY_MUTEX_INIT_FAST);
2008 + (void) pthread_mutex_init(&LOCK_global_index_stats, MY_MUTEX_INIT_FAST);
2010 /* Parameter for threads created for connections */
2011 (void) pthread_attr_init(&connection_attrib);
2012 @@ -3428,6 +3446,10 @@
2013 sql_print_error("Out of memory");
2017 + init_global_table_stats();
2018 + init_global_index_stats();
2022 sql_print_error("Can't init databases");
2023 @@ -3510,6 +3532,8 @@
2025 init_max_user_conn();
2026 init_update_queries();
2027 + init_global_user_stats();
2028 + init_global_client_stats();
2032 @@ -4236,6 +4260,7 @@
2034 DBUG_PRINT("error",("Too many connections"));
2035 close_connection(thd, ER_CON_COUNT_ERROR, 1);
2036 + statistic_increment(denied_connections, &LOCK_status);
2040 @@ -5056,6 +5081,7 @@
2041 OPT_PROFILING_USE_GETRUSAGE,
2043 OPT_SLOW_QUERY_LOG_FILE,
2044 + OPT_USERSTAT_RUNNING,
2045 OPT_USE_GLOBAL_LONG_QUERY_TIME,
2046 OPT_INNODB_ROLLBACK_ON_TIMEOUT,
2047 OPT_SECURE_FILE_PRIV,
2048 @@ -6523,6 +6549,10 @@
2049 (gptr*) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
2050 REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT),
2052 + {"userstat_running", OPT_USERSTAT_RUNNING,
2053 + "Control USER_STATISTICS, CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS running",
2054 + (gptr*) &opt_userstat_running, (gptr*) &opt_userstat_running,
2055 + 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
2056 {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
2059 diff -r 1ac0113deff5 sql/set_var.cc
2060 --- a/sql/set_var.cc Mon Jun 01 00:35:44 2009 -0700
2061 +++ b/sql/set_var.cc Mon Jun 01 00:36:01 2009 -0700
2063 sys_var_thd_ulong sys_read_buff_size("read_buffer_size",
2064 &SV::read_buff_size);
2065 sys_var_bool_ptr sys_readonly("read_only", &opt_readonly);
2066 +sys_var_bool_ptr sys_userstat_running("userstat_running", &opt_userstat_running);
2067 sys_var_thd_ulong sys_read_rnd_buff_size("read_rnd_buffer_size",
2068 &SV::read_rnd_buff_size);
2069 sys_var_thd_ulong sys_div_precincrement("div_precision_increment",
2071 &sys_trans_alloc_block_size,
2072 &sys_trans_prealloc_size,
2074 + &sys_userstat_running,
2076 #ifdef HAVE_BERKELEY_DB
2078 @@ -1190,6 +1192,7 @@
2079 {sys_tx_isolation.name, (char*) &sys_tx_isolation, SHOW_SYS},
2080 {sys_updatable_views_with_limit.name,
2081 (char*) &sys_updatable_views_with_limit,SHOW_SYS},
2082 + {sys_userstat_running.name, (char*) &sys_userstat_running, SHOW_SYS},
2083 {sys_use_global_long_query_time.name, (char*) &sys_use_global_long_query_time, SHOW_SYS},
2084 {sys_version.name, (char*) &sys_version, SHOW_SYS},
2085 #ifdef HAVE_BERKELEY_DB
2086 diff -r 1ac0113deff5 sql/share/Makefile.in
2087 --- a/sql/share/Makefile.in Mon Jun 01 00:35:44 2009 -0700
2088 +++ b/sql/share/Makefile.in Mon Jun 01 00:36:01 2009 -0700
2091 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
2096 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
2097 diff -r 1ac0113deff5 sql/sql_base.cc
2098 --- a/sql/sql_base.cc Mon Jun 01 00:35:44 2009 -0700
2099 +++ b/sql/sql_base.cc Mon Jun 01 00:36:01 2009 -0700
2100 @@ -624,6 +624,12 @@
2101 DBUG_ENTER("close_thread_table");
2102 DBUG_ASSERT(table->key_read == 0);
2103 DBUG_ASSERT(!table->file || table->file->inited == handler::NONE);
2107 + table->file->update_global_table_stats();
2108 + table->file->update_global_index_stats();
2111 *table_ptr=table->next;
2112 if (table->needs_reopen_or_name_lock() ||
2115 DBUG_ENTER("close_temporary");
2116 char path[FN_REFLEN];
2118 + table->file->update_global_table_stats();
2119 + table->file->update_global_index_stats();
2120 db_type table_type=table->s->db_type;
2121 strmov(path,table->s->path);
2122 free_io_cache(table);
2123 diff -r 1ac0113deff5 sql/sql_class.cc
2124 --- a/sql/sql_class.cc Mon Jun 01 00:35:44 2009 -0700
2125 +++ b/sql/sql_class.cc Mon Jun 01 00:36:01 2009 -0700
2126 @@ -239,6 +239,13 @@
2127 bzero(ha_data, sizeof(ha_data));
2129 binlog_evt_union.do_union= FALSE;
2132 + bytes_received = 0;
2134 + binlog_bytes_written = 0;
2135 + updated_row_count = 0;
2136 + sent_row_count_2 = 0;
2138 dbug_sentry=THD_SENTRY_MAGIC;
2140 @@ -378,6 +385,88 @@
2141 total_warn_count= 0;
2143 bzero((char *) &status_var, sizeof(status_var));
2147 +// Resets stats in a THD.
2148 +void THD::reset_stats(void) {
2149 + current_connect_time = time(NULL);
2150 + last_global_update_time = current_connect_time;
2151 + reset_diff_stats();
2154 +// Resets the 'diff' stats, which are used to update global stats.
2155 +void THD::reset_diff_stats(void) {
2156 + diff_total_busy_time = 0;
2157 + diff_total_cpu_time = 0;
2158 + diff_total_bytes_received = 0;
2159 + diff_total_bytes_sent = 0;
2160 + diff_total_binlog_bytes_written = 0;
2161 + diff_total_sent_rows = 0;
2162 + diff_total_updated_rows = 0;
2163 + diff_total_read_rows = 0;
2164 + diff_select_commands = 0;
2165 + diff_update_commands = 0;
2166 + diff_other_commands = 0;
2167 + diff_commit_trans = 0;
2168 + diff_rollback_trans = 0;
2169 + diff_denied_connections = 0;
2170 + diff_lost_connections = 0;
2171 + diff_access_denied_errors = 0;
2172 + diff_empty_queries = 0;
2175 +// Updates 'diff' stats of a THD.
2176 +void THD::update_stats(bool ran_command) {
2177 + if (opt_userstat_running) {
2178 + diff_total_busy_time += busy_time;
2179 + diff_total_cpu_time += cpu_time;
2180 + diff_total_bytes_received += bytes_received;
2181 + diff_total_bytes_sent += bytes_sent;
2182 + diff_total_binlog_bytes_written += binlog_bytes_written;
2183 + diff_total_sent_rows += sent_row_count_2;
2184 + diff_total_updated_rows += updated_row_count;
2185 + // diff_total_read_rows is updated in handler.cc.
2187 + if (ran_command) {
2188 + // The replication thread has the COM_CONNECT command.
2189 + if ((old_command == COM_QUERY || command == COM_CONNECT) &&
2190 + (lex->sql_command >= 0 && lex->sql_command < SQLCOM_END)) {
2192 + if (lex->sql_command == SQLCOM_SELECT) {
2193 + if (lex->orig_sql_command == SQLCOM_END) {
2194 + diff_select_commands++;
2195 + if (!sent_row_count_2)
2196 + diff_empty_queries++;
2198 + // 'SHOW ' commands become SQLCOM_SELECT.
2199 + diff_other_commands++;
2200 + // 'SHOW ' commands shouldn't inflate total sent row count.
2201 + diff_total_sent_rows -= sent_row_count_2;
2203 + } else if (is_update_query(lex->sql_command)) {
2204 + diff_update_commands++;
2206 + diff_other_commands++;
2210 + // diff_commit_trans is updated in handler.cc.
2211 + // diff_rollback_trans is updated in handler.cc.
2212 + // diff_denied_connections is updated in sql_parse.cc.
2213 + // diff_lost_connections is updated in sql_parse.cc.
2214 + // diff_access_denied_errors is updated in sql_parse.cc.
2216 + /* reset counters to zero to avoid double-counting since values
2217 + are already store in diff_total_*. */
2221 + bytes_received = 0;
2223 + binlog_bytes_written = 0;
2224 + updated_row_count = 0;
2225 + sent_row_count_2 = 0;
2229 @@ -907,6 +996,33 @@
2233 +char *THD::get_client_host_port(THD *client)
2235 + Security_context *client_sctx= client->security_ctx;
2236 + char *client_host= NULL;
2238 + if (client->peer_port && (client_sctx->host || client_sctx->ip) &&
2239 + security_ctx->host_or_ip[0])
2241 + if ((client_host= this->alloc(LIST_PROCESS_HOST_LEN+1)))
2242 + my_snprintf((char *) client_host, LIST_PROCESS_HOST_LEN,
2243 + "%s:%u", client_sctx->host_or_ip, client->peer_port);
2246 + client_host= this->strdup(client_sctx->host_or_ip[0] ?
2247 + client_sctx->host_or_ip :
2248 + client_sctx->host ? client_sctx->host : "");
2250 + return client_host;
2253 +const char *get_client_host(THD *client)
2255 + return client->security_ctx->host_or_ip[0] ?
2256 + client->security_ctx->host_or_ip :
2257 + client->security_ctx->host ? client->security_ctx->host : "";
2261 struct Item_change_record: public ilink
2263 @@ -1082,6 +1198,7 @@
2264 buffer.set(buff, sizeof(buff), &my_charset_bin);
2266 thd->sent_row_count++;
2267 + thd->sent_row_count_2++;
2270 if (!thd->net.report_error)
2271 @@ -1174,6 +1291,7 @@
2272 select_export::~select_export()
2274 thd->sent_row_count=row_count;
2275 + thd->sent_row_count_2=row_count;
2279 @@ -2108,6 +2226,7 @@
2280 if (likely(thd != 0))
2281 { /* current_thd==0 when close_connection() calls net_send_error() */
2282 thd->status_var.bytes_sent+= length;
2283 + thd->bytes_sent+= length;
2287 @@ -2115,6 +2234,7 @@
2288 void thd_increment_bytes_received(ulong length)
2290 current_thd->status_var.bytes_received+= length;
2291 + current_thd->bytes_received+= length;
2295 diff -r 1ac0113deff5 sql/sql_class.h
2296 --- a/sql/sql_class.h Mon Jun 01 00:35:44 2009 -0700
2297 +++ b/sql/sql_class.h Mon Jun 01 00:36:01 2009 -0700
2298 @@ -1302,6 +1302,8 @@
2299 first byte of the packet in do_command()
2301 enum enum_server_command command;
2302 + // Used to save the command, before it is set to COM_SLEEP.
2303 + enum enum_server_command old_command;
2305 uint32 file_id; // for LOAD DATA INFILE
2307 @@ -1498,6 +1500,8 @@
2308 /* variables.transaction_isolation is reset to this after each commit */
2309 enum_tx_isolation session_tx_isolation;
2310 enum_check_fields count_cuted_fields;
2311 + ha_rows updated_row_count;
2312 + ha_rows sent_row_count_2; /* for userstat */
2314 DYNAMIC_ARRAY user_var_events; /* For user variables replication */
2315 MEM_ROOT *user_var_events_alloc; /* Allocate above array elements here */
2316 @@ -1607,6 +1611,49 @@
2318 LOG_INFO* current_linfo;
2319 NET* slave_net; // network connection from slave -> m.
2322 + Used to update global user stats. The global user stats are updated
2323 + occasionally with the 'diff' variables. After the update, the 'diff'
2324 + variables are reset to 0.
2326 + // Time when the current thread connected to MySQL.
2327 + time_t current_connect_time;
2328 + // Last time when THD stats were updated in global_user_stats.
2329 + time_t last_global_update_time;
2330 + // Busy (non-idle) time for just one command.
2332 + // Busy time not updated in global_user_stats yet.
2333 + double diff_total_busy_time;
2334 + // Cpu (non-idle) time for just one thread.
2336 + // Cpu time not updated in global_user_stats yet.
2337 + double diff_total_cpu_time;
2338 + /* bytes counting */
2339 + ulonglong bytes_received;
2340 + ulonglong diff_total_bytes_received;
2341 + ulonglong bytes_sent;
2342 + ulonglong diff_total_bytes_sent;
2343 + ulonglong binlog_bytes_written;
2344 + ulonglong diff_total_binlog_bytes_written;
2346 + // Number of rows not reflected in global_user_stats yet.
2347 + ha_rows diff_total_sent_rows, diff_total_updated_rows, diff_total_read_rows;
2348 + // Number of commands not reflected in global_user_stats yet.
2349 + ulonglong diff_select_commands, diff_update_commands, diff_other_commands;
2350 + // Number of transactions not reflected in global_user_stats yet.
2351 + ulonglong diff_commit_trans, diff_rollback_trans;
2352 + // Number of connection errors not reflected in global_user_stats yet.
2353 + ulonglong diff_denied_connections, diff_lost_connections;
2354 + // Number of db access denied, not reflected in global_user_stats yet.
2355 + ulonglong diff_access_denied_errors;
2356 + // Number of queries that return 0 rows
2357 + ulonglong diff_empty_queries;
2359 + // Per account query delay in miliseconds. When not 0, sleep this number of
2360 + // milliseconds before every SQL command.
2361 + ulonglong query_delay_millis;
2363 /* Used by the sys_var class to store temporary values */
2366 @@ -1662,6 +1709,11 @@
2369 void init_for_queries();
2370 + void reset_stats(void);
2371 + void reset_diff_stats(void);
2372 + // ran_command is true when this is called immediately after a
2373 + // command has been run.
2374 + void update_stats(bool ran_command);
2375 void change_user(void);
2377 void cleanup_after_query();
2378 @@ -1891,8 +1943,14 @@
2380 *p_db_length= db_length;
2383 + // Returns string as 'IP:port' for the client-side of the connnection represented
2384 + // by 'client' as displayed by SHOW PROCESSLIST. Allocates memory from the heap of
2385 + // this THD and that is not reclaimed immediately, so use sparingly. May return NULL.
2388 + char *get_client_host_port(THD *client);
2392 Add an internal error handler to the thread execution context.
2393 @@ -1935,6 +1993,11 @@
2394 MEM_ROOT main_mem_root;
2397 +// Returns string as 'IP' for the client-side of the connection represented by
2398 +// 'client'. Does not allocate memory. May return "".
2399 +const char *get_client_host(THD *client);
2401 +#define LIST_PROCESS_HOST_LEN 64
2403 #define tmp_disable_binlog(A) \
2404 {ulonglong tmp_disable_binlog__save_options= (A)->options; \
2405 diff -r 1ac0113deff5 sql/sql_delete.cc
2406 --- a/sql/sql_delete.cc Mon Jun 01 00:35:44 2009 -0700
2407 +++ b/sql/sql_delete.cc Mon Jun 01 00:36:01 2009 -0700
2409 send_ok(thd,deleted);
2410 DBUG_PRINT("info",("%ld records deleted",(long) deleted));
2412 + thd->updated_row_count += deleted;
2413 DBUG_RETURN(error >= 0 || thd->net.report_error);
2417 thd->row_count_func= deleted;
2418 ::send_ok(thd, deleted);
2420 + thd->updated_row_count += deleted;
2424 diff -r 1ac0113deff5 sql/sql_insert.cc
2425 --- a/sql/sql_insert.cc Mon Jun 01 00:35:44 2009 -0700
2426 +++ b/sql/sql_insert.cc Mon Jun 01 00:36:01 2009 -0700
2428 thd->row_count_func= info.copied + info.deleted + updated;
2429 ::send_ok(thd, (ulong) thd->row_count_func, id, buff);
2431 + thd->updated_row_count += thd->row_count_func;
2432 thd->abort_on_warning= 0;
2435 @@ -3064,6 +3065,7 @@
2436 autoinc_value_of_first_inserted_row : thd->insert_id_used ?
2437 thd->last_insert_id : 0;
2438 ::send_ok(thd, (ulong) thd->row_count_func, id, buff);
2439 + thd->updated_row_count += thd->row_count_func;
2443 diff -r 1ac0113deff5 sql/sql_lex.h
2444 --- a/sql/sql_lex.h Mon Jun 01 00:35:44 2009 -0700
2445 +++ b/sql/sql_lex.h Mon Jun 01 00:36:01 2009 -0700
2447 When a command is added here, be sure it's also added in mysqld.cc
2448 in "struct show_var_st status_vars[]= {" ...
2450 + // TODO(mcallaghan): update status_vars in mysqld to export these
2451 + SQLCOM_SHOW_USER_STATS, SQLCOM_SHOW_TABLE_STATS, SQLCOM_SHOW_INDEX_STATS,
2452 + SQLCOM_SHOW_CLIENT_STATS,
2453 /* This should be the last !!! */
2456 diff -r 1ac0113deff5 sql/sql_parse.cc
2457 --- a/sql/sql_parse.cc Mon Jun 01 00:35:44 2009 -0700
2458 +++ b/sql/sql_parse.cc Mon Jun 01 00:36:01 2009 -0700
2460 const char *table_name);
2461 static bool check_show_create_table_access(THD *thd, TABLE_LIST *table);
2463 +// Increments connection count for user.
2464 +static int increment_connection_count(THD* thd, bool use_lock);
2466 +// Uses the THD to update the global stats by user name and client IP
2467 +void update_global_user_stats(THD* thd, bool create_user, time_t now);
2469 const char *any_db="*any*"; // Special symbol for check_access
2471 const char *command_name[]={
2472 @@ -146,6 +152,17 @@
2473 static bool do_command(THD *thd);
2474 #endif // EMBEDDED_LIBRARY
2476 +HASH global_user_stats;
2477 +HASH global_client_stats;
2478 +// Protects global_user_stats and global_client_stats
2479 +extern pthread_mutex_t LOCK_global_user_client_stats;
2481 +HASH global_table_stats;
2482 +extern pthread_mutex_t LOCK_global_table_stats;
2484 +HASH global_index_stats;
2485 +extern pthread_mutex_t LOCK_global_index_stats;
2488 extern void win_install_sigabrt_handler(void);
2491 mysql_log.write(thd,COM_CONNECT,ER(ER_NOT_SUPPORTED_AUTH_MODE));
2494 + thd->diff_access_denied_errors++;
2495 net_printf_error(thd, ER_ACCESS_DENIED_ERROR,
2496 thd->main_security_ctx.user,
2497 thd->main_security_ctx.host_or_ip,
2498 @@ -536,12 +554,190 @@
2499 void init_max_user_conn(void)
2501 #ifndef NO_EMBEDDED_ACCESS_CHECKS
2502 - (void) hash_init(&hash_user_connections,system_charset_info,max_connections,
2504 - (hash_get_key) get_key_conn, (hash_free_key) free_user,
2508 + if (hash_init(&hash_user_connections,system_charset_info,max_connections,
2510 + (hash_get_key) get_key_conn, (hash_free_key) free_user,
2512 + sql_print_error("Initializing hash_user_connections failed.");
2518 +byte *get_key_user_stats(USER_STATS *user_stats, uint *length,
2519 + my_bool not_used __attribute__((unused)))
2521 + *length = strlen(user_stats->user);
2522 + return (byte*)user_stats->user;
2525 +void free_user_stats(USER_STATS* user_stats)
2527 + my_free((char*)user_stats, MYF(0));
2530 +void init_user_stats(USER_STATS *user_stats,
2532 + const char *priv_user,
2533 + uint total_connections,
2534 + uint concurrent_connections,
2535 + time_t connected_time,
2538 + ulonglong bytes_received,
2539 + ulonglong bytes_sent,
2540 + ulonglong binlog_bytes_written,
2541 + ha_rows rows_fetched,
2542 + ha_rows rows_updated,
2543 + ha_rows rows_read,
2544 + ulonglong select_commands,
2545 + ulonglong update_commands,
2546 + ulonglong other_commands,
2547 + ulonglong commit_trans,
2548 + ulonglong rollback_trans,
2549 + ulonglong denied_connections,
2550 + ulonglong lost_connections,
2551 + ulonglong access_denied_errors,
2552 + ulonglong empty_queries)
2554 + DBUG_ENTER("init_user_stats");
2555 + DBUG_PRINT("info",
2556 + ("Add user_stats entry for user %s - priv_user %s",
2557 + user, priv_user));
2558 + strncpy(user_stats->user, user, sizeof(user_stats->user));
2559 + strncpy(user_stats->priv_user, priv_user, sizeof(user_stats->priv_user));
2561 + user_stats->total_connections = total_connections;
2562 + user_stats->concurrent_connections = concurrent_connections;
2563 + user_stats->connected_time = connected_time;
2564 + user_stats->busy_time = busy_time;
2565 + user_stats->cpu_time = cpu_time;
2566 + user_stats->bytes_received = bytes_received;
2567 + user_stats->bytes_sent = bytes_sent;
2568 + user_stats->binlog_bytes_written = binlog_bytes_written;
2569 + user_stats->rows_fetched = rows_fetched;
2570 + user_stats->rows_updated = rows_updated;
2571 + user_stats->rows_read = rows_read;
2572 + user_stats->select_commands = select_commands;
2573 + user_stats->update_commands = update_commands;
2574 + user_stats->other_commands = other_commands;
2575 + user_stats->commit_trans = commit_trans;
2576 + user_stats->rollback_trans = rollback_trans;
2577 + user_stats->denied_connections = denied_connections;
2578 + user_stats->lost_connections = lost_connections;
2579 + user_stats->access_denied_errors = access_denied_errors;
2580 + user_stats->empty_queries = empty_queries;
2584 +void add_user_stats(USER_STATS *user_stats,
2585 + uint total_connections,
2586 + uint concurrent_connections,
2587 + time_t connected_time,
2590 + ulonglong bytes_received,
2591 + ulonglong bytes_sent,
2592 + ulonglong binlog_bytes_written,
2593 + ha_rows rows_fetched,
2594 + ha_rows rows_updated,
2595 + ha_rows rows_read,
2596 + ulonglong select_commands,
2597 + ulonglong update_commands,
2598 + ulonglong other_commands,
2599 + ulonglong commit_trans,
2600 + ulonglong rollback_trans,
2601 + ulonglong denied_connections,
2602 + ulonglong lost_connections,
2603 + ulonglong access_denied_errors,
2604 + ulonglong empty_queries)
2606 + user_stats->total_connections += total_connections;
2607 + user_stats->concurrent_connections += concurrent_connections;
2608 + user_stats->connected_time += connected_time;
2609 + user_stats->busy_time += busy_time;
2610 + user_stats->cpu_time += cpu_time;
2611 + user_stats->bytes_received += bytes_received;
2612 + user_stats->bytes_sent += bytes_sent;
2613 + user_stats->binlog_bytes_written += binlog_bytes_written;
2614 + user_stats->rows_fetched += rows_fetched;
2615 + user_stats->rows_updated += rows_updated;
2616 + user_stats->rows_read += rows_read;
2617 + user_stats->select_commands += select_commands;
2618 + user_stats->update_commands += update_commands;
2619 + user_stats->other_commands += other_commands;
2620 + user_stats->commit_trans += commit_trans;
2621 + user_stats->rollback_trans += rollback_trans;
2622 + user_stats->denied_connections += denied_connections;
2623 + user_stats->lost_connections += lost_connections;
2624 + user_stats->access_denied_errors += access_denied_errors;
2625 + user_stats->empty_queries += empty_queries;
2628 +void init_global_user_stats(void)
2630 + if (hash_init(&global_user_stats, system_charset_info, max_connections,
2631 + 0, 0, (hash_get_key)get_key_user_stats,
2632 + (hash_free_key)free_user_stats, 0)) {
2633 + sql_print_error("Initializing global_user_stats failed.");
2638 +void init_global_client_stats(void)
2640 + if (hash_init(&global_client_stats, system_charset_info, max_connections,
2641 + 0, 0, (hash_get_key)get_key_user_stats,
2642 + (hash_free_key)free_user_stats, 0)) {
2643 + sql_print_error("Initializing global_client_stats failed.");
2648 +extern "C" byte *get_key_table_stats(TABLE_STATS *table_stats, uint *length,
2649 + my_bool not_used __attribute__((unused)))
2651 + *length = strlen(table_stats->table);
2652 + return (byte*)table_stats->table;
2655 +extern "C" void free_table_stats(TABLE_STATS* table_stats)
2657 + my_free((char*)table_stats, MYF(0));
2660 +void init_global_table_stats(void)
2662 + if (hash_init(&global_table_stats, system_charset_info, max_connections,
2663 + 0, 0, (hash_get_key)get_key_table_stats,
2664 + (hash_free_key)free_table_stats, 0)) {
2665 + sql_print_error("Initializing global_table_stats failed.");
2670 +extern "C" byte *get_key_index_stats(INDEX_STATS *index_stats, uint *length,
2671 + my_bool not_used __attribute__((unused)))
2673 + *length = strlen(index_stats->index);
2674 + return (byte*)index_stats->index;
2677 +extern "C" void free_index_stats(INDEX_STATS* index_stats)
2679 + my_free((char*)index_stats, MYF(0));
2682 +void init_global_index_stats(void)
2684 + if (hash_init(&global_index_stats, system_charset_info, max_connections,
2685 + 0, 0, (hash_get_key)get_key_index_stats,
2686 + (hash_free_key)free_index_stats, 0)) {
2687 + sql_print_error("Initializing global_index_stats failed.");
2695 @@ -599,7 +795,10 @@
2700 + statistic_increment(denied_connections, &LOCK_status);
2701 uc->connections--; // no need for decrease_user_connections() here
2703 (void) pthread_mutex_unlock(&LOCK_user_conn);
2706 @@ -646,6 +845,25 @@
2707 #endif /* NO_EMBEDDED_ACCESS_CHECKS */
2710 +void free_global_user_stats(void)
2712 + hash_free(&global_user_stats);
2715 +void free_global_table_stats(void)
2717 + hash_free(&global_table_stats);
2720 +void free_global_index_stats(void)
2722 + hash_free(&global_index_stats);
2725 +void free_global_client_stats(void)
2727 + hash_free(&global_client_stats);
2732 @@ -698,6 +916,214 @@
2733 return uc_update_queries[command] != 0;
2736 +// 'mysql_system_user' is used for when the user is not defined for a THD.
2737 +static char mysql_system_user[] = "#mysql_system#";
2739 +// Returns 'user' if it's not NULL. Returns 'mysql_system_user' otherwise.
2740 +static char* get_valid_user_string(char* user) {
2741 + return user ? user : mysql_system_user;
2744 +// Increments the global stats connection count for an entry from
2745 +// global_client_stats or global_user_stats. Returns 0 on success
2747 +static int increment_count_by_name(const char *name, const char *role_name,
2748 + HASH *users_or_clients, THD *thd)
2750 + USER_STATS* user_stats;
2752 + if (!(user_stats = (USER_STATS*)hash_search(users_or_clients, name,
2755 + // First connection for this user or client
2756 + if (!(user_stats = ((USER_STATS*)
2757 + my_malloc(sizeof(USER_STATS), MYF(MY_WME | MY_ZEROFILL)))))
2759 + return 1; // Out of memory
2762 + init_user_stats(user_stats, name, role_name,
2763 + 0, 0, // connections
2765 + 0, 0, 0, // bytes sent, received and written
2766 + 0, 0, 0, // rows fetched, updated and read
2767 + 0, 0, 0, // select, update and other commands
2768 + 0, 0, // commit and rollback trans
2769 + thd->diff_denied_connections,
2770 + 0, // lost connections
2771 + 0, // access denied errors
2772 + 0); // empty queries
2774 + if (my_hash_insert(users_or_clients, (byte*)user_stats))
2776 + my_free((char*)user_stats, 0);
2777 + return 1; // Out of memory
2780 + user_stats->total_connections++;
2784 +// Increments the global user and client stats connection count. If 'use_lock'
2785 +// is true, LOCK_global_user_client_stats will be locked/unlocked. Returns
2786 +// 0 on success, 1 on error.
2787 +static int increment_connection_count(THD* thd, bool use_lock)
2789 + char* user_string = get_valid_user_string(thd->main_security_ctx.user);
2790 + const char* client_string = get_client_host(thd);
2791 + int return_value = 0;
2793 + if (!opt_userstat_running)
2794 + return return_value;
2796 + if (use_lock) pthread_mutex_lock(&LOCK_global_user_client_stats);
2798 + if (increment_count_by_name(user_string, user_string,
2799 + &global_user_stats, thd))
2804 + if (increment_count_by_name(client_string,
2806 + &global_client_stats, thd))
2813 + if (use_lock) pthread_mutex_unlock(&LOCK_global_user_client_stats);
2814 + return return_value;
2817 +// Used to update the global user and client stats.
2818 +static void update_global_user_stats_with_user(THD* thd,
2819 + USER_STATS* user_stats,
2822 + user_stats->connected_time += now - thd->last_global_update_time;
2823 + thd->last_global_update_time = now;
2824 + user_stats->busy_time += thd->diff_total_busy_time;
2825 + user_stats->cpu_time += thd->diff_total_cpu_time;
2826 + user_stats->bytes_received += thd->diff_total_bytes_received;
2827 + user_stats->bytes_sent += thd->diff_total_bytes_sent;
2828 + user_stats->binlog_bytes_written += thd->diff_total_binlog_bytes_written;
2829 + user_stats->rows_fetched += thd->diff_total_sent_rows;
2830 + user_stats->rows_updated += thd->diff_total_updated_rows;
2831 + user_stats->rows_read += thd->diff_total_read_rows;
2832 + user_stats->select_commands += thd->diff_select_commands;
2833 + user_stats->update_commands += thd->diff_update_commands;
2834 + user_stats->other_commands += thd->diff_other_commands;
2835 + user_stats->commit_trans += thd->diff_commit_trans;
2836 + user_stats->rollback_trans += thd->diff_rollback_trans;
2837 + user_stats->denied_connections += thd->diff_denied_connections;
2838 + user_stats->lost_connections += thd->diff_lost_connections;
2839 + user_stats->access_denied_errors += thd->diff_access_denied_errors;
2840 + user_stats->empty_queries += thd->diff_empty_queries;
2843 +// Updates the global stats of a user or client
2844 +void update_global_user_stats(THD* thd, bool create_user, time_t now)
2846 + if (opt_userstat_running) {
2847 + char* user_string = get_valid_user_string(thd->main_security_ctx.user);
2848 + const char* client_string = get_client_host(thd);
2850 + USER_STATS* user_stats;
2851 + pthread_mutex_lock(&LOCK_global_user_client_stats);
2853 + // Update by user name
2854 + if ((user_stats = (USER_STATS*)hash_search(&global_user_stats,
2855 + (byte*)user_string,
2856 + strlen(user_string)))) {
2858 + update_global_user_stats_with_user(thd, user_stats, now);
2860 + // Create the entry
2861 + if (create_user) {
2862 + increment_count_by_name(user_string, user_string,
2863 + &global_user_stats, thd);
2867 + // Update by client IP
2868 + if ((user_stats = (USER_STATS*)hash_search(&global_client_stats,
2869 + (byte*)client_string,
2870 + strlen(client_string)))) {
2871 + // Found by client IP
2872 + update_global_user_stats_with_user(thd, user_stats, now);
2874 + // Create the entry
2875 + if (create_user) {
2876 + increment_count_by_name(client_string,
2878 + &global_client_stats, thd);
2881 + thd->reset_diff_stats();
2883 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
2885 + thd->reset_diff_stats();
2889 +// Determines the concurrent number of connections of current threads.
2890 +static void set_connections_stats()
2892 + USER_STATS* user_stats;
2894 + pthread_mutex_lock(&LOCK_global_user_client_stats);
2895 + pthread_mutex_lock(&LOCK_thread_count);
2897 + // Resets all concurrent connections to 0.
2898 + for (int i = 0; i < global_user_stats.records; ++i) {
2899 + user_stats = (USER_STATS*)hash_element(&global_user_stats, i);
2900 + user_stats->concurrent_connections = 0;
2902 + for (int i = 0; i < global_client_stats.records; ++i) {
2903 + user_stats = (USER_STATS*)hash_element(&global_client_stats, i);
2904 + user_stats->concurrent_connections = 0;
2907 + I_List_iterator<THD> it(threads);
2909 + time_t now = time(NULL);
2910 + // Iterates through the current threads.
2911 + while ((thd = it++)) {
2912 + char* user_string = get_valid_user_string(thd->main_security_ctx.user);
2913 + if ((user_stats = (USER_STATS*)hash_search(&global_user_stats,
2914 + (byte*)user_string,
2915 + strlen(user_string)))) {
2917 + user_stats->concurrent_connections++;
2918 + update_global_user_stats_with_user(thd, user_stats, now);
2920 + // The user name should exist.
2921 + if (user_string == mysql_system_user) {
2922 + // Only create the user if it is the mysql_system_user
2923 + increment_count_by_name(user_string, user_string,
2924 + &global_user_stats, thd);
2928 + const char* client_string = get_client_host(thd);
2929 + if ((user_stats = (USER_STATS*)hash_search(&global_client_stats,
2930 + (byte*)client_string,
2931 + strlen(client_string)))) {
2933 + user_stats->concurrent_connections++;
2934 + update_global_user_stats_with_user(thd, user_stats, now);
2936 + // Do nothing, unlike what is done for global_user_stats
2938 + thd->reset_diff_stats();
2940 + pthread_mutex_unlock(&LOCK_thread_count);
2941 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
2945 Reset per-hour user resource limits when it has been more than
2946 an hour since they were last checked
2947 @@ -1184,6 +1610,8 @@
2948 my_net_set_read_timeout(net, connect_timeout);
2949 my_net_set_write_timeout(net, connect_timeout);
2951 + bool create_user = true;
2953 if ((error=check_connection(thd)))
2954 { // Wrong permissions
2956 @@ -1193,8 +1621,22 @@
2957 my_sleep(1000); /* must wait after eof() */
2959 statistic_increment(aborted_connects,&LOCK_status);
2960 + thd->diff_denied_connections++;
2961 + if (error == -2) {
2962 + // Do not create statistics for a user who does not exist, or failed
2963 + // to authenticate.
2964 + create_user = false;
2969 + thd->reset_stats();
2970 + // Updates global user connection stats.
2971 + if (increment_connection_count(thd, true)) {
2972 + net_send_error(thd, ER_OUTOFMEMORY); // Out of memory
2977 netware_reg_user(sctx->ip, sctx->user, "MySQL");
2979 @@ -1251,6 +1693,7 @@
2980 net->vio && net->error && net->report_error)
2982 statistic_increment(aborted_threads, &LOCK_status);
2983 + thd->diff_lost_connections++;
2986 if (net->error && net->vio != 0 && net->report_error)
2987 @@ -1270,6 +1713,8 @@
2990 close_connection(thd, 0, 1);
2991 + thd->update_stats(false);
2992 + update_global_user_stats(thd, create_user, time(NULL));
2995 If end_thread returns, we are either running with --one-thread
2996 @@ -1601,6 +2046,13 @@
2998 thd->clear_error(); // Clear error message
3000 + thd->updated_row_count=0;
3003 + thd->bytes_received=0;
3004 + thd->bytes_sent=0;
3005 + thd->binlog_bytes_written=0;
3007 net_new_transaction(net);
3009 packet_length= my_net_read(net);
3010 @@ -1759,6 +2211,9 @@
3013 thd->command=command;
3014 + // To increment the corrent command counter for user stats, 'command' must
3015 + // be saved because it is set to COM_SLEEP at the end of this function.
3016 + thd->old_command = command;
3018 Commands which always take a long time are logged into
3019 the slow log only if opt_log_slow_admin_statements is set.
3020 @@ -4540,6 +4995,15 @@
3021 if (check_global_access(thd,RELOAD_ACL))
3024 + if(lex->type & REFRESH_SLOW_QUERY_LOG) {
3025 + /* We are only flushing slow query log */
3026 + mysql_slow_log.new_file(1);
3034 reload_acl_and_cache() will tell us if we are allowed to write to the
3036 @@ -4848,6 +5312,7 @@
3038 if (check_global_access(thd, SUPER_ACL))
3040 + thd->diff_access_denied_errors++;
3041 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
3042 goto create_sp_error;
3044 @@ -5692,6 +6157,7 @@
3047 const char *db_name= db ? db : thd->db;
3048 + thd->diff_access_denied_errors++;
3049 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
3050 sctx->priv_user, sctx->priv_host, db_name);
3052 @@ -5727,6 +6193,7 @@
3053 { // We can never grant this
3054 DBUG_PRINT("error",("No possible access"));
3056 + thd->diff_access_denied_errors++;
3057 my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
3060 @@ -5759,11 +6226,15 @@
3062 DBUG_PRINT("error",("Access denied"));
3065 + // increment needs !no_errors condition, otherwise double counting.
3066 + thd->diff_access_denied_errors++;
3067 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
3068 sctx->priv_user, sctx->priv_host,
3069 (db ? db : (thd->db ?
3071 "unknown"))); /* purecov: tested */
3073 DBUG_RETURN(TRUE); /* purecov: tested */
3074 #endif /* NO_EMBEDDED_ACCESS_CHECKS */
3076 @@ -5797,6 +6268,7 @@
3077 if ((thd->security_ctx->master_access & want_access))
3079 get_privilege_desc(command, sizeof(command), want_access);
3080 + thd->diff_access_denied_errors++;
3081 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);
3083 #endif /* NO_EMBEDDED_ACCESS_CHECKS */
3084 @@ -5829,6 +6301,7 @@
3086 if (!thd->col_access && check_grant_db(thd, dst_db_name))
3088 + thd->diff_access_denied_errors++;
3089 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
3090 thd->security_ctx->priv_user,
3091 thd->security_ctx->priv_host,
3092 @@ -5860,6 +6333,12 @@
3093 check_grant(thd, SELECT_ACL, dst_table, 2, UINT_MAX, FALSE);
3097 + case SCH_USER_STATS:
3098 + case SCH_CLIENT_STATS:
3099 + return check_global_access(thd, SUPER_ACL | PROCESS_ACL);
3100 + case SCH_TABLE_STATS:
3101 + case SCH_INDEX_STATS:
3102 case SCH_OPEN_TABLES:
3105 @@ -5913,8 +6392,8 @@
3106 #ifndef NO_EMBEDDED_ACCESS_CHECKS
3107 TABLE_LIST *org_tables= tables;
3109 + Security_context *sctx= thd->security_ctx, *backup_ctx= thd->security_ctx;
3110 TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table();
3111 - Security_context *sctx= thd->security_ctx, *backup_ctx= thd->security_ctx;
3113 The check that first_not_own_table is not reached is for the case when
3114 the given table list refers to the list for prelocking (contains tables
3115 @@ -5931,9 +6410,12 @@
3116 (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
3120 + thd->diff_access_denied_errors++;
3121 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
3122 sctx->priv_user, sctx->priv_host,
3123 INFORMATION_SCHEMA_NAME.str);
3128 @@ -6443,6 +6925,30 @@
3130 mysql_reset_thd_for_next_command(thd);
3132 + int start_time_error = 0;
3133 + int end_time_error = 0;
3134 + struct timeval start_time, end_time;
3135 + double start_usecs = 0;
3136 + double end_usecs = 0;
3138 + int cputime_error = 0;
3139 + struct timespec tp;
3140 + double start_cpu_nsecs = 0;
3141 + double end_cpu_nsecs = 0;
3143 + if (opt_userstat_running) {
3144 +#ifdef HAVE_CLOCK_GETTIME
3145 + /* get start cputime */
3146 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3147 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3150 + // Gets the start time, in order to measure how long this command takes.
3151 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3152 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3156 if (query_cache_send_result_to_client(thd, (char*) inBuf, length) <= 0)
3159 @@ -6521,6 +7027,43 @@
3160 *found_semicolon= NULL;
3163 + if (opt_userstat_running) {
3164 + // Gets the end time.
3165 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3166 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3169 + // Calculates the difference between the end and start times.
3170 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3171 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3172 + // In case there are bad values, 2629743 is the #seconds in a month.
3173 + if (thd->busy_time > 2629743) {
3174 + thd->busy_time = 0;
3177 + // end time went back in time, or gettimeofday() failed.
3178 + thd->busy_time = 0;
3181 +#ifdef HAVE_CLOCK_GETTIME
3182 + /* get end cputime */
3183 + if (!cputime_error &&
3184 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3185 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3187 + if (start_cpu_nsecs && !cputime_error) {
3188 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3189 + // In case there are bad values, 2629743 is the #seconds in a month.
3190 + if (thd->cpu_time > 2629743) {
3191 + thd->cpu_time = 0;
3194 + thd->cpu_time = 0;
3196 + // Updates THD stats and the global user stats.
3197 + thd->update_stats(true);
3198 + update_global_user_stats(thd, true, time(NULL));
3203 @@ -7532,8 +8075,35 @@
3204 pthread_mutex_unlock(&LOCK_active_mi);
3207 - if (options & REFRESH_USER_RESOURCES)
3208 - reset_mqh((LEX_USER *) NULL);
3209 + if (options & REFRESH_TABLE_STATS)
3211 + pthread_mutex_lock(&LOCK_global_table_stats);
3212 + free_global_table_stats();
3213 + init_global_table_stats();
3214 + pthread_mutex_unlock(&LOCK_global_table_stats);
3216 + if (options & REFRESH_INDEX_STATS)
3218 + pthread_mutex_lock(&LOCK_global_index_stats);
3219 + free_global_index_stats();
3220 + init_global_index_stats();
3221 + pthread_mutex_unlock(&LOCK_global_index_stats);
3223 + if (options & (REFRESH_USER_STATS | REFRESH_CLIENT_STATS))
3225 + pthread_mutex_lock(&LOCK_global_user_client_stats);
3226 + if (options & REFRESH_USER_STATS)
3228 + free_global_user_stats();
3229 + init_global_user_stats();
3231 + if (options & REFRESH_CLIENT_STATS)
3233 + free_global_client_stats();
3234 + init_global_client_stats();
3236 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
3238 *write_to_binlog= tmp_write_to_binlog;
3241 diff -r 1ac0113deff5 sql/sql_prepare.cc
3242 --- a/sql/sql_prepare.cc Mon Jun 01 00:35:44 2009 -0700
3243 +++ b/sql/sql_prepare.cc Mon Jun 01 00:36:01 2009 -0700
3245 #include <mysql_com.h>
3248 +// Uses the THD to update the global stats by user name and client IP
3249 +void update_global_user_stats(THD* thd, bool create_user, time_t now);
3251 /* A result class used to send cursor rows using the binary protocol. */
3253 class Select_fetch_protocol_prep: public select_send
3254 @@ -1910,8 +1913,32 @@
3255 /* First of all clear possible warnings from the previous command */
3256 mysql_reset_thd_for_next_command(thd);
3258 + int start_time_error = 0;
3259 + int end_time_error = 0;
3260 + struct timeval start_time, end_time;
3261 + double start_usecs = 0;
3262 + double end_usecs = 0;
3264 + int cputime_error = 0;
3265 + struct timespec tp;
3266 + double start_cpu_nsecs = 0;
3267 + double end_cpu_nsecs = 0;
3269 + if (opt_userstat_running) {
3270 +#ifdef HAVE_CLOCK_GETTIME
3271 + /* get start cputime */
3272 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3273 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3276 + // Gets the start time, in order to measure how long this command takes.
3277 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3278 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3282 if (! (stmt= new Prepared_statement(thd, &thd->protocol_prep)))
3283 - DBUG_VOID_RETURN; /* out of memory: error is set in Sql_alloc */
3284 + goto end; /* out of memory: error is set in Sql_alloc */
3286 if (thd->stmt_map.insert(thd, stmt))
3288 @@ -1919,7 +1946,7 @@
3289 The error is set in the insert. The statement itself
3290 will be also deleted there (this is how the hash works).
3296 /* Reset warnings from previous command */
3297 @@ -1941,6 +1968,44 @@
3298 thd->stmt_map.erase(stmt);
3300 /* check_prepared_statemnt sends the metadata packet in case of success */
3302 + if (opt_userstat_running) {
3303 + // Gets the end time.
3304 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3305 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3308 + // Calculates the difference between the end and start times.
3309 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3310 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3311 + // In case there are bad values, 2629743 is the #seconds in a month.
3312 + if (thd->busy_time > 2629743) {
3313 + thd->busy_time = 0;
3316 + // end time went back in time, or gettimeofday() failed.
3317 + thd->busy_time = 0;
3320 +#ifdef HAVE_CLOCK_GETTIME
3321 + /* get end cputime */
3322 + if (!cputime_error &&
3323 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3324 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3326 + if (start_cpu_nsecs && !cputime_error) {
3327 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3328 + // In case there are bad values, 2629743 is the #seconds in a month.
3329 + if (thd->cpu_time > 2629743) {
3330 + thd->cpu_time = 0;
3333 + thd->cpu_time = 0;
3335 + // Updates THD stats and the global user stats.
3336 + thd->update_stats(true);
3337 + update_global_user_stats(thd, true, time(NULL));
3342 @@ -2281,8 +2346,32 @@
3343 /* First of all clear possible warnings from the previous command */
3344 mysql_reset_thd_for_next_command(thd);
3346 + int start_time_error = 0;
3347 + int end_time_error = 0;
3348 + struct timeval start_time, end_time;
3349 + double start_usecs = 0;
3350 + double end_usecs = 0;
3352 + int cputime_error = 0;
3353 + struct timespec tp;
3354 + double start_cpu_nsecs = 0;
3355 + double end_cpu_nsecs = 0;
3357 + if (opt_userstat_running) {
3358 +#ifdef HAVE_CLOCK_GETTIME
3359 + /* get start cputime */
3360 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3361 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3364 + // Gets the start time, in order to measure how long this command takes.
3365 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3366 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3370 if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_execute")))
3374 #if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
3375 thd->profiling.set_query_source(stmt->query, stmt->query_length);
3376 @@ -2325,11 +2414,50 @@
3377 test(flags & (ulong) CURSOR_TYPE_READ_ONLY));
3378 if (!(specialflag & SPECIAL_NO_PRIOR))
3379 my_pthread_setprio(pthread_self(), WAIT_PRIOR);
3383 set_params_data_err:
3384 my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_stmt_execute");
3385 reset_stmt_params(stmt);
3388 + if (opt_userstat_running) {
3389 + // Gets the end time.
3390 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3391 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3394 + // Calculates the difference between the end and start times.
3395 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3396 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3397 + // In case there are bad values, 2629743 is the #seconds in a month.
3398 + if (thd->busy_time > 2629743) {
3399 + thd->busy_time = 0;
3402 + // end time went back in time, or gettimeofday() failed.
3403 + thd->busy_time = 0;
3406 +#ifdef HAVE_CLOCK_GETTIME
3407 + /* get end cputime */
3408 + if (!cputime_error &&
3409 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3410 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3412 + if (start_cpu_nsecs && !cputime_error) {
3413 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3414 + // In case there are bad values, 2629743 is the #seconds in a month.
3415 + if (thd->cpu_time > 2629743) {
3416 + thd->cpu_time = 0;
3419 + thd->cpu_time = 0;
3421 + // Updates THD stats and the global user stats.
3422 + thd->update_stats(true);
3423 + update_global_user_stats(thd, true, time(NULL));
3428 @@ -2423,6 +2551,31 @@
3430 /* First of all clear possible warnings from the previous command */
3431 mysql_reset_thd_for_next_command(thd);
3433 + int start_time_error = 0;
3434 + int end_time_error = 0;
3435 + struct timeval start_time, end_time;
3436 + double start_usecs = 0;
3437 + double end_usecs = 0;
3439 + int cputime_error = 0;
3440 + struct timespec tp;
3441 + double start_cpu_nsecs = 0;
3442 + double end_cpu_nsecs = 0;
3444 + if (opt_userstat_running) {
3445 +#ifdef HAVE_CLOCK_GETTIME
3446 + /* get start cputime */
3447 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3448 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3451 + // Gets the start time, in order to measure how long this command takes.
3452 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3453 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3457 statistic_increment(thd->status_var.com_stmt_fetch, &LOCK_status);
3458 if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_fetch")))
3460 @@ -2455,6 +2608,43 @@
3461 thd->restore_backup_statement(stmt, &stmt_backup);
3462 thd->stmt_arena= thd;
3464 + if (opt_userstat_running) {
3465 + // Gets the end time.
3466 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3467 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3470 + // Calculates the difference between the end and start times.
3471 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3472 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3473 + // In case there are bad values, 2629743 is the #seconds in a month.
3474 + if (thd->busy_time > 2629743) {
3475 + thd->busy_time = 0;
3478 + // end time went back in time, or gettimeofday() failed.
3479 + thd->busy_time = 0;
3482 +#ifdef HAVE_CLOCK_GETTIME
3483 + /* get end cputime */
3484 + if (!cputime_error &&
3485 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3486 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3488 + if (start_cpu_nsecs && !cputime_error) {
3489 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3490 + // In case there are bad values, 2629743 is the #seconds in a month.
3491 + if (thd->cpu_time > 2629743) {
3492 + thd->cpu_time = 0;
3495 + thd->cpu_time = 0;
3497 + // Updates THD stats and the global user stats.
3498 + thd->update_stats(true);
3499 + update_global_user_stats(thd, true, time(NULL));
3504 @@ -2487,6 +2677,30 @@
3505 /* First of all clear possible warnings from the previous command */
3506 mysql_reset_thd_for_next_command(thd);
3508 + int start_time_error = 0;
3509 + int end_time_error = 0;
3510 + struct timeval start_time, end_time;
3511 + double start_usecs = 0;
3512 + double end_usecs = 0;
3514 + int cputime_error = 0;
3515 + struct timespec tp;
3516 + double start_cpu_nsecs = 0;
3517 + double end_cpu_nsecs = 0;
3519 + if (opt_userstat_running) {
3520 +#ifdef HAVE_CLOCK_GETTIME
3521 + /* get start cputime */
3522 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3523 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3526 + // Gets the start time, in order to measure how long this command takes.
3527 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3528 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3532 statistic_increment(thd->status_var.com_stmt_reset, &LOCK_status);
3533 if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_reset")))
3535 @@ -2503,6 +2717,43 @@
3539 + if (opt_userstat_running) {
3540 + // Gets the end time.
3541 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3542 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3545 + // Calculates the difference between the end and start times.
3546 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3547 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3548 + // In case there are bad values, 2629743 is the #seconds in a month.
3549 + if (thd->busy_time > 2629743) {
3550 + thd->busy_time = 0;
3553 + // end time went back in time, or gettimeofday() failed.
3554 + thd->busy_time = 0;
3557 +#ifdef HAVE_CLOCK_GETTIME
3558 + /* get end cputime */
3559 + if (!cputime_error &&
3560 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3561 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3563 + if (start_cpu_nsecs && !cputime_error) {
3564 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3565 + // In case there are bad values, 2629743 is the #seconds in a month.
3566 + if (thd->cpu_time > 2629743) {
3567 + thd->cpu_time = 0;
3570 + thd->cpu_time = 0;
3572 + // Updates THD stats and the global user stats.
3573 + thd->update_stats(true);
3574 + update_global_user_stats(thd, true, time(NULL));
3579 diff -r 1ac0113deff5 sql/sql_show.cc
3580 --- a/sql/sql_show.cc Mon Jun 01 00:35:44 2009 -0700
3581 +++ b/sql/sql_show.cc Mon Jun 01 00:36:01 2009 -0700
3583 sctx->master_access);
3584 if (!(db_access & DB_ACLS) && (!grant_option || check_grant_db(thd,dbname)))
3586 + thd->diff_access_denied_errors++;
3587 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
3588 sctx->priv_user, sctx->host_or_ip, dbname);
3589 mysql_log.write(thd,COM_INIT_DB,ER(ER_DBACCESS_DENIED_ERROR),
3590 @@ -1890,6 +1891,300 @@
3595 + Aggregate values for mapped_user entries by their role.
3598 + aggregate_user_stats
3599 + all_user_stats - input to aggregate
3600 + agg_user_stats - returns aggregated values
3607 +aggregate_user_stats(HASH *all_user_stats, HASH *agg_user_stats)
3609 + DBUG_ENTER("aggregate_user_stats");
3610 + if (hash_init(agg_user_stats, system_charset_info,
3611 + max(all_user_stats->records, 1),
3612 + 0, 0, (hash_get_key)get_key_user_stats,
3613 + (hash_free_key)free_user_stats, 0))
3615 + sql_print_error("Malloc in aggregate_user_stats failed");
3619 + for (int i = 0; i < all_user_stats->records; ++i) {
3620 + USER_STATS *user = (USER_STATS*)hash_element(all_user_stats, i);
3621 + USER_STATS *agg_user;
3622 + if (!(agg_user = (USER_STATS*)hash_search(agg_user_stats,
3623 + (byte*)user->priv_user,
3624 + strlen(user->priv_user))))
3626 + // First entry for this role.
3628 + (USER_STATS*) my_malloc(sizeof(USER_STATS), MYF(MY_WME | MY_ZEROFILL))))
3630 + sql_print_error("Malloc in aggregate_user_stats failed");
3634 + init_user_stats(agg_user, user->priv_user, user->priv_user,
3635 + user->total_connections, user->concurrent_connections,
3636 + user->connected_time, user->busy_time, user->cpu_time,
3637 + user->bytes_received, user->bytes_sent,
3638 + user->binlog_bytes_written,
3639 + user->rows_fetched, user->rows_updated, user->rows_read,
3640 + user->select_commands, user->update_commands,
3641 + user->other_commands,
3642 + user->commit_trans, user->rollback_trans,
3643 + user->denied_connections, user->lost_connections,
3644 + user->access_denied_errors, user->empty_queries);
3646 + if (my_hash_insert(agg_user_stats, (byte*)agg_user))
3649 + my_free((char*)agg_user, 0);
3650 + sql_print_error("Malloc in aggregate_user_stats failed");
3656 + // Aggregate with existing values for this role.
3657 + add_user_stats(agg_user,
3658 + user->total_connections, user->concurrent_connections,
3659 + user->connected_time, user->busy_time, user->cpu_time,
3660 + user->bytes_received, user->bytes_sent,
3661 + user->binlog_bytes_written,
3662 + user->rows_fetched, user->rows_updated, user->rows_read,
3663 + user->select_commands, user->update_commands,
3664 + user->other_commands,
3665 + user->commit_trans, user->rollback_trans,
3666 + user->denied_connections, user->lost_connections,
3667 + user->access_denied_errors, user->empty_queries);
3670 + DBUG_PRINT("exit", ("aggregated %d input into %d output entries",
3671 + all_user_stats->records, agg_user_stats->records));
3676 + Write result to network for SHOW USER_STATISTICS
3680 + all_user_stats - values to return
3687 +int send_user_stats(THD* thd, HASH *all_user_stats, TABLE *table)
3689 + DBUG_ENTER("send_user_stats");
3690 + for (int i = 0; i < all_user_stats->records; ++i) {
3691 + restore_record(table, s->default_values);
3692 + USER_STATS *user_stats = (USER_STATS*)hash_element(all_user_stats, i);
3693 + table->field[0]->store(user_stats->user, strlen(user_stats->user), system_charset_info);
3694 + table->field[1]->store((longlong)user_stats->total_connections);
3695 + table->field[2]->store((longlong)user_stats->concurrent_connections);
3696 + table->field[3]->store((longlong)user_stats->connected_time);
3697 + table->field[4]->store((longlong)user_stats->busy_time);
3698 + table->field[5]->store((longlong)user_stats->cpu_time);
3699 + table->field[6]->store((longlong)user_stats->bytes_received);
3700 + table->field[7]->store((longlong)user_stats->bytes_sent);
3701 + table->field[8]->store((longlong)user_stats->binlog_bytes_written);
3702 + table->field[9]->store((longlong)user_stats->rows_fetched);
3703 + table->field[10]->store((longlong)user_stats->rows_updated);
3704 + table->field[11]->store((longlong)user_stats->rows_read);
3705 + table->field[12]->store((longlong)user_stats->select_commands);
3706 + table->field[13]->store((longlong)user_stats->update_commands);
3707 + table->field[14]->store((longlong)user_stats->other_commands);
3708 + table->field[15]->store((longlong)user_stats->commit_trans);
3709 + table->field[16]->store((longlong)user_stats->rollback_trans);
3710 + table->field[17]->store((longlong)user_stats->denied_connections);
3711 + table->field[18]->store((longlong)user_stats->lost_connections);
3712 + table->field[19]->store((longlong)user_stats->access_denied_errors);
3713 + table->field[20]->store((longlong)user_stats->empty_queries);
3714 + if (schema_table_store_record(thd, table))
3716 + DBUG_PRINT("error", ("store record error"));
3724 + Process SHOW USER_STATISTICS
3727 + mysqld_show_user_stats
3728 + thd - current thread
3729 + wild - limit results to the entry for this user
3730 + with_roles - when true, display role for mapped users
3738 +int fill_schema_user_stats(THD* thd, TABLE_LIST* tables, COND* cond)
3740 + TABLE *table= tables->table;
3741 + DBUG_ENTER("fill_schema_user_stats");
3743 + if (check_global_access(thd, SUPER_ACL | PROCESS_ACL))
3746 + // Iterates through all the global stats and sends them to the client.
3747 + // Pattern matching on the client IP is supported.
3749 + pthread_mutex_lock(&LOCK_global_user_client_stats);
3750 + int result= send_user_stats(thd, &global_user_stats, table);
3751 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
3755 + DBUG_PRINT("exit", ("fill_schema_user_stats result is 0"));
3759 + DBUG_PRINT("exit", ("fill_schema_user_stats result is 1"));
3764 + Process SHOW CLIENT_STATISTICS
3767 + mysqld_show_client_stats
3768 + thd - current thread
3769 + wild - limit results to the entry for this client
3777 +int fill_schema_client_stats(THD* thd, TABLE_LIST* tables, COND* cond)
3779 + TABLE *table= tables->table;
3780 + DBUG_ENTER("fill_schema_client_stats");
3782 + if (check_global_access(thd, SUPER_ACL | PROCESS_ACL))
3785 + // Iterates through all the global stats and sends them to the client.
3786 + // Pattern matching on the client IP is supported.
3788 + pthread_mutex_lock(&LOCK_global_user_client_stats);
3789 + int result= send_user_stats(thd, &global_client_stats, table);
3790 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
3794 + DBUG_PRINT("exit", ("mysqld_show_client_stats result is 0"));
3798 + DBUG_PRINT("exit", ("mysqld_show_client_stats result is 1"));
3803 +// Sends the global table stats back to the client.
3804 +int fill_schema_table_stats(THD* thd, TABLE_LIST* tables, COND* cond)
3806 + TABLE *table= tables->table;
3807 + DBUG_ENTER("fill_schema_table_stats");
3808 + char *table_full_name, *table_schema;
3810 + pthread_mutex_lock(&LOCK_global_table_stats);
3811 + for (int i = 0; i < global_table_stats.records; ++i) {
3812 + restore_record(table, s->default_values);
3813 + TABLE_STATS *table_stats =
3814 + (TABLE_STATS*)hash_element(&global_table_stats, i);
3816 + table_full_name= thd->strdup(table_stats->table);
3817 + table_schema= strsep(&table_full_name, ".");
3819 + TABLE_LIST tmp_table;
3820 + bzero((char*) &tmp_table,sizeof(tmp_table));
3821 + tmp_table.table_name= table_full_name;
3822 + tmp_table.db= table_schema;
3823 + tmp_table.grant.privilege= 0;
3824 + if (check_access(thd, SELECT_ACL | EXTRA_ACL, tmp_table.db,
3825 + &tmp_table.grant.privilege, 0, 0,
3826 + is_schema_db(table_schema)) ||
3827 + grant_option && check_grant(thd, SELECT_ACL, &tmp_table, 1, UINT_MAX, 1))
3830 + table->field[0]->store(table_schema, strlen(table_schema), system_charset_info);
3831 + table->field[1]->store(table_full_name, strlen(table_full_name), system_charset_info);
3832 + table->field[2]->store((longlong)table_stats->rows_read, TRUE);
3833 + table->field[3]->store((longlong)table_stats->rows_changed, TRUE);
3834 + table->field[4]->store((longlong)table_stats->rows_changed_x_indexes, TRUE);
3836 + if (schema_table_store_record(thd, table))
3838 + VOID(pthread_mutex_unlock(&LOCK_global_table_stats));
3842 + pthread_mutex_unlock(&LOCK_global_table_stats);
3846 +// Sends the global index stats back to the client.
3847 +int fill_schema_index_stats(THD* thd, TABLE_LIST* tables, COND* cond)
3849 + TABLE *table= tables->table;
3850 + DBUG_ENTER("fill_schema_index_stats");
3851 + char *index_full_name, *table_schema, *table_name;
3853 + pthread_mutex_lock(&LOCK_global_index_stats);
3854 + for (int i = 0; i < global_index_stats.records; ++i) {
3855 + restore_record(table, s->default_values);
3856 + INDEX_STATS *index_stats =
3857 + (INDEX_STATS*)hash_element(&global_index_stats, i);
3859 + index_full_name= thd->strdup(index_stats->index);
3860 + table_schema= strsep(&index_full_name, ".");
3861 + table_name= strsep(&index_full_name, ".");
3863 + TABLE_LIST tmp_table;
3864 + bzero((char*) &tmp_table,sizeof(tmp_table));
3865 + tmp_table.table_name= table_name;
3866 + tmp_table.db= table_schema;
3867 + tmp_table.grant.privilege= 0;
3868 + if (check_access(thd, SELECT_ACL | EXTRA_ACL, tmp_table.db,
3869 + &tmp_table.grant.privilege, 0, 0,
3870 + is_schema_db(table_schema)) ||
3871 + grant_option && check_grant(thd, SELECT_ACL, &tmp_table, 1, UINT_MAX, 1))
3874 + table->field[0]->store(table_schema, strlen(table_schema), system_charset_info);
3875 + table->field[1]->store(table_name, strlen(table_name), system_charset_info);
3876 + table->field[2]->store(index_full_name, strlen(index_full_name), system_charset_info);
3877 + table->field[3]->store((longlong)index_stats->rows_read, TRUE);
3879 + if (schema_table_store_record(thd, table))
3881 + VOID(pthread_mutex_unlock(&LOCK_global_index_stats));
3885 + pthread_mutex_unlock(&LOCK_global_index_stats);
3889 /* collect status for all running threads */
3891 @@ -4500,6 +4795,77 @@
3892 {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3895 +ST_FIELD_INFO user_stats_fields_info[]=
3897 + {"USER", 16, MYSQL_TYPE_STRING, 0, 0, "User"},
3898 + {"TOTAL_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Total_connections"},
3899 + {"CONCURRENT_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Concurrent_connections"},
3900 + {"CONNECTED_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Connected_time"},
3901 + {"BUSY_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Busy_time"},
3902 + {"CPU_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Cpu_time"},
3903 + {"BYTES_RECEIVED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_received"},
3904 + {"BYTES_SENT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_sent"},
3905 + {"BINLOG_BYTES_WRITTEN", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Binlog_bytes_written"},
3906 + {"ROWS_FETCHED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_fetched"},
3907 + {"ROWS_UPDATED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_updated"},
3908 + {"TABLE_ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Table_rows_read"},
3909 + {"SELECT_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Select_commands"},
3910 + {"UPDATE_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Update_commands"},
3911 + {"OTHER_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Other_commands"},
3912 + {"COMMIT_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Commit_transactions"},
3913 + {"ROLLBACK_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rollback_transactions"},
3914 + {"DENIED_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Denied_connections"},
3915 + {"LOST_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Lost_connections"},
3916 + {"ACCESS_DENIED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Access_denied"},
3917 + {"EMPTY_QUERIES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Empty_queries"},
3918 + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3921 +ST_FIELD_INFO client_stats_fields_info[]=
3923 + {"CLIENT", 16, MYSQL_TYPE_STRING, 0, 0, "Client"},
3924 + {"TOTAL_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Total_connections"},
3925 + {"CONCURRENT_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Concurrent_connections"},
3926 + {"CONNECTED_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Connected_time"},
3927 + {"BUSY_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Busy_time"},
3928 + {"CPU_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Cpu_time"},
3929 + {"BYTES_RECEIVED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_received"},
3930 + {"BYTES_SENT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_sent"},
3931 + {"BINLOG_BYTES_WRITTEN", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Binlog_bytes_written"},
3932 + {"ROWS_FETCHED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_fetched"},
3933 + {"ROWS_UPDATED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_updated"},
3934 + {"TABLE_ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Table_rows_read"},
3935 + {"SELECT_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Select_commands"},
3936 + {"UPDATE_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Update_commands"},
3937 + {"OTHER_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Other_commands"},
3938 + {"COMMIT_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Commit_transactions"},
3939 + {"ROLLBACK_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rollback_transactions"},
3940 + {"DENIED_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Denied_connections"},
3941 + {"LOST_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Lost_connections"},
3942 + {"ACCESS_DENIED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Access_denied"},
3943 + {"EMPTY_QUERIES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Empty_queries"},
3944 + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3948 +ST_FIELD_INFO table_stats_fields_info[]=
3950 + {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_schema"},
3951 + {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_name"},
3952 + {"ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_read"},
3953 + {"ROWS_CHANGED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_changed"},
3954 + {"ROWS_CHANGED_X_INDEXES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_changed_x_#indexes"},
3955 + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3958 +ST_FIELD_INFO index_stats_fields_info[]=
3960 + {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_schema"},
3961 + {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_name"},
3962 + {"INDEX_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Index_name"},
3963 + {"ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_read"},
3964 + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3968 Description of ST_FIELD_INFO in table.h
3969 @@ -4509,6 +4875,8 @@
3971 {"CHARACTER_SETS", charsets_fields_info, create_schema_table,
3972 fill_schema_charsets, make_character_sets_old_format, 0, -1, -1, 0},
3973 + {"CLIENT_STATISTICS", client_stats_fields_info, create_schema_table,
3974 + fill_schema_client_stats, make_old_format, 0, -1, -1, 0},
3975 {"COLLATIONS", collation_fields_info, create_schema_table,
3976 fill_schema_collation, make_old_format, 0, -1, -1, 0},
3977 {"COLLATION_CHARACTER_SET_APPLICABILITY", coll_charset_app_fields_info,
3978 @@ -4517,6 +4885,8 @@
3979 get_all_tables, make_columns_old_format, get_schema_column_record, 1, 2, 0},
3980 {"COLUMN_PRIVILEGES", column_privileges_fields_info, create_schema_table,
3981 fill_schema_column_privileges, 0, 0, -1, -1, 0},
3982 + {"INDEX_STATISTICS", index_stats_fields_info, create_schema_table,
3983 + fill_schema_index_stats, make_old_format, 0, -1, -1, 0},
3984 {"KEY_COLUMN_USAGE", key_column_usage_fields_info, create_schema_table,
3985 get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0},
3986 {"OPEN_TABLES", open_tables_fields_info, create_schema_table,
3987 @@ -4542,10 +4912,14 @@
3988 get_all_tables, make_table_names_old_format, 0, 1, 2, 1},
3989 {"TABLE_PRIVILEGES", table_privileges_fields_info, create_schema_table,
3990 fill_schema_table_privileges, 0, 0, -1, -1, 0},
3991 + {"TABLE_STATISTICS", table_stats_fields_info, create_schema_table,
3992 + fill_schema_table_stats, make_old_format, 0, -1, -1, 0},
3993 {"TRIGGERS", triggers_fields_info, create_schema_table,
3994 get_all_tables, make_old_format, get_schema_triggers_record, 5, 6, 0},
3995 {"USER_PRIVILEGES", user_privileges_fields_info, create_schema_table,
3996 fill_schema_user_privileges, 0, 0, -1, -1, 0},
3997 + {"USER_STATISTICS", user_stats_fields_info, create_schema_table,
3998 + fill_schema_user_stats, make_old_format, 0, -1, -1, 0},
3999 {"VARIABLES", variables_fields_info, create_schema_table, fill_variables,
4000 make_old_format, 0, -1, -1, 1},
4001 {"VIEWS", view_fields_info, create_schema_table,
4002 diff -r 1ac0113deff5 sql/sql_update.cc
4003 --- a/sql/sql_update.cc Mon Jun 01 00:35:44 2009 -0700
4004 +++ b/sql/sql_update.cc Mon Jun 01 00:36:01 2009 -0700
4006 (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
4007 send_ok(thd, (ulong) thd->row_count_func,
4008 thd->insert_id_used ? thd->last_insert_id : 0L,buff);
4009 - DBUG_PRINT("info",("%ld records updated", (long) updated));
4010 + thd->updated_row_count += thd->row_count_func;
4011 + DBUG_PRINT("info",("%d records updated",updated));
4013 thd->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */
4014 thd->abort_on_warning= 0;
4015 @@ -1835,5 +1836,6 @@
4016 (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
4017 ::send_ok(thd, (ulong) thd->row_count_func,
4018 thd->insert_id_used ? thd->last_insert_id : 0L,buff);
4019 + thd->updated_row_count += thd->row_count_func;
4022 diff -r 1ac0113deff5 sql/sql_yacc.yy
4023 --- a/sql/sql_yacc.yy Mon Jun 01 00:35:44 2009 -0700
4024 +++ b/sql/sql_yacc.yy Mon Jun 01 00:36:01 2009 -0700
4029 +%token CLIENT_STATS_SYM
4037 +%token INDEX_STATS_SYM
4053 +%token TABLE_STATS_SYM
4055 %token TEMPTABLE_SYM
4061 +%token USER_STATS_SYM
4065 @@ -8255,6 +8260,38 @@
4067 Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
4069 + | CLIENT_STATS_SYM wild_and_where
4072 + Lex->sql_command = SQLCOM_SELECT;
4073 + lex->orig_sql_command= SQLCOM_SHOW_CLIENT_STATS;
4074 + if (prepare_schema_table(YYTHD, lex, 0, SCH_CLIENT_STATS))
4077 + | USER_STATS_SYM wild_and_where
4080 + lex->sql_command = SQLCOM_SELECT;
4081 + lex->orig_sql_command= SQLCOM_SHOW_USER_STATS;
4082 + if (prepare_schema_table(YYTHD, lex, 0, SCH_USER_STATS))
4085 + | TABLE_STATS_SYM wild_and_where
4088 + lex->sql_command= SQLCOM_SELECT;
4089 + lex->orig_sql_command= SQLCOM_SHOW_TABLE_STATS;
4090 + if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_STATS))
4093 + | INDEX_STATS_SYM wild_and_where
4096 + lex->sql_command= SQLCOM_SELECT;
4097 + lex->orig_sql_command= SQLCOM_SHOW_INDEX_STATS;
4098 + if (prepare_schema_table(YYTHD, lex, 0, SCH_INDEX_STATS))
4101 | CREATE PROCEDURE sp_name
4104 @@ -8459,9 +8496,14 @@
4105 | LOGS_SYM { Lex->type|= REFRESH_LOG; }
4106 | STATUS_SYM { Lex->type|= REFRESH_STATUS; }
4107 | SLAVE { Lex->type|= REFRESH_SLAVE; }
4108 + | SLOW_SYM QUERY_SYM LOGS_SYM { Lex->type |= REFRESH_SLOW_QUERY_LOG; }
4109 | MASTER_SYM { Lex->type|= REFRESH_MASTER; }
4110 | DES_KEY_FILE { Lex->type|= REFRESH_DES_KEY_FILE; }
4111 - | RESOURCES { Lex->type|= REFRESH_USER_RESOURCES; };
4112 + | RESOURCES { Lex->type|= REFRESH_USER_RESOURCES; }
4113 + | CLIENT_STATS_SYM { Lex->type|= REFRESH_CLIENT_STATS; }
4114 + | USER_STATS_SYM { Lex->type|= REFRESH_USER_STATS; }
4115 + | TABLE_STATS_SYM { Lex->type|= REFRESH_TABLE_STATS; }
4116 + | INDEX_STATS_SYM { Lex->type|= REFRESH_INDEX_STATS; };
4120 @@ -9450,6 +9492,7 @@
4124 + | CLIENT_STATS_SYM {}
4128 @@ -9502,6 +9545,7 @@
4132 + | INDEX_STATS_SYM {}
4136 @@ -9611,6 +9655,7 @@
4144 @@ -9627,6 +9672,7 @@
4148 + | TABLE_STATS_SYM {}
4152 @@ -9647,6 +9693,7 @@
4156 + | USER_STATS_SYM {}
4160 diff -r 1ac0113deff5 sql/structs.h
4161 --- a/sql/structs.h Mon Jun 01 00:35:44 2009 -0700
4162 +++ b/sql/structs.h Mon Jun 01 00:36:01 2009 -0700
4163 @@ -273,6 +273,98 @@
4167 +typedef struct st_user_stats {
4168 + char user[USERNAME_LENGTH + 1];
4169 + // Account name the user is mapped to when this is a user from mapped_user.
4170 + // Otherwise, the same value as user.
4171 + char priv_user[USERNAME_LENGTH + 1];
4172 + uint total_connections;
4173 + uint concurrent_connections;
4174 + time_t connected_time; // in seconds
4175 + double busy_time; // in seconds
4176 + double cpu_time; // in seconds
4177 + ulonglong bytes_received;
4178 + ulonglong bytes_sent;
4179 + ulonglong binlog_bytes_written;
4180 + ha_rows rows_fetched, rows_updated, rows_read;
4181 + ulonglong select_commands, update_commands, other_commands;
4182 + ulonglong commit_trans, rollback_trans;
4183 + ulonglong denied_connections, lost_connections;
4184 + ulonglong access_denied_errors;
4185 + ulonglong empty_queries;
4188 +/* Lookup function for hash tables with USER_STATS entries */
4189 +extern byte *get_key_user_stats(USER_STATS *user_stats, uint *length,
4190 + my_bool not_used __attribute__((unused)));
4192 +/* Free all memory for a hash table with USER_STATS entries */
4193 +extern void free_user_stats(USER_STATS* user_stats);
4195 +/* Intialize an instance of USER_STATS */
4197 +init_user_stats(USER_STATS *user_stats,
4199 + const char *priv_user,
4200 + uint total_connections,
4201 + uint concurrent_connections,
4202 + time_t connected_time,
4205 + ulonglong bytes_received,
4206 + ulonglong bytes_sent,
4207 + ulonglong binlog_bytes_written,
4208 + ha_rows rows_fetched,
4209 + ha_rows rows_updated,
4210 + ha_rows rows_read,
4211 + ulonglong select_commands,
4212 + ulonglong update_commands,
4213 + ulonglong other_commands,
4214 + ulonglong commit_trans,
4215 + ulonglong rollback_trans,
4216 + ulonglong denied_connections,
4217 + ulonglong lost_connections,
4218 + ulonglong access_denied_errors,
4219 + ulonglong empty_queries);
4221 +/* Increment values of an instance of USER_STATS */
4223 +add_user_stats(USER_STATS *user_stats,
4224 + uint total_connections,
4225 + uint concurrent_connections,
4226 + time_t connected_time,
4229 + ulonglong bytes_received,
4230 + ulonglong bytes_sent,
4231 + ulonglong binlog_bytes_written,
4232 + ha_rows rows_fetched,
4233 + ha_rows rows_updated,
4234 + ha_rows rows_read,
4235 + ulonglong select_commands,
4236 + ulonglong update_commands,
4237 + ulonglong other_commands,
4238 + ulonglong commit_trans,
4239 + ulonglong rollback_trans,
4240 + ulonglong denied_connections,
4241 + ulonglong lost_connections,
4242 + ulonglong access_denied_errors,
4243 + ulonglong empty_queries);
4245 +typedef struct st_table_stats {
4246 + char table[NAME_LEN * 2 + 2]; // [db] + '.' + [table] + '\0'
4247 + ulonglong rows_read, rows_changed;
4248 + ulonglong rows_changed_x_indexes;
4249 + /* Stores enum db_type, but forward declarations cannot be done */
4253 +typedef struct st_index_stats {
4254 + char index[NAME_LEN * 3 + 3]; // [db] + '.' + [table] + '.' + [index] + '\0'
4255 + ulonglong rows_read;
4259 /* Bits in form->update */
4260 #define REG_MAKE_DUPP 1 /* Make a copy of record when read */
4261 #define REG_NEW_RECORD 2 /* Write a new record if not found */
4262 diff -r 1ac0113deff5 sql/table.h
4263 --- a/sql/table.h Mon Jun 01 00:35:44 2009 -0700
4264 +++ b/sql/table.h Mon Jun 01 00:36:01 2009 -0700
4265 @@ -371,10 +371,12 @@
4266 enum enum_schema_tables
4271 SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
4273 SCH_COLUMN_PRIVILEGES,
4275 SCH_KEY_COLUMN_USAGE,
4278 @@ -387,8 +389,10 @@
4279 SCH_TABLE_CONSTRAINTS,
4281 SCH_TABLE_PRIVILEGES,
4284 SCH_USER_PRIVILEGES,
4289 diff -r 1ac0113deff5 strings/Makefile.in
4290 --- a/strings/Makefile.in Mon Jun 01 00:35:44 2009 -0700
4291 +++ b/strings/Makefile.in Mon Jun 01 00:36:01 2009 -0700
4294 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4299 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4300 diff -r 1ac0113deff5 support-files/MacOSX/Makefile.in
4301 --- a/support-files/MacOSX/Makefile.in Mon Jun 01 00:35:44 2009 -0700
4302 +++ b/support-files/MacOSX/Makefile.in Mon Jun 01 00:36:01 2009 -0700
4305 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4310 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4311 diff -r 1ac0113deff5 support-files/Makefile.in
4312 --- a/support-files/Makefile.in Mon Jun 01 00:35:44 2009 -0700
4313 +++ b/support-files/Makefile.in Mon Jun 01 00:36:01 2009 -0700
4316 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4321 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4322 diff -r 1ac0113deff5 support-files/RHEL4-SElinux/Makefile.in
4323 --- a/support-files/RHEL4-SElinux/Makefile.in Mon Jun 01 00:35:44 2009 -0700
4324 +++ b/support-files/RHEL4-SElinux/Makefile.in Mon Jun 01 00:36:01 2009 -0700
4327 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4332 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4333 diff -r 1ac0113deff5 tests/Makefile.in
4334 --- a/tests/Makefile.in Mon Jun 01 00:35:44 2009 -0700
4335 +++ b/tests/Makefile.in Mon Jun 01 00:36:01 2009 -0700
4338 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4341 LIBS = @CLIENT_LIBS@
4343 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4344 diff -r 1ac0113deff5 tools/Makefile.in
4345 --- a/tools/Makefile.in Mon Jun 01 00:35:44 2009 -0700
4346 +++ b/tools/Makefile.in Mon Jun 01 00:36:01 2009 -0700
4349 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4354 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4355 diff -r 1ac0113deff5 vio/Makefile.in
4356 --- a/vio/Makefile.in Mon Jun 01 00:35:44 2009 -0700
4357 +++ b/vio/Makefile.in Mon Jun 01 00:36:01 2009 -0700
4360 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4365 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4366 diff -r 1ac0113deff5 win/Makefile.in
4367 --- a/win/Makefile.in Mon Jun 01 00:35:44 2009 -0700
4368 +++ b/win/Makefile.in Mon Jun 01 00:36:01 2009 -0700
4371 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4376 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4377 diff -r 1ac0113deff5 zlib/Makefile.in
4378 --- a/zlib/Makefile.in Mon Jun 01 00:35:44 2009 -0700
4379 +++ b/zlib/Makefile.in Mon Jun 01 00:36:01 2009 -0700
4382 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4385 LIBS = $(NON_THREADED_LIBS)
4387 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@