1 diff -r 23e5576aa59a BUILD/Makefile.in
2 --- a/BUILD/Makefile.in Tue Feb 17 22:33:00 2009 -0800
3 +++ b/BUILD/Makefile.in Tue Feb 17 22:33:23 2009 -0800
6 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
11 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
12 diff -r 23e5576aa59a Docs/Makefile.in
13 --- a/Docs/Makefile.in Tue Feb 17 22:33:00 2009 -0800
14 +++ b/Docs/Makefile.in Tue Feb 17 22:33:23 2009 -0800
17 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
22 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
23 diff -r 23e5576aa59a Makefile.in
24 --- a/Makefile.in Tue Feb 17 22:33:00 2009 -0800
25 +++ b/Makefile.in Tue Feb 17 22:33:23 2009 -0800
28 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
33 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
34 diff -r 23e5576aa59a SSL/Makefile.in
35 --- a/SSL/Makefile.in Tue Feb 17 22:33:00 2009 -0800
36 +++ b/SSL/Makefile.in Tue Feb 17 22:33:23 2009 -0800
39 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
44 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
45 diff -r 23e5576aa59a aclocal.m4
46 --- a/aclocal.m4 Tue Feb 17 22:33:00 2009 -0800
47 +++ b/aclocal.m4 Tue Feb 17 22:33:23 2009 -0800
49 # Is the compiler the GNU C compiler?
50 with_gcc=$_LT_AC_TAGVAR(GCC, $1)
52 +gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
53 +gcc_ver=\`gcc -dumpversion\`
58 @@ -4545,11 +4548,11 @@
60 # Dependencies to place before the objects being linked to create a
62 -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
63 +predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
65 # Dependencies to place after the objects being linked to create a
67 -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
68 +postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
70 # Dependencies to place before the objects being linked to create a
74 # The library search path used internally by the compiler when linking
76 -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
77 +compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
79 # Method to check whether dependent libraries are shared objects.
80 deplibs_check_method=$lt_deplibs_check_method
82 link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
84 # Compile-time system search path for libraries
85 -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
86 +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
88 # Run-time system search path for libraries
89 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
90 diff -r 23e5576aa59a client/Makefile.in
91 --- a/client/Makefile.in Tue Feb 17 22:33:00 2009 -0800
92 +++ b/client/Makefile.in Tue Feb 17 22:33:23 2009 -0800
95 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
100 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
101 diff -r 23e5576aa59a cmd-line-utils/Makefile.in
102 --- a/cmd-line-utils/Makefile.in Tue Feb 17 22:33:00 2009 -0800
103 +++ b/cmd-line-utils/Makefile.in Tue Feb 17 22:33:23 2009 -0800
106 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
111 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
112 diff -r 23e5576aa59a cmd-line-utils/libedit/Makefile.in
113 --- a/cmd-line-utils/libedit/Makefile.in Tue Feb 17 22:33:00 2009 -0800
114 +++ b/cmd-line-utils/libedit/Makefile.in Tue Feb 17 22:33:23 2009 -0800
117 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
122 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
123 diff -r 23e5576aa59a cmd-line-utils/readline/Makefile.in
124 --- a/cmd-line-utils/readline/Makefile.in Tue Feb 17 22:33:00 2009 -0800
125 +++ b/cmd-line-utils/readline/Makefile.in Tue Feb 17 22:33:23 2009 -0800
128 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
133 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
134 diff -r 23e5576aa59a configure
135 --- a/configure Tue Feb 17 22:33:00 2009 -0800
136 +++ b/configure Tue Feb 17 22:33:23 2009 -0800
137 @@ -39583,7 +39583,91 @@
138 # We also disable for SCO for the time being, the headers for the
139 # thread library we use conflicts with other headers.
143 + # most systems require the program be linked with librt library to use
144 + # the function clock_gettime
145 + my_save_LIBS="$LIBS"
148 +echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5
149 +echo $ECHO_N "checking for clock_gettime in -lrt... $ECHO_C" >&6
150 +if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then
151 + echo $ECHO_N "(cached) $ECHO_C" >&6
153 + ac_check_lib_save_LIBS=$LIBS
155 +cat >conftest.$ac_ext <<_ACEOF
158 +cat confdefs.h >>conftest.$ac_ext
159 +cat >>conftest.$ac_ext <<_ACEOF
160 +/* end confdefs.h. */
162 +/* Override any gcc2 internal prototype to avoid an error. */
166 +/* We use char because int might match the return type of a gcc2
167 + builtin and then its argument prototype would still apply. */
168 +char clock_gettime ();
177 +rm -f conftest.$ac_objext conftest$ac_exeext
178 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
179 + (eval $ac_link) 2>conftest.er1
181 + grep -v '^ *+' conftest.er1 >conftest.err
183 + cat conftest.err >&5
184 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
185 + (exit $ac_status); } &&
186 + { ac_try='test -z "$ac_c_werror_flag"
187 + || test ! -s conftest.err'
188 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
189 + (eval $ac_try) 2>&5
191 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
192 + (exit $ac_status); }; } &&
193 + { ac_try='test -s conftest$ac_exeext'
194 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
195 + (eval $ac_try) 2>&5
197 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
198 + (exit $ac_status); }; }; then
199 + ac_cv_lib_rt_clock_gettime=yes
201 + echo "$as_me: failed program was:" >&5
202 +sed 's/^/| /' conftest.$ac_ext >&5
204 +ac_cv_lib_rt_clock_gettime=no
206 +rm -f conftest.err conftest.$ac_objext \
207 + conftest$ac_exeext conftest.$ac_ext
208 +LIBS=$ac_check_lib_save_LIBS
210 +echo "$as_me:$LINENO: result: $ac_cv_lib_rt_clock_gettime" >&5
211 +echo "${ECHO_T}$ac_cv_lib_rt_clock_gettime" >&6
212 +if test $ac_cv_lib_rt_clock_gettime = yes; then
213 + cat >>confdefs.h <<_ACEOF
214 +#define HAVE_LIBRT 1
222 + LIBS="$my_save_LIBS"
225 + LIBS="$LIBS $LIBRT"
227 for ac_func in clock_gettime
229 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
230 @@ -42956,7 +43040,7 @@
234 -CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS"
235 +CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS $LIBRT"
239 diff -r 23e5576aa59a configure.in
240 --- a/configure.in Tue Feb 17 22:33:00 2009 -0800
241 +++ b/configure.in Tue Feb 17 22:33:23 2009 -0800
242 @@ -2098,7 +2098,18 @@
243 # We also disable for SCO for the time being, the headers for the
244 # thread library we use conflicts with other headers.
246 - *) AC_CHECK_FUNCS(clock_gettime)
248 + # most systems require the program be linked with librt library to use
249 + # the function clock_gettime
250 + my_save_LIBS="$LIBS"
252 + AC_CHECK_LIB(rt,clock_gettime)
254 + LIBS="$my_save_LIBS"
257 + LIBS="$LIBS $LIBRT"
258 + AC_CHECK_FUNCS(clock_gettime)
262 @@ -2713,7 +2724,7 @@
263 AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe])
266 -CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS"
267 +CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS $LIBRT"
269 AC_SUBST(CLIENT_LIBS)
270 AC_SUBST(NON_THREADED_LIBS)
271 diff -r 23e5576aa59a dbug/Makefile.in
272 --- a/dbug/Makefile.in Tue Feb 17 22:33:00 2009 -0800
273 +++ b/dbug/Makefile.in Tue Feb 17 22:33:23 2009 -0800
276 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
281 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
282 diff -r 23e5576aa59a extra/Makefile.in
283 --- a/extra/Makefile.in Tue Feb 17 22:33:00 2009 -0800
284 +++ b/extra/Makefile.in Tue Feb 17 22:33:23 2009 -0800
287 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
292 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
293 diff -r 23e5576aa59a extra/yassl/Makefile.in
294 --- a/extra/yassl/Makefile.in Tue Feb 17 22:33:00 2009 -0800
295 +++ b/extra/yassl/Makefile.in Tue Feb 17 22:33:23 2009 -0800
298 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
303 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
304 diff -r 23e5576aa59a extra/yassl/src/Makefile.in
305 --- a/extra/yassl/src/Makefile.in Tue Feb 17 22:33:00 2009 -0800
306 +++ b/extra/yassl/src/Makefile.in Tue Feb 17 22:33:23 2009 -0800
309 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
314 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
315 diff -r 23e5576aa59a extra/yassl/taocrypt/Makefile.in
316 --- a/extra/yassl/taocrypt/Makefile.in Tue Feb 17 22:33:00 2009 -0800
317 +++ b/extra/yassl/taocrypt/Makefile.in Tue Feb 17 22:33:23 2009 -0800
320 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
325 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
326 diff -r 23e5576aa59a extra/yassl/taocrypt/benchmark/Makefile.in
327 --- a/extra/yassl/taocrypt/benchmark/Makefile.in Tue Feb 17 22:33:00 2009 -0800
328 +++ b/extra/yassl/taocrypt/benchmark/Makefile.in Tue Feb 17 22:33:23 2009 -0800
331 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
336 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
337 diff -r 23e5576aa59a extra/yassl/taocrypt/src/Makefile.in
338 --- a/extra/yassl/taocrypt/src/Makefile.in Tue Feb 17 22:33:00 2009 -0800
339 +++ b/extra/yassl/taocrypt/src/Makefile.in Tue Feb 17 22:33:23 2009 -0800
342 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
347 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
348 diff -r 23e5576aa59a extra/yassl/taocrypt/test/Makefile.in
349 --- a/extra/yassl/taocrypt/test/Makefile.in Tue Feb 17 22:33:00 2009 -0800
350 +++ b/extra/yassl/taocrypt/test/Makefile.in Tue Feb 17 22:33:23 2009 -0800
353 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
358 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
359 diff -r 23e5576aa59a extra/yassl/testsuite/Makefile.in
360 --- a/extra/yassl/testsuite/Makefile.in Tue Feb 17 22:33:00 2009 -0800
361 +++ b/extra/yassl/testsuite/Makefile.in Tue Feb 17 22:33:23 2009 -0800
364 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
369 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
370 diff -r 23e5576aa59a heap/Makefile.in
371 --- a/heap/Makefile.in Tue Feb 17 22:33:00 2009 -0800
372 +++ b/heap/Makefile.in Tue Feb 17 22:33:23 2009 -0800
375 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
380 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
381 diff -r 23e5576aa59a include/Makefile.in
382 --- a/include/Makefile.in Tue Feb 17 22:33:00 2009 -0800
383 +++ b/include/Makefile.in Tue Feb 17 22:33:23 2009 -0800
386 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
391 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
392 diff -r 23e5576aa59a include/mysql_com.h
393 --- a/include/mysql_com.h Tue Feb 17 22:33:00 2009 -0800
394 +++ b/include/mysql_com.h Tue Feb 17 22:33:23 2009 -0800
397 #define REFRESH_MASTER 128 /* Remove all bin logs in the index
398 and truncate the index */
399 +#define REFRESH_TABLE_STATS 256 /* Refresh table stats hash table */
400 +#define REFRESH_INDEX_STATS 512 /* Refresh index stats hash table */
401 +#define REFRESH_USER_STATS 1024 /* Refresh user stats hash table */
402 +#define REFRESH_SLOW_QUERY_LOG 4096 /* Flush slow query log and rotate*/
403 +#define REFRESH_CLIENT_STATS 8192 /* Refresh client stats hash table */
405 /* The following can't be set with mysql_refresh() */
406 #define REFRESH_READ_LOCK 16384 /* Lock tables for read */
407 diff -r 23e5576aa59a libmysql/Makefile.in
408 --- a/libmysql/Makefile.in Tue Feb 17 22:33:00 2009 -0800
409 +++ b/libmysql/Makefile.in Tue Feb 17 22:33:23 2009 -0800
412 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
417 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
418 diff -r 23e5576aa59a libmysql_r/Makefile.in
419 --- a/libmysql_r/Makefile.in Tue Feb 17 22:33:00 2009 -0800
420 +++ b/libmysql_r/Makefile.in Tue Feb 17 22:33:23 2009 -0800
423 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
426 LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
428 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
429 diff -r 23e5576aa59a libmysqld/Makefile.in
430 --- a/libmysqld/Makefile.in Tue Feb 17 22:33:00 2009 -0800
431 +++ b/libmysqld/Makefile.in Tue Feb 17 22:33:23 2009 -0800
434 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
439 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
440 diff -r 23e5576aa59a libmysqld/examples/Makefile.in
441 --- a/libmysqld/examples/Makefile.in Tue Feb 17 22:33:00 2009 -0800
442 +++ b/libmysqld/examples/Makefile.in Tue Feb 17 22:33:23 2009 -0800
445 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
448 LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs)
450 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
451 diff -r 23e5576aa59a man/Makefile.in
452 --- a/man/Makefile.in Tue Feb 17 22:33:00 2009 -0800
453 +++ b/man/Makefile.in Tue Feb 17 22:33:23 2009 -0800
456 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
461 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
462 diff -r 23e5576aa59a myisam/Makefile.in
463 --- a/myisam/Makefile.in Tue Feb 17 22:33:00 2009 -0800
464 +++ b/myisam/Makefile.in Tue Feb 17 22:33:23 2009 -0800
467 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
472 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
473 diff -r 23e5576aa59a myisammrg/Makefile.in
474 --- a/myisammrg/Makefile.in Tue Feb 17 22:33:00 2009 -0800
475 +++ b/myisammrg/Makefile.in Tue Feb 17 22:33:23 2009 -0800
478 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
483 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
484 diff -r 23e5576aa59a mysql-test/Makefile.in
485 --- a/mysql-test/Makefile.in Tue Feb 17 22:33:00 2009 -0800
486 +++ b/mysql-test/Makefile.in Tue Feb 17 22:33:23 2009 -0800
489 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
494 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
495 diff -r 23e5576aa59a mysql-test/ndb/Makefile.in
496 --- a/mysql-test/ndb/Makefile.in Tue Feb 17 22:33:00 2009 -0800
497 +++ b/mysql-test/ndb/Makefile.in Tue Feb 17 22:33:23 2009 -0800
500 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
505 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
506 diff -r 23e5576aa59a mysql-test/r/information_schema.result
507 --- a/mysql-test/r/information_schema.result Tue Feb 17 22:33:00 2009 -0800
508 +++ b/mysql-test/r/information_schema.result Tue Feb 17 22:33:23 2009 -0800
515 COLLATION_CHARACTER_SET_APPLICABILITY
535 TABLE_CONSTRAINTS TABLE_CONSTRAINTS
536 TABLE_PRIVILEGES TABLE_PRIVILEGES
537 +TABLE_STATISTICS TABLE_STATISTICS
539 tables_priv tables_priv
543 TABLE_CONSTRAINTS TABLE_CONSTRAINTS
544 TABLE_PRIVILEGES TABLE_PRIVILEGES
545 +TABLE_STATISTICS TABLE_STATISTICS
547 tables_priv tables_priv
551 TABLE_CONSTRAINTS TABLE_CONSTRAINTS
552 TABLE_PRIVILEGES TABLE_PRIVILEGES
553 +TABLE_STATISTICS TABLE_STATISTICS
555 tables_priv tables_priv
557 @@ -594,12 +601,13 @@
558 where table_schema='information_schema' limit 2;
559 TABLE_NAME TABLE_TYPE ENGINE
560 CHARACTER_SETS SYSTEM VIEW MEMORY
561 -COLLATIONS SYSTEM VIEW MEMORY
562 +CLIENT_STATISTICS SYSTEM VIEW MEMORY
563 show tables from information_schema like "T%";
564 Tables_in_information_schema (T%)
570 create database information_schema;
571 ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
574 TABLE_CONSTRAINTS SYSTEM VIEW
575 TABLE_PRIVILEGES SYSTEM VIEW
576 +TABLE_STATISTICS SYSTEM VIEW
578 create table t1(a int);
579 ERROR 42S02: Unknown table 't1' in information_schema
586 select table_name from tables where table_name='user';
589 CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1;
590 CREATE VIEW a2 AS SELECT t_CRASHME FROM a1;
595 drop table t_crashme;
596 select table_schema,table_name, column_name from
597 @@ -790,18 +800,20 @@
598 TABLE_NAME COLUMN_NAME PRIVILEGES
599 COLUMNS TABLE_NAME select
600 COLUMN_PRIVILEGES TABLE_NAME select
601 +INDEX_STATISTICS TABLE_NAME select
602 KEY_COLUMN_USAGE TABLE_NAME select
603 STATISTICS TABLE_NAME select
604 TABLES TABLE_NAME select
605 TABLE_CONSTRAINTS TABLE_NAME select
606 TABLE_PRIVILEGES TABLE_NAME select
607 +TABLE_STATISTICS TABLE_NAME select
608 VIEWS TABLE_NAME select
609 delete from mysql.user where user='mysqltest_4';
610 delete from mysql.db where user='mysqltest_4';
612 SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
613 table_schema count(*)
614 -information_schema 17
615 +information_schema 21
617 create table t1 (i int, j int);
618 create trigger trg1 before insert on t1 for each row
619 @@ -1187,10 +1199,12 @@
621 table_name column_name
622 CHARACTER_SETS CHARACTER_SET_NAME
623 +CLIENT_STATISTICS CLIENT
624 COLLATIONS COLLATION_NAME
625 COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
627 COLUMN_PRIVILEGES TABLE_SCHEMA
628 +INDEX_STATISTICS TABLE_SCHEMA
629 KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
631 ROUTINES ROUTINE_SCHEMA
632 @@ -1200,8 +1214,10 @@
634 TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
635 TABLE_PRIVILEGES TABLE_SCHEMA
636 +TABLE_STATISTICS TABLE_SCHEMA
637 TRIGGERS TRIGGER_SCHEMA
638 USER_PRIVILEGES GRANTEE
639 +USER_STATISTICS USER
641 SELECT t.table_name, c1.column_name
642 FROM information_schema.tables t
643 @@ -1219,10 +1235,12 @@
645 table_name column_name
646 CHARACTER_SETS CHARACTER_SET_NAME
647 +CLIENT_STATISTICS CLIENT
648 COLLATIONS COLLATION_NAME
649 COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
651 COLUMN_PRIVILEGES TABLE_SCHEMA
652 +INDEX_STATISTICS TABLE_SCHEMA
653 KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
655 ROUTINES ROUTINE_SCHEMA
656 @@ -1232,8 +1250,10 @@
658 TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
659 TABLE_PRIVILEGES TABLE_SCHEMA
660 +TABLE_STATISTICS TABLE_SCHEMA
661 TRIGGERS TRIGGER_SCHEMA
662 USER_PRIVILEGES GRANTEE
663 +USER_STATISTICS USER
665 SELECT MAX(table_name) FROM information_schema.tables;
667 @@ -1302,10 +1322,12 @@
668 group by t.table_name order by num1, t.table_name;
669 table_name group_concat(t.table_schema, '.', t.table_name) num1
670 CHARACTER_SETS information_schema.CHARACTER_SETS 1
671 +CLIENT_STATISTICS information_schema.CLIENT_STATISTICS 1
672 COLLATIONS information_schema.COLLATIONS 1
673 COLLATION_CHARACTER_SET_APPLICABILITY information_schema.COLLATION_CHARACTER_SET_APPLICABILITY 1
674 COLUMNS information_schema.COLUMNS 1
675 COLUMN_PRIVILEGES information_schema.COLUMN_PRIVILEGES 1
676 +INDEX_STATISTICS information_schema.INDEX_STATISTICS 1
677 KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
678 PROFILING information_schema.PROFILING 1
679 ROUTINES information_schema.ROUTINES 1
680 @@ -1315,8 +1337,10 @@
681 TABLES information_schema.TABLES 1
682 TABLE_CONSTRAINTS information_schema.TABLE_CONSTRAINTS 1
683 TABLE_PRIVILEGES information_schema.TABLE_PRIVILEGES 1
684 +TABLE_STATISTICS information_schema.TABLE_STATISTICS 1
685 TRIGGERS information_schema.TRIGGERS 1
686 USER_PRIVILEGES information_schema.USER_PRIVILEGES 1
687 +USER_STATISTICS information_schema.USER_STATISTICS 1
688 VIEWS information_schema.VIEWS 1
689 show global status like "Uptime_%";
691 diff -r 23e5576aa59a mysql-test/r/information_schema_db.result
692 --- a/mysql-test/r/information_schema_db.result Tue Feb 17 22:33:00 2009 -0800
693 +++ b/mysql-test/r/information_schema_db.result Tue Feb 17 22:33:23 2009 -0800
696 Tables_in_information_schema
700 COLLATION_CHARACTER_SET_APPLICABILITY
716 show tables from INFORMATION_SCHEMA like 'T%';
717 Tables_in_information_schema (T%)
723 create database `inf%`;
724 create database mbase;
725 diff -r 23e5576aa59a mysql-test/r/mysqlshow.result
726 --- a/mysql-test/r/mysqlshow.result Tue Feb 17 22:33:00 2009 -0800
727 +++ b/mysql-test/r/mysqlshow.result Tue Feb 17 22:33:23 2009 -0800
730 +---------------------------------------+
732 +| CLIENT_STATISTICS |
734 | COLLATION_CHARACTER_SET_APPLICABILITY |
736 | COLUMN_PRIVILEGES |
737 +| INDEX_STATISTICS |
743 | TABLE_CONSTRAINTS |
745 +| TABLE_STATISTICS |
750 +---------------------------------------+
751 Database: INFORMATION_SCHEMA
752 @@ -102,10 +106,12 @@
754 +---------------------------------------+
756 +| CLIENT_STATISTICS |
758 | COLLATION_CHARACTER_SET_APPLICABILITY |
760 | COLUMN_PRIVILEGES |
761 +| INDEX_STATISTICS |
767 | TABLE_CONSTRAINTS |
769 +| TABLE_STATISTICS |
774 +---------------------------------------+
775 Wildcard: inf_rmation_schema
776 diff -r 23e5576aa59a mysys/Makefile.in
777 --- a/mysys/Makefile.in Tue Feb 17 22:33:00 2009 -0800
778 +++ b/mysys/Makefile.in Tue Feb 17 22:33:23 2009 -0800
781 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
786 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
787 diff -r 23e5576aa59a ndb/Makefile.in
788 --- a/ndb/Makefile.in Tue Feb 17 22:33:00 2009 -0800
789 +++ b/ndb/Makefile.in Tue Feb 17 22:33:23 2009 -0800
792 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
797 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
798 diff -r 23e5576aa59a ndb/docs/Makefile.in
799 --- a/ndb/docs/Makefile.in Tue Feb 17 22:33:00 2009 -0800
800 +++ b/ndb/docs/Makefile.in Tue Feb 17 22:33:23 2009 -0800
803 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
808 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
809 diff -r 23e5576aa59a ndb/include/Makefile.in
810 --- a/ndb/include/Makefile.in Tue Feb 17 22:33:00 2009 -0800
811 +++ b/ndb/include/Makefile.in Tue Feb 17 22:33:23 2009 -0800
814 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
819 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
820 diff -r 23e5576aa59a ndb/src/Makefile.in
821 --- a/ndb/src/Makefile.in Tue Feb 17 22:33:00 2009 -0800
822 +++ b/ndb/src/Makefile.in Tue Feb 17 22:33:23 2009 -0800
825 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
830 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
831 diff -r 23e5576aa59a ndb/src/common/Makefile.in
832 --- a/ndb/src/common/Makefile.in Tue Feb 17 22:33:00 2009 -0800
833 +++ b/ndb/src/common/Makefile.in Tue Feb 17 22:33:23 2009 -0800
836 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
841 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
842 diff -r 23e5576aa59a ndb/src/common/debugger/Makefile.in
843 --- a/ndb/src/common/debugger/Makefile.in Tue Feb 17 22:33:00 2009 -0800
844 +++ b/ndb/src/common/debugger/Makefile.in Tue Feb 17 22:33:23 2009 -0800
847 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
852 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
853 diff -r 23e5576aa59a ndb/src/common/debugger/signaldata/Makefile.in
854 --- a/ndb/src/common/debugger/signaldata/Makefile.in Tue Feb 17 22:33:00 2009 -0800
855 +++ b/ndb/src/common/debugger/signaldata/Makefile.in Tue Feb 17 22:33:23 2009 -0800
858 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
863 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
864 diff -r 23e5576aa59a ndb/src/common/logger/Makefile.in
865 --- a/ndb/src/common/logger/Makefile.in Tue Feb 17 22:33:00 2009 -0800
866 +++ b/ndb/src/common/logger/Makefile.in Tue Feb 17 22:33:23 2009 -0800
869 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
874 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
875 diff -r 23e5576aa59a ndb/src/common/mgmcommon/Makefile.in
876 --- a/ndb/src/common/mgmcommon/Makefile.in Tue Feb 17 22:33:00 2009 -0800
877 +++ b/ndb/src/common/mgmcommon/Makefile.in Tue Feb 17 22:33:23 2009 -0800
880 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
885 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
886 diff -r 23e5576aa59a ndb/src/common/portlib/Makefile.in
887 --- a/ndb/src/common/portlib/Makefile.in Tue Feb 17 22:33:00 2009 -0800
888 +++ b/ndb/src/common/portlib/Makefile.in Tue Feb 17 22:33:23 2009 -0800
891 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
896 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
897 diff -r 23e5576aa59a ndb/src/common/transporter/Makefile.in
898 --- a/ndb/src/common/transporter/Makefile.in Tue Feb 17 22:33:00 2009 -0800
899 +++ b/ndb/src/common/transporter/Makefile.in Tue Feb 17 22:33:23 2009 -0800
902 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
907 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
908 diff -r 23e5576aa59a ndb/src/common/util/Makefile.in
909 --- a/ndb/src/common/util/Makefile.in Tue Feb 17 22:33:00 2009 -0800
910 +++ b/ndb/src/common/util/Makefile.in Tue Feb 17 22:33:23 2009 -0800
913 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
918 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
919 diff -r 23e5576aa59a ndb/src/cw/Makefile.in
920 --- a/ndb/src/cw/Makefile.in Tue Feb 17 22:33:00 2009 -0800
921 +++ b/ndb/src/cw/Makefile.in Tue Feb 17 22:33:23 2009 -0800
924 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
929 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
930 diff -r 23e5576aa59a ndb/src/cw/cpcd/Makefile.in
931 --- a/ndb/src/cw/cpcd/Makefile.in Tue Feb 17 22:33:00 2009 -0800
932 +++ b/ndb/src/cw/cpcd/Makefile.in Tue Feb 17 22:33:23 2009 -0800
935 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
940 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
941 diff -r 23e5576aa59a ndb/src/kernel/Makefile.in
942 --- a/ndb/src/kernel/Makefile.in Tue Feb 17 22:33:00 2009 -0800
943 +++ b/ndb/src/kernel/Makefile.in Tue Feb 17 22:33:23 2009 -0800
946 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
951 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
952 diff -r 23e5576aa59a ndb/src/kernel/blocks/Makefile.in
953 --- a/ndb/src/kernel/blocks/Makefile.in Tue Feb 17 22:33:00 2009 -0800
954 +++ b/ndb/src/kernel/blocks/Makefile.in Tue Feb 17 22:33:23 2009 -0800
957 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
962 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
963 diff -r 23e5576aa59a ndb/src/kernel/blocks/backup/Makefile.in
964 --- a/ndb/src/kernel/blocks/backup/Makefile.in Tue Feb 17 22:33:00 2009 -0800
965 +++ b/ndb/src/kernel/blocks/backup/Makefile.in Tue Feb 17 22:33:23 2009 -0800
968 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
973 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
974 diff -r 23e5576aa59a ndb/src/kernel/blocks/cmvmi/Makefile.in
975 --- a/ndb/src/kernel/blocks/cmvmi/Makefile.in Tue Feb 17 22:33:00 2009 -0800
976 +++ b/ndb/src/kernel/blocks/cmvmi/Makefile.in Tue Feb 17 22:33:23 2009 -0800
979 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
984 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
985 diff -r 23e5576aa59a ndb/src/kernel/blocks/dbacc/Makefile.in
986 --- a/ndb/src/kernel/blocks/dbacc/Makefile.in Tue Feb 17 22:33:00 2009 -0800
987 +++ b/ndb/src/kernel/blocks/dbacc/Makefile.in Tue Feb 17 22:33:23 2009 -0800
990 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
995 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
996 diff -r 23e5576aa59a ndb/src/kernel/blocks/dbdict/Makefile.in
997 --- a/ndb/src/kernel/blocks/dbdict/Makefile.in Tue Feb 17 22:33:00 2009 -0800
998 +++ b/ndb/src/kernel/blocks/dbdict/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1001 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1006 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1007 diff -r 23e5576aa59a ndb/src/kernel/blocks/dbdih/Makefile.in
1008 --- a/ndb/src/kernel/blocks/dbdih/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1009 +++ b/ndb/src/kernel/blocks/dbdih/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1012 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1017 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1018 diff -r 23e5576aa59a ndb/src/kernel/blocks/dblqh/Makefile.in
1019 --- a/ndb/src/kernel/blocks/dblqh/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1020 +++ b/ndb/src/kernel/blocks/dblqh/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1023 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1028 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1029 diff -r 23e5576aa59a ndb/src/kernel/blocks/dbtc/Makefile.in
1030 --- a/ndb/src/kernel/blocks/dbtc/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1031 +++ b/ndb/src/kernel/blocks/dbtc/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1034 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1039 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1040 diff -r 23e5576aa59a ndb/src/kernel/blocks/dbtup/Makefile.in
1041 --- a/ndb/src/kernel/blocks/dbtup/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1042 +++ b/ndb/src/kernel/blocks/dbtup/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1045 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1050 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1051 diff -r 23e5576aa59a ndb/src/kernel/blocks/dbtux/Makefile.in
1052 --- a/ndb/src/kernel/blocks/dbtux/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1053 +++ b/ndb/src/kernel/blocks/dbtux/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1056 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1061 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1062 diff -r 23e5576aa59a ndb/src/kernel/blocks/dbutil/Makefile.in
1063 --- a/ndb/src/kernel/blocks/dbutil/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1064 +++ b/ndb/src/kernel/blocks/dbutil/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1067 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1072 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1073 diff -r 23e5576aa59a ndb/src/kernel/blocks/ndbcntr/Makefile.in
1074 --- a/ndb/src/kernel/blocks/ndbcntr/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1075 +++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1078 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1083 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1084 diff -r 23e5576aa59a ndb/src/kernel/blocks/ndbfs/Makefile.in
1085 --- a/ndb/src/kernel/blocks/ndbfs/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1086 +++ b/ndb/src/kernel/blocks/ndbfs/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1089 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1094 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1095 diff -r 23e5576aa59a ndb/src/kernel/blocks/qmgr/Makefile.in
1096 --- a/ndb/src/kernel/blocks/qmgr/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1097 +++ b/ndb/src/kernel/blocks/qmgr/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1100 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1105 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1106 diff -r 23e5576aa59a ndb/src/kernel/blocks/suma/Makefile.in
1107 --- a/ndb/src/kernel/blocks/suma/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1108 +++ b/ndb/src/kernel/blocks/suma/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1111 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1116 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1117 diff -r 23e5576aa59a ndb/src/kernel/blocks/trix/Makefile.in
1118 --- a/ndb/src/kernel/blocks/trix/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1119 +++ b/ndb/src/kernel/blocks/trix/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1122 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1127 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1128 diff -r 23e5576aa59a ndb/src/kernel/error/Makefile.in
1129 --- a/ndb/src/kernel/error/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1130 +++ b/ndb/src/kernel/error/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1133 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1138 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1139 diff -r 23e5576aa59a ndb/src/kernel/vm/Makefile.in
1140 --- a/ndb/src/kernel/vm/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1141 +++ b/ndb/src/kernel/vm/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1144 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1149 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1150 diff -r 23e5576aa59a ndb/src/mgmapi/Makefile.in
1151 --- a/ndb/src/mgmapi/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1152 +++ b/ndb/src/mgmapi/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1155 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1160 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1161 diff -r 23e5576aa59a ndb/src/mgmclient/Makefile.in
1162 --- a/ndb/src/mgmclient/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1163 +++ b/ndb/src/mgmclient/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1166 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1171 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1172 diff -r 23e5576aa59a ndb/src/mgmsrv/Makefile.in
1173 --- a/ndb/src/mgmsrv/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1174 +++ b/ndb/src/mgmsrv/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1177 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1182 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1183 diff -r 23e5576aa59a ndb/src/ndbapi/Makefile.in
1184 --- a/ndb/src/ndbapi/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1185 +++ b/ndb/src/ndbapi/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1188 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1193 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1194 diff -r 23e5576aa59a ndb/test/Makefile.in
1195 --- a/ndb/test/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1196 +++ b/ndb/test/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1199 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1204 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1205 diff -r 23e5576aa59a ndb/test/ndbapi/Makefile.in
1206 --- a/ndb/test/ndbapi/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1207 +++ b/ndb/test/ndbapi/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1210 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1215 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1216 diff -r 23e5576aa59a ndb/test/ndbapi/bank/Makefile.in
1217 --- a/ndb/test/ndbapi/bank/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1218 +++ b/ndb/test/ndbapi/bank/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1221 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1226 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1227 diff -r 23e5576aa59a ndb/test/run-test/Makefile.in
1228 --- a/ndb/test/run-test/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1229 +++ b/ndb/test/run-test/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1232 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1237 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1238 diff -r 23e5576aa59a ndb/test/src/Makefile.in
1239 --- a/ndb/test/src/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1240 +++ b/ndb/test/src/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1243 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1248 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1249 diff -r 23e5576aa59a ndb/test/tools/Makefile.in
1250 --- a/ndb/test/tools/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1251 +++ b/ndb/test/tools/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1254 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1259 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1260 diff -r 23e5576aa59a ndb/tools/Makefile.in
1261 --- a/ndb/tools/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1262 +++ b/ndb/tools/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1265 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1270 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1271 diff -r 23e5576aa59a netware/Makefile.in
1272 --- a/netware/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1273 +++ b/netware/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1276 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1281 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1282 diff -r 23e5576aa59a os2/Makefile.in
1283 --- a/os2/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1284 +++ b/os2/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1287 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1292 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1293 diff -r 23e5576aa59a os2/include/Makefile.in
1294 --- a/os2/include/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1295 +++ b/os2/include/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1298 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1303 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1304 diff -r 23e5576aa59a os2/include/sys/Makefile.in
1305 --- a/os2/include/sys/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1306 +++ b/os2/include/sys/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1309 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1314 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1315 diff -r 23e5576aa59a patch_info/userstats.info
1316 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1317 +++ b/patch_info/userstats.info Tue Feb 17 22:33:23 2009 -0800
1319 +File=userstatsv2.patch
1320 +Name=SHOW USER/TABLE/INDEX statistics
1324 +Comment=Added INFORMATION_SCHEMA.*_STATISTICS
1326 +YK: fix behavior for prepared statements
1329 +YK: add switch variable "userstat_running" to control INFORMATION_SCHEMA.*_STATISTICS (default:OFF)
1332 +YK: fixed "Row_sent: 0" problem at microslow_innodb.patch
1333 diff -r 23e5576aa59a pstack/Makefile.in
1334 --- a/pstack/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1335 +++ b/pstack/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1338 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1343 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1344 diff -r 23e5576aa59a pstack/aout/Makefile.in
1345 --- a/pstack/aout/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1346 +++ b/pstack/aout/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1349 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1354 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1355 diff -r 23e5576aa59a regex/Makefile.in
1356 --- a/regex/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1357 +++ b/regex/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1360 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1365 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1366 diff -r 23e5576aa59a scripts/Makefile.in
1367 --- a/scripts/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1368 +++ b/scripts/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1371 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1376 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1377 diff -r 23e5576aa59a server-tools/Makefile.in
1378 --- a/server-tools/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1379 +++ b/server-tools/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1382 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1387 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1388 diff -r 23e5576aa59a server-tools/instance-manager/Makefile.in
1389 --- a/server-tools/instance-manager/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1390 +++ b/server-tools/instance-manager/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1393 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1398 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1399 diff -r 23e5576aa59a sql/Makefile.in
1400 --- a/sql/Makefile.in Tue Feb 17 22:33:00 2009 -0800
1401 +++ b/sql/Makefile.in Tue Feb 17 22:33:23 2009 -0800
1404 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
1409 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
1410 diff -r 23e5576aa59a sql/ha_innodb.cc
1411 --- a/sql/ha_innodb.cc Tue Feb 17 22:33:00 2009 -0800
1412 +++ b/sql/ha_innodb.cc Tue Feb 17 22:33:23 2009 -0800
1413 @@ -3324,6 +3324,8 @@
1415 error = row_insert_for_mysql((byte*) record, prebuilt);
1417 + if (error == DB_SUCCESS) rows_changed++;
1419 if (error == DB_SUCCESS && auto_inc_used) {
1421 /* Fetch the value that was set in the autoincrement field */
1422 @@ -3596,6 +3598,8 @@
1426 + if (error == DB_SUCCESS) rows_changed++;
1428 innodb_srv_conc_exit_innodb(prebuilt->trx);
1430 error = convert_error_code_to_mysql(error, user_thd);
1431 @@ -3643,6 +3647,8 @@
1432 innodb_srv_conc_enter_innodb(prebuilt->trx);
1434 error = row_update_for_mysql((byte*) record, prebuilt);
1436 + if (error == DB_SUCCESS) rows_changed++;
1438 innodb_srv_conc_exit_innodb(prebuilt->trx);
1440 @@ -4076,6 +4082,9 @@
1441 if (ret == DB_SUCCESS) {
1445 + if (active_index >= 0 && active_index < MAX_KEY)
1446 + index_rows_read[active_index]++;
1448 } else if (ret == DB_RECORD_NOT_FOUND) {
1449 error = HA_ERR_END_OF_FILE;
1450 diff -r 23e5576aa59a sql/ha_myisam.cc
1451 --- a/sql/ha_myisam.cc Tue Feb 17 22:33:00 2009 -0800
1452 +++ b/sql/ha_myisam.cc Tue Feb 17 22:33:23 2009 -0800
1454 if ((error= update_auto_increment()))
1457 - return mi_write(file,buf);
1458 + int error=mi_write(file,buf);
1459 + if (!error) rows_changed++;
1463 int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
1464 @@ -1518,13 +1520,17 @@
1465 statistic_increment(table->in_use->status_var.ha_update_count,&LOCK_status);
1466 if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
1467 table->timestamp_field->set_time();
1468 - return mi_update(file,old_data,new_data);
1469 + int error=mi_update(file,old_data,new_data);
1470 + if (!error) rows_changed++;
1474 int ha_myisam::delete_row(const byte * buf)
1476 statistic_increment(table->in_use->status_var.ha_delete_count,&LOCK_status);
1477 - return mi_delete(file,buf);
1478 + int error=mi_delete(file,buf);
1479 + if (!error) rows_changed++;
1483 int ha_myisam::index_read(byte * buf, const byte * key,
1484 @@ -1535,6 +1541,13 @@
1486 int error=mi_rkey(file,buf,active_index, key, key_len, find_flag);
1487 table->status=error ? STATUS_NOT_FOUND: 0;
1491 + int inx = (active_index == -1) ? file->lastinx : active_index;
1492 + if (inx >= 0 && inx < MAX_KEY)
1493 + index_rows_read[inx]++;
1498 @@ -1545,6 +1558,13 @@
1500 int error=mi_rkey(file,buf,index, key, key_len, find_flag);
1501 table->status=error ? STATUS_NOT_FOUND: 0;
1506 + if (inx >= 0 && inx < MAX_KEY)
1507 + index_rows_read[inx]++;
1512 @@ -1555,6 +1575,13 @@
1514 int error=mi_rkey(file,buf,active_index, key, key_len, HA_READ_PREFIX_LAST);
1515 table->status=error ? STATUS_NOT_FOUND: 0;
1519 + int inx = (active_index == -1) ? file->lastinx : active_index;
1520 + if (inx >= 0 && inx < MAX_KEY)
1521 + index_rows_read[inx]++;
1526 @@ -1565,6 +1592,13 @@
1528 int error=mi_rnext(file,buf,active_index);
1529 table->status=error ? STATUS_NOT_FOUND: 0;
1533 + int inx = (active_index == -1) ? file->lastinx : active_index;
1534 + if (inx >= 0 && inx < MAX_KEY)
1535 + index_rows_read[inx]++;
1540 @@ -1575,6 +1609,13 @@
1542 int error=mi_rprev(file,buf, active_index);
1543 table->status=error ? STATUS_NOT_FOUND: 0;
1547 + int inx = (active_index == -1) ? file->lastinx : active_index;
1548 + if (inx >= 0 && inx < MAX_KEY)
1549 + index_rows_read[inx]++;
1554 @@ -1585,6 +1626,13 @@
1556 int error=mi_rfirst(file, buf, active_index);
1557 table->status=error ? STATUS_NOT_FOUND: 0;
1561 + int inx = (active_index == -1) ? file->lastinx : active_index;
1562 + if (inx >= 0 && inx < MAX_KEY)
1563 + index_rows_read[inx]++;
1568 @@ -1595,6 +1643,13 @@
1570 int error=mi_rlast(file, buf, active_index);
1571 table->status=error ? STATUS_NOT_FOUND: 0;
1575 + int inx = (active_index == -1) ? file->lastinx : active_index;
1576 + if (inx >= 0 && inx < MAX_KEY)
1577 + index_rows_read[inx]++;
1582 @@ -1611,6 +1666,13 @@
1583 error= mi_rnext_same(file,buf);
1584 } while (error == HA_ERR_RECORD_DELETED);
1585 table->status=error ? STATUS_NOT_FOUND: 0;
1589 + int inx = (active_index == -1) ? file->lastinx : active_index;
1590 + if (inx >= 0 && inx < MAX_KEY)
1591 + index_rows_read[inx]++;
1596 @@ -1628,6 +1690,7 @@
1598 int error=mi_scan(file, buf);
1599 table->status=error ? STATUS_NOT_FOUND: 0;
1600 + if (!error) rows_read++;
1604 @@ -1642,6 +1705,7 @@
1606 int error=mi_rrnd(file, buf, my_get_ptr(pos,ref_length));
1607 table->status=error ? STATUS_NOT_FOUND: 0;
1608 + if (!error) rows_read++;
1612 diff -r 23e5576aa59a sql/handler.cc
1613 --- a/sql/handler.cc Tue Feb 17 22:33:00 2009 -0800
1614 +++ b/sql/handler.cc Tue Feb 17 22:33:23 2009 -0800
1617 tc_log->unlog(cookie, xid);
1618 DBUG_EXECUTE_IF("crash_commit_after", abort(););
1619 + if (is_real_trans)
1620 + thd->diff_commit_trans++;
1623 start_waiting_global_read_lock(thd);
1625 thd->transaction.cleanup();
1628 + thd->diff_rollback_trans++;
1629 #endif /* USING_TRANSACTIONS */
1631 thd->transaction_rollback_request= FALSE;
1632 @@ -1212,6 +1215,7 @@
1633 statistic_increment(thd->status_var.ha_rollback_count,&LOCK_status);
1634 *ht=0; // keep it conveniently zero-filled
1636 + thd->diff_rollback_trans++;
1640 @@ -1442,6 +1446,8 @@
1642 dupp_ref=ref+ALIGN_SIZE(ref_length);
1644 + rows_read = rows_changed = 0;
1645 + memset(index_rows_read, 0, sizeof(index_rows_read));
1649 @@ -2276,6 +2282,111 @@
1653 +// Updates the global table stats with the TABLE this handler represents.
1654 +void handler::update_global_table_stats() {
1655 + if (!opt_userstat_running) {
1656 + rows_read = rows_changed = 0;
1660 + if (!rows_read && !rows_changed) return; // Nothing to update.
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 + TABLE_STATS* table_stats;
1665 + char key[NAME_LEN * 2 + 2];
1666 + // [db] + '.' + [table]
1667 + sprintf(key, "%s.%s", table->s->table_cache_key, table->s->table_name);
1669 + pthread_mutex_lock(&LOCK_global_table_stats);
1670 + // Gets the global table stats, creating one if necessary.
1671 + if (!(table_stats = (TABLE_STATS*)hash_search(&global_table_stats,
1674 + if (!(table_stats = ((TABLE_STATS*)
1675 + my_malloc(sizeof(TABLE_STATS), MYF(MY_WME | MY_ZEROFILL))))) {
1677 + sql_print_error("Allocating table stats failed.");
1680 + strncpy(table_stats->table, key, sizeof(table_stats->table));
1681 + table_stats->rows_read = 0;
1682 + table_stats->rows_changed = 0;
1683 + table_stats->rows_changed_x_indexes = 0;
1684 + table_stats->engine_type = (int) ht->db_type;
1686 + if (my_hash_insert(&global_table_stats, (byte*)table_stats)) {
1688 + sql_print_error("Inserting table stats failed.");
1689 + my_free((char*)table_stats, 0);
1693 + // Updates the global table stats.
1694 + table_stats->rows_read += rows_read;
1695 + table_stats->rows_changed += rows_changed;
1696 + table_stats->rows_changed_x_indexes +=
1697 + rows_changed * (table->s->keys ? table->s->keys : 1);
1698 + current_thd->diff_total_read_rows += rows_read;
1699 + rows_read = rows_changed = 0;
1701 + pthread_mutex_unlock(&LOCK_global_table_stats);
1704 +// Updates the global index stats with this handler's accumulated index reads.
1705 +void handler::update_global_index_stats() {
1706 + // table_cache_key is db_name + '\0' + table_name + '\0'.
1707 + if (!table->s || !table->s->table_cache_key || !table->s->table_name) return;
1709 + if (!opt_userstat_running) {
1710 + for (int x = 0; x < table->s->keys; x++) {
1711 + index_rows_read[x] = 0;
1716 + for (int x = 0; x < table->s->keys; x++) {
1717 + if (index_rows_read[x]) {
1718 + // Rows were read using this index.
1719 + KEY* key_info = &table->key_info[x];
1721 + if (!key_info->name) continue;
1723 + INDEX_STATS* index_stats;
1724 + char key[NAME_LEN * 3 + 3];
1725 + // [db] + '.' + [table] + '.' + [index]
1726 + sprintf(key, "%s.%s.%s", table->s->table_cache_key,
1727 + table->s->table_name, key_info->name);
1729 + pthread_mutex_lock(&LOCK_global_index_stats);
1730 + // Gets the global index stats, creating one if necessary.
1731 + if (!(index_stats = (INDEX_STATS*)hash_search(&global_index_stats,
1734 + if (!(index_stats = ((INDEX_STATS*)
1735 + my_malloc(sizeof(INDEX_STATS), MYF(MY_WME | MY_ZEROFILL))))) {
1737 + sql_print_error("Allocating index stats failed.");
1740 + strncpy(index_stats->index, key, sizeof(index_stats->index));
1741 + index_stats->rows_read = 0;
1743 + if (my_hash_insert(&global_index_stats, (byte*)index_stats)) {
1745 + sql_print_error("Inserting index stats failed.");
1746 + my_free((char*)index_stats, 0);
1750 + // Updates the global index stats.
1751 + index_stats->rows_read += index_rows_read[x];
1752 + index_rows_read[x] = 0;
1754 + pthread_mutex_unlock(&LOCK_global_index_stats);
1759 /****************************************************************************
1760 ** Some general functions that isn't in the handler class
1761 diff -r 23e5576aa59a sql/handler.h
1762 --- a/sql/handler.h Tue Feb 17 22:33:00 2009 -0800
1763 +++ b/sql/handler.h Tue Feb 17 22:33:23 2009 -0800
1765 #if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || \
1766 defined(HAVE_NDBCLUSTER_DB)
1767 #define USING_TRANSACTIONS
1771 +#error MAX_KEY is too large. Values up to 128 are supported.
1774 // the following is for checking tables
1776 bool auto_increment_column_changed;
1777 bool implicit_emptied; /* Can be !=0 only if HEAP */
1778 const COND *pushed_cond;
1779 + ulonglong rows_read;
1780 + ulonglong rows_changed;
1781 + ulonglong index_rows_read[MAX_KEY];
1783 handler(const handlerton *ht_arg, TABLE *table_arg) :table(table_arg),
1785 @@ -615,8 +622,10 @@
1786 ref_length(sizeof(my_off_t)), block_size(0),
1787 raid_type(0), ft_handler(0), inited(NONE),
1788 locked(FALSE), implicit_emptied(0),
1791 + pushed_cond(NULL), rows_read(0), rows_changed(0)
1793 + memset(index_rows_read, 0, sizeof(index_rows_read));
1795 virtual ~handler(void) { DBUG_ASSERT(locked == FALSE); /* TODO: DBUG_ASSERT(inited == NONE); */ }
1796 virtual handler *clone(MEM_ROOT *mem_root);
1797 int ha_open(const char *name, int mode, int test_if_locked);
1798 @@ -625,7 +634,11 @@
1799 virtual void print_error(int error, myf errflag);
1800 virtual bool get_error_message(int error, String *buf);
1801 uint get_dup_key(int error);
1802 - void change_table_ptr(TABLE *table_arg) { table=table_arg; }
1803 + void change_table_ptr(TABLE *table_arg) {
1805 + rows_read = rows_changed = 0;
1806 + memset(index_rows_read, 0, sizeof(index_rows_read));
1808 virtual double scan_time()
1809 { return ulonglong2double(data_file_length) / IO_SIZE + 2; }
1810 virtual double read_time(uint index, uint ranges, ha_rows rows)
1812 virtual bool is_crashed() const { return 0; }
1813 virtual bool auto_repair() const { return 0; }
1815 + void update_global_table_stats();
1816 + void update_global_index_stats();
1819 default rename_table() and delete_table() rename/delete files with a
1820 given name and extensions from bas_ext()
1821 diff -r 23e5576aa59a sql/lex.h
1822 --- a/sql/lex.h Tue Feb 17 22:33:00 2009 -0800
1823 +++ b/sql/lex.h Tue Feb 17 22:33:23 2009 -0800
1825 { "CHECKSUM", SYM(CHECKSUM_SYM)},
1826 { "CIPHER", SYM(CIPHER_SYM)},
1827 { "CLIENT", SYM(CLIENT_SYM)},
1828 + { "CLIENT_STATISTICS", SYM(CLIENT_STATS_SYM)},
1829 { "CLOSE", SYM(CLOSE_SYM)},
1830 { "CODE", SYM(CODE_SYM)},
1831 { "COLLATE", SYM(COLLATE_SYM)},
1833 { "IN", SYM(IN_SYM)},
1834 { "INDEX", SYM(INDEX_SYM)},
1835 { "INDEXES", SYM(INDEXES)},
1836 + { "INDEX_STATISTICS", SYM(INDEX_STATS_SYM)},
1837 { "INFILE", SYM(INFILE)},
1838 { "INNER", SYM(INNER_SYM)},
1839 { "INNOBASE", SYM(INNOBASE_SYM)},
1841 { "SIGNED", SYM(SIGNED_SYM)},
1842 { "SIMPLE", SYM(SIMPLE_SYM)},
1843 { "SLAVE", SYM(SLAVE)},
1844 + { "SLOW", SYM(SLOW_SYM)},
1845 { "SNAPSHOT", SYM(SNAPSHOT_SYM)},
1846 { "SMALLINT", SYM(SMALLINT)},
1847 { "SOME", SYM(ANY_SYM)},
1849 { "TABLE", SYM(TABLE_SYM)},
1850 { "TABLES", SYM(TABLES)},
1851 { "TABLESPACE", SYM(TABLESPACE)},
1852 + { "TABLE_STATISTICS", SYM(TABLE_STATS_SYM)},
1853 { "TEMPORARY", SYM(TEMPORARY)},
1854 { "TEMPTABLE", SYM(TEMPTABLE_SYM)},
1855 { "TERMINATED", SYM(TERMINATED)},
1857 { "USE", SYM(USE_SYM)},
1858 { "USER", SYM(USER)},
1859 { "USER_RESOURCES", SYM(RESOURCES)},
1860 + { "USER_STATISTICS", SYM(USER_STATS_SYM)},
1861 { "USE_FRM", SYM(USE_FRM)},
1862 { "USING", SYM(USING)},
1863 { "UTC_DATE", SYM(UTC_DATE_SYM)},
1864 diff -r 23e5576aa59a sql/log.cc
1865 --- a/sql/log.cc Tue Feb 17 22:33:00 2009 -0800
1866 +++ b/sql/log.cc Tue Feb 17 22:33:23 2009 -0800
1867 @@ -1954,18 +1954,24 @@
1868 thd->current_insert_id);
1871 + if (file == &log_file)
1872 + thd->binlog_bytes_written += e.data_written;
1874 if (thd->insert_id_used)
1876 Intvar_log_event e(thd,(uchar) INSERT_ID_EVENT,thd->last_insert_id);
1879 + if (file == &log_file)
1880 + thd->binlog_bytes_written += e.data_written;
1884 Rand_log_event e(thd,thd->rand_saved_seed1,thd->rand_saved_seed2);
1887 + if (file == &log_file)
1888 + thd->binlog_bytes_written += e.data_written;
1890 if (thd->user_var_events.elements)
1892 @@ -1981,6 +1987,8 @@
1893 user_var_event->charset_number);
1896 + if (file == &log_file)
1897 + thd->binlog_bytes_written += e.data_written;
1901 @@ -1991,6 +1999,8 @@
1903 if (event_info->write(file))
1905 + if (file == &log_file)
1906 + thd->binlog_bytes_written += event_info->data_written;
1908 if (file == &log_file) // we are writing to the real log (disk)
1910 @@ -2112,6 +2122,7 @@
1912 if (qinfo.write(&log_file))
1914 + thd->binlog_bytes_written += qinfo.data_written;
1916 /* Read from the file used to cache the queries .*/
1917 if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
1918 @@ -2158,6 +2169,7 @@
1919 /* write the first half of the split header */
1920 if (my_b_write(&log_file, header, carry))
1922 + thd->binlog_bytes_written += carry;
1925 copy fixed second half of header to cache so the correct
1926 @@ -2226,6 +2238,8 @@
1927 /* Write data to the binary log file */
1928 if (my_b_write(&log_file, cache->read_pos, length))
1930 + thd->binlog_bytes_written += length;
1932 cache->read_pos=cache->read_end; // Mark buffer used up
1933 DBUG_EXECUTE_IF("half_binlogged_transaction", goto DBUG_skip_commit;);
1934 } while ((length=my_b_fill(cache)));
1935 @@ -2234,6 +2248,8 @@
1937 if (commit_event->write(&log_file))
1939 + thd->binlog_bytes_written += commit_event->data_written;
1944 diff -r 23e5576aa59a sql/mysql_priv.h
1945 --- a/sql/mysql_priv.h Tue Feb 17 22:33:00 2009 -0800
1946 +++ b/sql/mysql_priv.h Tue Feb 17 22:33:23 2009 -0800
1947 @@ -823,7 +823,15 @@
1948 bool multi_delete_set_locks_and_link_aux_tables(LEX *lex);
1949 void init_max_user_conn(void);
1950 void init_update_queries(void);
1951 +void init_global_user_stats(void);
1952 +void init_global_table_stats(void);
1953 +void init_global_index_stats(void);
1954 +void init_global_client_stats(void);
1955 void free_max_user_conn(void);
1956 +void free_global_user_stats(void);
1957 +void free_global_table_stats(void);
1958 +void free_global_index_stats(void);
1959 +void free_global_client_stats(void);
1960 pthread_handler_t handle_one_connection(void *arg);
1961 pthread_handler_t handle_bootstrap(void *arg);
1962 void end_thread(THD *thd,bool put_in_cache);
1963 @@ -1402,6 +1410,7 @@
1964 extern ulong max_connections,max_connect_errors, connect_timeout;
1965 extern ulong slave_net_timeout, slave_trans_retries;
1966 extern uint max_user_connections;
1967 +extern ulonglong denied_connections;
1968 extern ulong what_to_log,flush_time;
1969 extern ulong query_buff_size, thread_stack;
1970 extern ulong max_prepared_stmt_count, prepared_stmt_count;
1971 @@ -1432,6 +1441,7 @@
1972 extern my_bool opt_safe_show_db, opt_local_infile;
1973 extern my_bool opt_slave_compressed_protocol, use_temp_pool;
1974 extern my_bool opt_readonly, lower_case_file_system;
1975 +extern my_bool opt_userstat_running;
1976 extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
1977 extern my_bool opt_secure_auth;
1978 extern char* opt_secure_file_priv;
1979 @@ -1479,6 +1489,14 @@
1980 extern struct system_variables max_system_variables;
1981 extern struct system_status_var global_status_var;
1982 extern struct rand_struct sql_rand;
1983 +extern HASH global_user_stats;
1984 +extern HASH global_client_stats;
1985 +extern pthread_mutex_t LOCK_global_user_client_stats;
1986 +extern HASH global_table_stats;
1987 +extern pthread_mutex_t LOCK_global_table_stats;
1988 +extern HASH global_index_stats;
1989 +extern pthread_mutex_t LOCK_global_index_stats;
1990 +extern pthread_mutex_t LOCK_stats;
1992 extern const char *opt_date_time_formats[];
1993 extern KNOWN_DATE_TIME_FORMAT known_date_time_formats[];
1994 diff -r 23e5576aa59a sql/mysqld.cc
1995 --- a/sql/mysqld.cc Tue Feb 17 22:33:00 2009 -0800
1996 +++ b/sql/mysqld.cc Tue Feb 17 22:33:23 2009 -0800
1998 uint opt_large_page_size= 0;
1999 my_bool opt_old_style_user_limits= 0, trust_function_creators= 0;
2000 char* opt_slow_logname= 0;
2001 +my_bool opt_userstat_running= 0;
2003 True if there is at least one per-hour limit for some user, so we should
2004 check them before each query (and possibly reset counters when hour is
2006 ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
2007 ulong max_connections, max_connect_errors;
2008 uint max_user_connections= 0;
2009 +ulonglong denied_connections = 0;
2011 Limit of the total number of prepared statements in the server.
2012 Is necessary to protect the server against out-of-memory attacks.
2013 @@ -551,6 +553,10 @@
2014 LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
2015 LOCK_global_system_variables,
2016 LOCK_user_conn, LOCK_slave_list, LOCK_active_mi;
2017 +pthread_mutex_t LOCK_stats;
2018 +pthread_mutex_t LOCK_global_user_client_stats;
2019 +pthread_mutex_t LOCK_global_table_stats;
2020 +pthread_mutex_t LOCK_global_index_stats;
2022 The below lock protects access to two global server variables:
2023 max_prepared_stmt_count and prepared_stmt_count. These variables
2024 @@ -1192,6 +1198,10 @@
2025 x_free(opt_secure_file_priv);
2026 bitmap_free(&temp_pool);
2027 free_max_user_conn();
2028 + free_global_user_stats();
2029 + free_global_client_stats();
2030 + free_global_table_stats();
2031 + free_global_index_stats();
2032 #ifdef HAVE_REPLICATION
2034 free_list(&replicate_do_db);
2035 @@ -1306,6 +1316,10 @@
2036 (void) pthread_cond_destroy(&COND_thread_cache);
2037 (void) pthread_cond_destroy(&COND_flush_thread_cache);
2038 (void) pthread_cond_destroy(&COND_manager);
2039 + (void) pthread_mutex_destroy(&LOCK_stats);
2040 + (void) pthread_mutex_destroy(&LOCK_global_user_client_stats);
2041 + (void) pthread_mutex_destroy(&LOCK_global_table_stats);
2042 + (void) pthread_mutex_destroy(&LOCK_global_index_stats);
2045 #endif /*EMBEDDED_LIBRARY*/
2046 @@ -3153,6 +3167,10 @@
2047 (void) pthread_mutex_init(&LOCK_rpl_status, MY_MUTEX_INIT_FAST);
2048 (void) pthread_cond_init(&COND_rpl_status, NULL);
2050 + (void) pthread_mutex_init(&LOCK_stats, MY_MUTEX_INIT_FAST);
2051 + (void) pthread_mutex_init(&LOCK_global_user_client_stats, MY_MUTEX_INIT_FAST);
2052 + (void) pthread_mutex_init(&LOCK_global_table_stats, MY_MUTEX_INIT_FAST);
2053 + (void) pthread_mutex_init(&LOCK_global_index_stats, MY_MUTEX_INIT_FAST);
2055 /* Parameter for threads created for connections */
2056 (void) pthread_attr_init(&connection_attrib);
2057 @@ -3424,6 +3442,10 @@
2058 sql_print_error("Out of memory");
2062 + init_global_table_stats();
2063 + init_global_index_stats();
2067 sql_print_error("Can't init databases");
2068 @@ -3506,6 +3528,8 @@
2070 init_max_user_conn();
2071 init_update_queries();
2072 + init_global_user_stats();
2073 + init_global_client_stats();
2077 @@ -4232,6 +4256,7 @@
2079 DBUG_PRINT("error",("Too many connections"));
2080 close_connection(thd, ER_CON_COUNT_ERROR, 1);
2081 + statistic_increment(denied_connections, &LOCK_status);
2085 @@ -5050,6 +5075,7 @@
2088 OPT_SLOW_QUERY_LOG_FILE,
2089 + OPT_USERSTAT_RUNNING,
2090 OPT_USE_GLOBAL_LONG_QUERY_TIME,
2091 OPT_INNODB_ROLLBACK_ON_TIMEOUT,
2092 OPT_SECURE_FILE_PRIV,
2093 @@ -6498,6 +6524,10 @@
2094 (gptr*) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
2095 REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT),
2097 + {"userstat_running", OPT_USERSTAT_RUNNING,
2098 + "Control USER_STATISTICS, CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS running",
2099 + (gptr*) &opt_userstat_running, (gptr*) &opt_userstat_running,
2100 + 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
2101 {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
2104 diff -r 23e5576aa59a sql/set_var.cc
2105 --- a/sql/set_var.cc Tue Feb 17 22:33:00 2009 -0800
2106 +++ b/sql/set_var.cc Tue Feb 17 22:33:23 2009 -0800
2108 sys_var_thd_ulong sys_read_buff_size("read_buffer_size",
2109 &SV::read_buff_size);
2110 sys_var_bool_ptr sys_readonly("read_only", &opt_readonly);
2111 +sys_var_bool_ptr sys_userstat_running("userstat_running", &opt_userstat_running);
2112 sys_var_thd_ulong sys_read_rnd_buff_size("read_rnd_buffer_size",
2113 &SV::read_rnd_buff_size);
2114 sys_var_thd_ulong sys_div_precincrement("div_precision_increment",
2116 &sys_trans_alloc_block_size,
2117 &sys_trans_prealloc_size,
2119 + &sys_userstat_running,
2121 #ifdef HAVE_BERKELEY_DB
2123 @@ -1174,6 +1176,7 @@
2124 {sys_tx_isolation.name, (char*) &sys_tx_isolation, SHOW_SYS},
2125 {sys_updatable_views_with_limit.name,
2126 (char*) &sys_updatable_views_with_limit,SHOW_SYS},
2127 + {sys_userstat_running.name, (char*) &sys_userstat_running, SHOW_SYS},
2128 {sys_use_global_long_query_time.name, (char*) &sys_use_global_long_query_time, SHOW_SYS},
2129 {sys_version.name, (char*) &sys_version, SHOW_SYS},
2130 #ifdef HAVE_BERKELEY_DB
2131 diff -r 23e5576aa59a sql/share/Makefile.in
2132 --- a/sql/share/Makefile.in Tue Feb 17 22:33:00 2009 -0800
2133 +++ b/sql/share/Makefile.in Tue Feb 17 22:33:23 2009 -0800
2136 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
2141 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
2142 diff -r 23e5576aa59a sql/sql_base.cc
2143 --- a/sql/sql_base.cc Tue Feb 17 22:33:00 2009 -0800
2144 +++ b/sql/sql_base.cc Tue Feb 17 22:33:23 2009 -0800
2145 @@ -624,6 +624,12 @@
2146 DBUG_ENTER("close_thread_table");
2147 DBUG_ASSERT(table->key_read == 0);
2148 DBUG_ASSERT(!table->file || table->file->inited == handler::NONE);
2152 + table->file->update_global_table_stats();
2153 + table->file->update_global_index_stats();
2156 *table_ptr=table->next;
2157 if (table->needs_reopen_or_name_lock() ||
2160 DBUG_ENTER("close_temporary");
2161 char path[FN_REFLEN];
2163 + table->file->update_global_table_stats();
2164 + table->file->update_global_index_stats();
2165 db_type table_type=table->s->db_type;
2166 strmov(path,table->s->path);
2167 free_io_cache(table);
2168 diff -r 23e5576aa59a sql/sql_class.cc
2169 --- a/sql/sql_class.cc Tue Feb 17 22:33:00 2009 -0800
2170 +++ b/sql/sql_class.cc Tue Feb 17 22:33:23 2009 -0800
2171 @@ -236,6 +236,13 @@
2172 bzero(ha_data, sizeof(ha_data));
2174 binlog_evt_union.do_union= FALSE;
2177 + bytes_received = 0;
2179 + binlog_bytes_written = 0;
2180 + updated_row_count = 0;
2181 + sent_row_count_2 = 0;
2183 dbug_sentry=THD_SENTRY_MAGIC;
2185 @@ -369,6 +376,88 @@
2186 total_warn_count= 0;
2188 bzero((char *) &status_var, sizeof(status_var));
2192 +// Resets stats in a THD.
2193 +void THD::reset_stats(void) {
2194 + current_connect_time = time(NULL);
2195 + last_global_update_time = current_connect_time;
2196 + reset_diff_stats();
2199 +// Resets the 'diff' stats, which are used to update global stats.
2200 +void THD::reset_diff_stats(void) {
2201 + diff_total_busy_time = 0;
2202 + diff_total_cpu_time = 0;
2203 + diff_total_bytes_received = 0;
2204 + diff_total_bytes_sent = 0;
2205 + diff_total_binlog_bytes_written = 0;
2206 + diff_total_sent_rows = 0;
2207 + diff_total_updated_rows = 0;
2208 + diff_total_read_rows = 0;
2209 + diff_select_commands = 0;
2210 + diff_update_commands = 0;
2211 + diff_other_commands = 0;
2212 + diff_commit_trans = 0;
2213 + diff_rollback_trans = 0;
2214 + diff_denied_connections = 0;
2215 + diff_lost_connections = 0;
2216 + diff_access_denied_errors = 0;
2217 + diff_empty_queries = 0;
2220 +// Updates 'diff' stats of a THD.
2221 +void THD::update_stats(bool ran_command) {
2222 + if (opt_userstat_running) {
2223 + diff_total_busy_time += busy_time;
2224 + diff_total_cpu_time += cpu_time;
2225 + diff_total_bytes_received += bytes_received;
2226 + diff_total_bytes_sent += bytes_sent;
2227 + diff_total_binlog_bytes_written += binlog_bytes_written;
2228 + diff_total_sent_rows += sent_row_count_2;
2229 + diff_total_updated_rows += updated_row_count;
2230 + // diff_total_read_rows is updated in handler.cc.
2232 + if (ran_command) {
2233 + // The replication thread has the COM_CONNECT command.
2234 + if ((old_command == COM_QUERY || command == COM_CONNECT) &&
2235 + (lex->sql_command >= 0 && lex->sql_command < SQLCOM_END)) {
2237 + if (lex->sql_command == SQLCOM_SELECT) {
2238 + if (lex->orig_sql_command == SQLCOM_END) {
2239 + diff_select_commands++;
2240 + if (!sent_row_count_2)
2241 + diff_empty_queries++;
2243 + // 'SHOW ' commands become SQLCOM_SELECT.
2244 + diff_other_commands++;
2245 + // 'SHOW ' commands shouldn't inflate total sent row count.
2246 + diff_total_sent_rows -= sent_row_count_2;
2248 + } else if (is_update_query(lex->sql_command)) {
2249 + diff_update_commands++;
2251 + diff_other_commands++;
2255 + // diff_commit_trans is updated in handler.cc.
2256 + // diff_rollback_trans is updated in handler.cc.
2257 + // diff_denied_connections is updated in sql_parse.cc.
2258 + // diff_lost_connections is updated in sql_parse.cc.
2259 + // diff_access_denied_errors is updated in sql_parse.cc.
2261 + /* reset counters to zero to avoid double-counting since values
2262 + are already store in diff_total_*. */
2266 + bytes_received = 0;
2268 + binlog_bytes_written = 0;
2269 + updated_row_count = 0;
2270 + sent_row_count_2 = 0;
2274 @@ -892,6 +984,33 @@
2278 +char *THD::get_client_host_port(THD *client)
2280 + Security_context *client_sctx= client->security_ctx;
2281 + char *client_host= NULL;
2283 + if (client->peer_port && (client_sctx->host || client_sctx->ip) &&
2284 + security_ctx->host_or_ip[0])
2286 + if ((client_host= this->alloc(LIST_PROCESS_HOST_LEN+1)))
2287 + my_snprintf((char *) client_host, LIST_PROCESS_HOST_LEN,
2288 + "%s:%u", client_sctx->host_or_ip, client->peer_port);
2291 + client_host= this->strdup(client_sctx->host_or_ip[0] ?
2292 + client_sctx->host_or_ip :
2293 + client_sctx->host ? client_sctx->host : "");
2295 + return client_host;
2298 +const char *get_client_host(THD *client)
2300 + return client->security_ctx->host_or_ip[0] ?
2301 + client->security_ctx->host_or_ip :
2302 + client->security_ctx->host ? client->security_ctx->host : "";
2306 struct Item_change_record: public ilink
2308 @@ -1062,6 +1181,7 @@
2311 thd->sent_row_count++;
2312 + thd->sent_row_count_2++;
2315 if (!thd->net.report_error)
2316 @@ -1154,6 +1274,7 @@
2317 select_export::~select_export()
2319 thd->sent_row_count=row_count;
2320 + thd->sent_row_count_2=row_count;
2324 @@ -2088,6 +2209,7 @@
2325 if (likely(thd != 0))
2326 { /* current_thd==0 when close_connection() calls net_send_error() */
2327 thd->status_var.bytes_sent+= length;
2328 + thd->bytes_sent+= length;
2332 @@ -2095,6 +2217,7 @@
2333 void thd_increment_bytes_received(ulong length)
2335 current_thd->status_var.bytes_received+= length;
2336 + current_thd->bytes_received+= length;
2340 diff -r 23e5576aa59a sql/sql_class.h
2341 --- a/sql/sql_class.h Tue Feb 17 22:33:00 2009 -0800
2342 +++ b/sql/sql_class.h Tue Feb 17 22:33:23 2009 -0800
2343 @@ -1299,6 +1299,8 @@
2344 first byte of the packet in do_command()
2346 enum enum_server_command command;
2347 + // Used to save the command, before it is set to COM_SLEEP.
2348 + enum enum_server_command old_command;
2350 uint32 file_id; // for LOAD DATA INFILE
2352 @@ -1488,6 +1490,8 @@
2353 /* variables.transaction_isolation is reset to this after each commit */
2354 enum_tx_isolation session_tx_isolation;
2355 enum_check_fields count_cuted_fields;
2356 + ha_rows updated_row_count;
2357 + ha_rows sent_row_count_2; /* for userstat */
2359 DYNAMIC_ARRAY user_var_events; /* For user variables replication */
2360 MEM_ROOT *user_var_events_alloc; /* Allocate above array elements here */
2361 @@ -1594,6 +1598,49 @@
2363 LOG_INFO* current_linfo;
2364 NET* slave_net; // network connection from slave -> m.
2367 + Used to update global user stats. The global user stats are updated
2368 + occasionally with the 'diff' variables. After the update, the 'diff'
2369 + variables are reset to 0.
2371 + // Time when the current thread connected to MySQL.
2372 + time_t current_connect_time;
2373 + // Last time when THD stats were updated in global_user_stats.
2374 + time_t last_global_update_time;
2375 + // Busy (non-idle) time for just one command.
2377 + // Busy time not updated in global_user_stats yet.
2378 + double diff_total_busy_time;
2379 + // Cpu (non-idle) time for just one thread.
2381 + // Cpu time not updated in global_user_stats yet.
2382 + double diff_total_cpu_time;
2383 + /* bytes counting */
2384 + ulonglong bytes_received;
2385 + ulonglong diff_total_bytes_received;
2386 + ulonglong bytes_sent;
2387 + ulonglong diff_total_bytes_sent;
2388 + ulonglong binlog_bytes_written;
2389 + ulonglong diff_total_binlog_bytes_written;
2391 + // Number of rows not reflected in global_user_stats yet.
2392 + ha_rows diff_total_sent_rows, diff_total_updated_rows, diff_total_read_rows;
2393 + // Number of commands not reflected in global_user_stats yet.
2394 + ulonglong diff_select_commands, diff_update_commands, diff_other_commands;
2395 + // Number of transactions not reflected in global_user_stats yet.
2396 + ulonglong diff_commit_trans, diff_rollback_trans;
2397 + // Number of connection errors not reflected in global_user_stats yet.
2398 + ulonglong diff_denied_connections, diff_lost_connections;
2399 + // Number of db access denied, not reflected in global_user_stats yet.
2400 + ulonglong diff_access_denied_errors;
2401 + // Number of queries that return 0 rows
2402 + ulonglong diff_empty_queries;
2404 + // Per account query delay in miliseconds. When not 0, sleep this number of
2405 + // milliseconds before every SQL command.
2406 + ulonglong query_delay_millis;
2408 /* Used by the sys_var class to store temporary values */
2411 @@ -1649,6 +1696,11 @@
2414 void init_for_queries();
2415 + void reset_stats(void);
2416 + void reset_diff_stats(void);
2417 + // ran_command is true when this is called immediately after a
2418 + // command has been run.
2419 + void update_stats(bool ran_command);
2420 void change_user(void);
2422 void cleanup_after_query();
2423 @@ -1878,7 +1930,13 @@
2425 *p_db_length= db_length;
2428 + // Returns string as 'IP:port' for the client-side of the connnection represented
2429 + // by 'client' as displayed by SHOW PROCESSLIST. Allocates memory from the heap of
2430 + // this THD and that is not reclaimed immediately, so use sparingly. May return NULL.
2433 + char *get_client_host_port(THD *client);
2437 @@ -1922,6 +1980,11 @@
2438 MEM_ROOT main_mem_root;
2441 +// Returns string as 'IP' for the client-side of the connection represented by
2442 +// 'client'. Does not allocate memory. May return "".
2443 +const char *get_client_host(THD *client);
2445 +#define LIST_PROCESS_HOST_LEN 64
2447 #define tmp_disable_binlog(A) \
2448 {ulonglong tmp_disable_binlog__save_options= (A)->options; \
2449 diff -r 23e5576aa59a sql/sql_delete.cc
2450 --- a/sql/sql_delete.cc Tue Feb 17 22:33:00 2009 -0800
2451 +++ b/sql/sql_delete.cc Tue Feb 17 22:33:23 2009 -0800
2453 send_ok(thd,deleted);
2454 DBUG_PRINT("info",("%ld records deleted",(long) deleted));
2456 + thd->updated_row_count += deleted;
2457 DBUG_RETURN(error >= 0 || thd->net.report_error);
2461 thd->row_count_func= deleted;
2462 ::send_ok(thd, deleted);
2464 + thd->updated_row_count += deleted;
2468 diff -r 23e5576aa59a sql/sql_insert.cc
2469 --- a/sql/sql_insert.cc Tue Feb 17 22:33:00 2009 -0800
2470 +++ b/sql/sql_insert.cc Tue Feb 17 22:33:23 2009 -0800
2472 thd->row_count_func= info.copied + info.deleted + updated;
2473 ::send_ok(thd, (ulong) thd->row_count_func, id, buff);
2475 + thd->updated_row_count += thd->row_count_func;
2476 thd->abort_on_warning= 0;
2479 @@ -3036,6 +3037,7 @@
2480 autoinc_value_of_first_inserted_row : thd->insert_id_used ?
2481 thd->last_insert_id : 0;
2482 ::send_ok(thd, (ulong) thd->row_count_func, id, buff);
2483 + thd->updated_row_count += thd->row_count_func;
2487 diff -r 23e5576aa59a sql/sql_lex.h
2488 --- a/sql/sql_lex.h Tue Feb 17 22:33:00 2009 -0800
2489 +++ b/sql/sql_lex.h Tue Feb 17 22:33:23 2009 -0800
2491 When a command is added here, be sure it's also added in mysqld.cc
2492 in "struct show_var_st status_vars[]= {" ...
2494 + // TODO(mcallaghan): update status_vars in mysqld to export these
2495 + SQLCOM_SHOW_USER_STATS, SQLCOM_SHOW_TABLE_STATS, SQLCOM_SHOW_INDEX_STATS,
2496 + SQLCOM_SHOW_CLIENT_STATS,
2497 /* This should be the last !!! */
2500 diff -r 23e5576aa59a sql/sql_parse.cc
2501 --- a/sql/sql_parse.cc Tue Feb 17 22:33:00 2009 -0800
2502 +++ b/sql/sql_parse.cc Tue Feb 17 22:33:23 2009 -0800
2504 const char *table_name);
2505 static bool check_show_create_table_access(THD *thd, TABLE_LIST *table);
2507 +// Increments connection count for user.
2508 +static int increment_connection_count(THD* thd, bool use_lock);
2510 +// Uses the THD to update the global stats by user name and client IP
2511 +void update_global_user_stats(THD* thd, bool create_user, time_t now);
2513 const char *any_db="*any*"; // Special symbol for check_access
2515 const char *command_name[]={
2516 @@ -145,6 +151,17 @@
2517 #ifndef EMBEDDED_LIBRARY
2518 static bool do_command(THD *thd);
2519 #endif // EMBEDDED_LIBRARY
2521 +HASH global_user_stats;
2522 +HASH global_client_stats;
2523 +// Protects global_user_stats and global_client_stats
2524 +extern pthread_mutex_t LOCK_global_user_client_stats;
2526 +HASH global_table_stats;
2527 +extern pthread_mutex_t LOCK_global_table_stats;
2529 +HASH global_index_stats;
2530 +extern pthread_mutex_t LOCK_global_index_stats;
2533 extern void win_install_sigabrt_handler(void);
2535 mysql_log.write(thd,COM_CONNECT,ER(ER_NOT_SUPPORTED_AUTH_MODE));
2538 + thd->diff_access_denied_errors++;
2539 net_printf_error(thd, ER_ACCESS_DENIED_ERROR,
2540 thd->main_security_ctx.user,
2541 thd->main_security_ctx.host_or_ip,
2542 @@ -536,12 +554,190 @@
2543 void init_max_user_conn(void)
2545 #ifndef NO_EMBEDDED_ACCESS_CHECKS
2546 - (void) hash_init(&hash_user_connections,system_charset_info,max_connections,
2548 - (hash_get_key) get_key_conn, (hash_free_key) free_user,
2552 + if (hash_init(&hash_user_connections,system_charset_info,max_connections,
2554 + (hash_get_key) get_key_conn, (hash_free_key) free_user,
2556 + sql_print_error("Initializing hash_user_connections failed.");
2562 +byte *get_key_user_stats(USER_STATS *user_stats, uint *length,
2563 + my_bool not_used __attribute__((unused)))
2565 + *length = strlen(user_stats->user);
2566 + return (byte*)user_stats->user;
2569 +void free_user_stats(USER_STATS* user_stats)
2571 + my_free((char*)user_stats, MYF(0));
2574 +void init_user_stats(USER_STATS *user_stats,
2576 + const char *priv_user,
2577 + uint total_connections,
2578 + uint concurrent_connections,
2579 + time_t connected_time,
2582 + ulonglong bytes_received,
2583 + ulonglong bytes_sent,
2584 + ulonglong binlog_bytes_written,
2585 + ha_rows rows_fetched,
2586 + ha_rows rows_updated,
2587 + ha_rows rows_read,
2588 + ulonglong select_commands,
2589 + ulonglong update_commands,
2590 + ulonglong other_commands,
2591 + ulonglong commit_trans,
2592 + ulonglong rollback_trans,
2593 + ulonglong denied_connections,
2594 + ulonglong lost_connections,
2595 + ulonglong access_denied_errors,
2596 + ulonglong empty_queries)
2598 + DBUG_ENTER("init_user_stats");
2599 + DBUG_PRINT("info",
2600 + ("Add user_stats entry for user %s - priv_user %s",
2601 + user, priv_user));
2602 + strncpy(user_stats->user, user, sizeof(user_stats->user));
2603 + strncpy(user_stats->priv_user, priv_user, sizeof(user_stats->priv_user));
2605 + user_stats->total_connections = total_connections;
2606 + user_stats->concurrent_connections = concurrent_connections;
2607 + user_stats->connected_time = connected_time;
2608 + user_stats->busy_time = busy_time;
2609 + user_stats->cpu_time = cpu_time;
2610 + user_stats->bytes_received = bytes_received;
2611 + user_stats->bytes_sent = bytes_sent;
2612 + user_stats->binlog_bytes_written = binlog_bytes_written;
2613 + user_stats->rows_fetched = rows_fetched;
2614 + user_stats->rows_updated = rows_updated;
2615 + user_stats->rows_read = rows_read;
2616 + user_stats->select_commands = select_commands;
2617 + user_stats->update_commands = update_commands;
2618 + user_stats->other_commands = other_commands;
2619 + user_stats->commit_trans = commit_trans;
2620 + user_stats->rollback_trans = rollback_trans;
2621 + user_stats->denied_connections = denied_connections;
2622 + user_stats->lost_connections = lost_connections;
2623 + user_stats->access_denied_errors = access_denied_errors;
2624 + user_stats->empty_queries = empty_queries;
2628 +void add_user_stats(USER_STATS *user_stats,
2629 + uint total_connections,
2630 + uint concurrent_connections,
2631 + time_t connected_time,
2634 + ulonglong bytes_received,
2635 + ulonglong bytes_sent,
2636 + ulonglong binlog_bytes_written,
2637 + ha_rows rows_fetched,
2638 + ha_rows rows_updated,
2639 + ha_rows rows_read,
2640 + ulonglong select_commands,
2641 + ulonglong update_commands,
2642 + ulonglong other_commands,
2643 + ulonglong commit_trans,
2644 + ulonglong rollback_trans,
2645 + ulonglong denied_connections,
2646 + ulonglong lost_connections,
2647 + ulonglong access_denied_errors,
2648 + ulonglong empty_queries)
2650 + user_stats->total_connections += total_connections;
2651 + user_stats->concurrent_connections += concurrent_connections;
2652 + user_stats->connected_time += connected_time;
2653 + user_stats->busy_time += busy_time;
2654 + user_stats->cpu_time += cpu_time;
2655 + user_stats->bytes_received += bytes_received;
2656 + user_stats->bytes_sent += bytes_sent;
2657 + user_stats->binlog_bytes_written += binlog_bytes_written;
2658 + user_stats->rows_fetched += rows_fetched;
2659 + user_stats->rows_updated += rows_updated;
2660 + user_stats->rows_read += rows_read;
2661 + user_stats->select_commands += select_commands;
2662 + user_stats->update_commands += update_commands;
2663 + user_stats->other_commands += other_commands;
2664 + user_stats->commit_trans += commit_trans;
2665 + user_stats->rollback_trans += rollback_trans;
2666 + user_stats->denied_connections += denied_connections;
2667 + user_stats->lost_connections += lost_connections;
2668 + user_stats->access_denied_errors += access_denied_errors;
2669 + user_stats->empty_queries += empty_queries;
2672 +void init_global_user_stats(void)
2674 + if (hash_init(&global_user_stats, system_charset_info, max_connections,
2675 + 0, 0, (hash_get_key)get_key_user_stats,
2676 + (hash_free_key)free_user_stats, 0)) {
2677 + sql_print_error("Initializing global_user_stats failed.");
2682 +void init_global_client_stats(void)
2684 + if (hash_init(&global_client_stats, system_charset_info, max_connections,
2685 + 0, 0, (hash_get_key)get_key_user_stats,
2686 + (hash_free_key)free_user_stats, 0)) {
2687 + sql_print_error("Initializing global_client_stats failed.");
2692 +extern "C" byte *get_key_table_stats(TABLE_STATS *table_stats, uint *length,
2693 + my_bool not_used __attribute__((unused)))
2695 + *length = strlen(table_stats->table);
2696 + return (byte*)table_stats->table;
2699 +extern "C" void free_table_stats(TABLE_STATS* table_stats)
2701 + my_free((char*)table_stats, MYF(0));
2704 +void init_global_table_stats(void)
2706 + if (hash_init(&global_table_stats, system_charset_info, max_connections,
2707 + 0, 0, (hash_get_key)get_key_table_stats,
2708 + (hash_free_key)free_table_stats, 0)) {
2709 + sql_print_error("Initializing global_table_stats failed.");
2714 +extern "C" byte *get_key_index_stats(INDEX_STATS *index_stats, uint *length,
2715 + my_bool not_used __attribute__((unused)))
2717 + *length = strlen(index_stats->index);
2718 + return (byte*)index_stats->index;
2721 +extern "C" void free_index_stats(INDEX_STATS* index_stats)
2723 + my_free((char*)index_stats, MYF(0));
2726 +void init_global_index_stats(void)
2728 + if (hash_init(&global_index_stats, system_charset_info, max_connections,
2729 + 0, 0, (hash_get_key)get_key_index_stats,
2730 + (hash_free_key)free_index_stats, 0)) {
2731 + sql_print_error("Initializing global_index_stats failed.");
2739 @@ -599,7 +795,10 @@
2744 + statistic_increment(denied_connections, &LOCK_status);
2745 uc->connections--; // no need for decrease_user_connections() here
2747 (void) pthread_mutex_unlock(&LOCK_user_conn);
2750 @@ -646,6 +845,25 @@
2751 #endif /* NO_EMBEDDED_ACCESS_CHECKS */
2754 +void free_global_user_stats(void)
2756 + hash_free(&global_user_stats);
2759 +void free_global_table_stats(void)
2761 + hash_free(&global_table_stats);
2764 +void free_global_index_stats(void)
2766 + hash_free(&global_index_stats);
2769 +void free_global_client_stats(void)
2771 + hash_free(&global_client_stats);
2776 @@ -698,6 +916,214 @@
2777 return uc_update_queries[command] != 0;
2780 +// 'mysql_system_user' is used for when the user is not defined for a THD.
2781 +static char mysql_system_user[] = "#mysql_system#";
2783 +// Returns 'user' if it's not NULL. Returns 'mysql_system_user' otherwise.
2784 +static char* get_valid_user_string(char* user) {
2785 + return user ? user : mysql_system_user;
2788 +// Increments the global stats connection count for an entry from
2789 +// global_client_stats or global_user_stats. Returns 0 on success
2791 +static int increment_count_by_name(const char *name, const char *role_name,
2792 + HASH *users_or_clients, THD *thd)
2794 + USER_STATS* user_stats;
2796 + if (!(user_stats = (USER_STATS*)hash_search(users_or_clients, name,
2799 + // First connection for this user or client
2800 + if (!(user_stats = ((USER_STATS*)
2801 + my_malloc(sizeof(USER_STATS), MYF(MY_WME | MY_ZEROFILL)))))
2803 + return 1; // Out of memory
2806 + init_user_stats(user_stats, name, role_name,
2807 + 0, 0, // connections
2809 + 0, 0, 0, // bytes sent, received and written
2810 + 0, 0, 0, // rows fetched, updated and read
2811 + 0, 0, 0, // select, update and other commands
2812 + 0, 0, // commit and rollback trans
2813 + thd->diff_denied_connections,
2814 + 0, // lost connections
2815 + 0, // access denied errors
2816 + 0); // empty queries
2818 + if (my_hash_insert(users_or_clients, (byte*)user_stats))
2820 + my_free((char*)user_stats, 0);
2821 + return 1; // Out of memory
2824 + user_stats->total_connections++;
2828 +// Increments the global user and client stats connection count. If 'use_lock'
2829 +// is true, LOCK_global_user_client_stats will be locked/unlocked. Returns
2830 +// 0 on success, 1 on error.
2831 +static int increment_connection_count(THD* thd, bool use_lock)
2833 + char* user_string = get_valid_user_string(thd->main_security_ctx.user);
2834 + const char* client_string = get_client_host(thd);
2835 + int return_value = 0;
2837 + if (!opt_userstat_running)
2838 + return return_value;
2840 + if (use_lock) pthread_mutex_lock(&LOCK_global_user_client_stats);
2842 + if (increment_count_by_name(user_string, user_string,
2843 + &global_user_stats, thd))
2848 + if (increment_count_by_name(client_string,
2850 + &global_client_stats, thd))
2857 + if (use_lock) pthread_mutex_unlock(&LOCK_global_user_client_stats);
2858 + return return_value;
2861 +// Used to update the global user and client stats.
2862 +static void update_global_user_stats_with_user(THD* thd,
2863 + USER_STATS* user_stats,
2866 + user_stats->connected_time += now - thd->last_global_update_time;
2867 + thd->last_global_update_time = now;
2868 + user_stats->busy_time += thd->diff_total_busy_time;
2869 + user_stats->cpu_time += thd->diff_total_cpu_time;
2870 + user_stats->bytes_received += thd->diff_total_bytes_received;
2871 + user_stats->bytes_sent += thd->diff_total_bytes_sent;
2872 + user_stats->binlog_bytes_written += thd->diff_total_binlog_bytes_written;
2873 + user_stats->rows_fetched += thd->diff_total_sent_rows;
2874 + user_stats->rows_updated += thd->diff_total_updated_rows;
2875 + user_stats->rows_read += thd->diff_total_read_rows;
2876 + user_stats->select_commands += thd->diff_select_commands;
2877 + user_stats->update_commands += thd->diff_update_commands;
2878 + user_stats->other_commands += thd->diff_other_commands;
2879 + user_stats->commit_trans += thd->diff_commit_trans;
2880 + user_stats->rollback_trans += thd->diff_rollback_trans;
2881 + user_stats->denied_connections += thd->diff_denied_connections;
2882 + user_stats->lost_connections += thd->diff_lost_connections;
2883 + user_stats->access_denied_errors += thd->diff_access_denied_errors;
2884 + user_stats->empty_queries += thd->diff_empty_queries;
2887 +// Updates the global stats of a user or client
2888 +void update_global_user_stats(THD* thd, bool create_user, time_t now)
2890 + if (opt_userstat_running) {
2891 + char* user_string = get_valid_user_string(thd->main_security_ctx.user);
2892 + const char* client_string = get_client_host(thd);
2894 + USER_STATS* user_stats;
2895 + pthread_mutex_lock(&LOCK_global_user_client_stats);
2897 + // Update by user name
2898 + if ((user_stats = (USER_STATS*)hash_search(&global_user_stats,
2899 + (byte*)user_string,
2900 + strlen(user_string)))) {
2902 + update_global_user_stats_with_user(thd, user_stats, now);
2904 + // Create the entry
2905 + if (create_user) {
2906 + increment_count_by_name(user_string, user_string,
2907 + &global_user_stats, thd);
2911 + // Update by client IP
2912 + if ((user_stats = (USER_STATS*)hash_search(&global_client_stats,
2913 + (byte*)client_string,
2914 + strlen(client_string)))) {
2915 + // Found by client IP
2916 + update_global_user_stats_with_user(thd, user_stats, now);
2918 + // Create the entry
2919 + if (create_user) {
2920 + increment_count_by_name(client_string,
2922 + &global_client_stats, thd);
2925 + thd->reset_diff_stats();
2927 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
2929 + thd->reset_diff_stats();
2933 +// Determines the concurrent number of connections of current threads.
2934 +static void set_connections_stats()
2936 + USER_STATS* user_stats;
2938 + pthread_mutex_lock(&LOCK_global_user_client_stats);
2939 + pthread_mutex_lock(&LOCK_thread_count);
2941 + // Resets all concurrent connections to 0.
2942 + for (int i = 0; i < global_user_stats.records; ++i) {
2943 + user_stats = (USER_STATS*)hash_element(&global_user_stats, i);
2944 + user_stats->concurrent_connections = 0;
2946 + for (int i = 0; i < global_client_stats.records; ++i) {
2947 + user_stats = (USER_STATS*)hash_element(&global_client_stats, i);
2948 + user_stats->concurrent_connections = 0;
2951 + I_List_iterator<THD> it(threads);
2953 + time_t now = time(NULL);
2954 + // Iterates through the current threads.
2955 + while ((thd = it++)) {
2956 + char* user_string = get_valid_user_string(thd->main_security_ctx.user);
2957 + if ((user_stats = (USER_STATS*)hash_search(&global_user_stats,
2958 + (byte*)user_string,
2959 + strlen(user_string)))) {
2961 + user_stats->concurrent_connections++;
2962 + update_global_user_stats_with_user(thd, user_stats, now);
2964 + // The user name should exist.
2965 + if (user_string == mysql_system_user) {
2966 + // Only create the user if it is the mysql_system_user
2967 + increment_count_by_name(user_string, user_string,
2968 + &global_user_stats, thd);
2972 + const char* client_string = get_client_host(thd);
2973 + if ((user_stats = (USER_STATS*)hash_search(&global_client_stats,
2974 + (byte*)client_string,
2975 + strlen(client_string)))) {
2977 + user_stats->concurrent_connections++;
2978 + update_global_user_stats_with_user(thd, user_stats, now);
2980 + // Do nothing, unlike what is done for global_user_stats
2982 + thd->reset_diff_stats();
2984 + pthread_mutex_unlock(&LOCK_thread_count);
2985 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
2989 Reset per-hour user resource limits when it has been more than
2990 an hour since they were last checked
2991 @@ -1184,6 +1610,8 @@
2992 my_net_set_read_timeout(net, connect_timeout);
2993 my_net_set_write_timeout(net, connect_timeout);
2995 + bool create_user = true;
2997 if ((error=check_connection(thd)))
2998 { // Wrong permissions
3000 @@ -1193,8 +1621,22 @@
3001 my_sleep(1000); /* must wait after eof() */
3003 statistic_increment(aborted_connects,&LOCK_status);
3004 + thd->diff_denied_connections++;
3005 + if (error == -2) {
3006 + // Do not create statistics for a user who does not exist, or failed
3007 + // to authenticate.
3008 + create_user = false;
3013 + thd->reset_stats();
3014 + // Updates global user connection stats.
3015 + if (increment_connection_count(thd, true)) {
3016 + net_send_error(thd, ER_OUTOFMEMORY); // Out of memory
3021 netware_reg_user(sctx->ip, sctx->user, "MySQL");
3023 @@ -1251,6 +1693,7 @@
3024 net->vio && net->error && net->report_error)
3026 statistic_increment(aborted_threads, &LOCK_status);
3027 + thd->diff_lost_connections++;
3030 if (net->error && net->vio != 0 && net->report_error)
3031 @@ -1270,6 +1713,8 @@
3034 close_connection(thd, 0, 1);
3035 + thd->update_stats(false);
3036 + update_global_user_stats(thd, create_user, time(NULL));
3039 If end_thread returns, we are either running with --one-thread
3040 @@ -1601,6 +2046,13 @@
3042 thd->clear_error(); // Clear error message
3044 + thd->updated_row_count=0;
3047 + thd->bytes_received=0;
3048 + thd->bytes_sent=0;
3049 + thd->binlog_bytes_written=0;
3051 net_new_transaction(net);
3053 packet_length= my_net_read(net);
3054 @@ -1759,6 +2211,9 @@
3057 thd->command=command;
3058 + // To increment the corrent command counter for user stats, 'command' must
3059 + // be saved because it is set to COM_SLEEP at the end of this function.
3060 + thd->old_command = command;
3062 Commands which always take a long time are logged into
3063 the slow log only if opt_log_slow_admin_statements is set.
3064 @@ -4428,6 +4883,15 @@
3065 if (check_global_access(thd,RELOAD_ACL))
3068 + if(lex->type & REFRESH_SLOW_QUERY_LOG) {
3069 + /* We are only flushing slow query log */
3070 + mysql_slow_log.new_file(1);
3078 reload_acl_and_cache() will tell us if we are allowed to write to the
3080 @@ -4735,6 +5199,7 @@
3082 if (check_global_access(thd, SUPER_ACL))
3084 + thd->diff_access_denied_errors++;
3085 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
3086 goto create_sp_error;
3088 @@ -5571,6 +6036,7 @@
3091 const char *db_name= db ? db : thd->db;
3092 + thd->diff_access_denied_errors++;
3093 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
3094 sctx->priv_user, sctx->priv_host, db_name);
3096 @@ -5606,6 +6072,7 @@
3097 { // We can never grant this
3098 DBUG_PRINT("error",("No possible access"));
3100 + thd->diff_access_denied_errors++;
3101 my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
3104 @@ -5638,11 +6105,15 @@
3106 DBUG_PRINT("error",("Access denied"));
3109 + // increment needs !no_errors condition, otherwise double counting.
3110 + thd->diff_access_denied_errors++;
3111 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
3112 sctx->priv_user, sctx->priv_host,
3113 (db ? db : (thd->db ?
3115 "unknown"))); /* purecov: tested */
3117 DBUG_RETURN(TRUE); /* purecov: tested */
3118 #endif /* NO_EMBEDDED_ACCESS_CHECKS */
3120 @@ -5676,6 +6147,7 @@
3121 if ((thd->security_ctx->master_access & want_access))
3123 get_privilege_desc(command, sizeof(command), want_access);
3124 + thd->diff_access_denied_errors++;
3125 my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);
3127 #endif /* NO_EMBEDDED_ACCESS_CHECKS */
3128 @@ -5708,6 +6180,7 @@
3130 if (!thd->col_access && check_grant_db(thd, dst_db_name))
3132 + thd->diff_access_denied_errors++;
3133 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
3134 thd->security_ctx->priv_user,
3135 thd->security_ctx->priv_host,
3136 @@ -5739,6 +6212,12 @@
3137 check_grant(thd, SELECT_ACL, dst_table, 2, UINT_MAX, FALSE);
3141 + case SCH_USER_STATS:
3142 + case SCH_CLIENT_STATS:
3143 + return check_global_access(thd, SUPER_ACL | PROCESS_ACL);
3144 + case SCH_TABLE_STATS:
3145 + case SCH_INDEX_STATS:
3146 case SCH_OPEN_TABLES:
3149 @@ -5792,8 +6271,8 @@
3150 #ifndef NO_EMBEDDED_ACCESS_CHECKS
3151 TABLE_LIST *org_tables= tables;
3153 + Security_context *sctx= thd->security_ctx, *backup_ctx= thd->security_ctx;
3154 TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table();
3155 - Security_context *sctx= thd->security_ctx, *backup_ctx= thd->security_ctx;
3157 The check that first_not_own_table is not reached is for the case when
3158 the given table list refers to the list for prelocking (contains tables
3159 @@ -5810,9 +6289,12 @@
3160 (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
3164 + thd->diff_access_denied_errors++;
3165 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
3166 sctx->priv_user, sctx->priv_host,
3167 INFORMATION_SCHEMA_NAME.str);
3172 @@ -6321,6 +6803,30 @@
3175 mysql_reset_thd_for_next_command(thd);
3177 + int start_time_error = 0;
3178 + int end_time_error = 0;
3179 + struct timeval start_time, end_time;
3180 + double start_usecs = 0;
3181 + double end_usecs = 0;
3183 + int cputime_error = 0;
3184 + struct timespec tp;
3185 + double start_cpu_nsecs = 0;
3186 + double end_cpu_nsecs = 0;
3188 + if (opt_userstat_running) {
3189 +#ifdef HAVE_CLOCK_GETTIME
3190 + /* get start cputime */
3191 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3192 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3195 + // Gets the start time, in order to measure how long this command takes.
3196 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3197 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3201 if (query_cache_send_result_to_client(thd, (char*) inBuf, length) <= 0)
3203 @@ -6400,6 +6906,43 @@
3204 *found_semicolon= NULL;
3207 + if (opt_userstat_running) {
3208 + // Gets the end time.
3209 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3210 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3213 + // Calculates the difference between the end and start times.
3214 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3215 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3216 + // In case there are bad values, 2629743 is the #seconds in a month.
3217 + if (thd->busy_time > 2629743) {
3218 + thd->busy_time = 0;
3221 + // end time went back in time, or gettimeofday() failed.
3222 + thd->busy_time = 0;
3225 +#ifdef HAVE_CLOCK_GETTIME
3226 + /* get end cputime */
3227 + if (!cputime_error &&
3228 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3229 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3231 + if (start_cpu_nsecs && !cputime_error) {
3232 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3233 + // In case there are bad values, 2629743 is the #seconds in a month.
3234 + if (thd->cpu_time > 2629743) {
3235 + thd->cpu_time = 0;
3238 + thd->cpu_time = 0;
3240 + // Updates THD stats and the global user stats.
3241 + thd->update_stats(true);
3242 + update_global_user_stats(thd, true, time(NULL));
3247 @@ -7411,8 +7954,35 @@
3248 pthread_mutex_unlock(&LOCK_active_mi);
3251 - if (options & REFRESH_USER_RESOURCES)
3252 - reset_mqh((LEX_USER *) NULL);
3253 + if (options & REFRESH_TABLE_STATS)
3255 + pthread_mutex_lock(&LOCK_global_table_stats);
3256 + free_global_table_stats();
3257 + init_global_table_stats();
3258 + pthread_mutex_unlock(&LOCK_global_table_stats);
3260 + if (options & REFRESH_INDEX_STATS)
3262 + pthread_mutex_lock(&LOCK_global_index_stats);
3263 + free_global_index_stats();
3264 + init_global_index_stats();
3265 + pthread_mutex_unlock(&LOCK_global_index_stats);
3267 + if (options & (REFRESH_USER_STATS | REFRESH_CLIENT_STATS))
3269 + pthread_mutex_lock(&LOCK_global_user_client_stats);
3270 + if (options & REFRESH_USER_STATS)
3272 + free_global_user_stats();
3273 + init_global_user_stats();
3275 + if (options & REFRESH_CLIENT_STATS)
3277 + free_global_client_stats();
3278 + init_global_client_stats();
3280 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
3282 *write_to_binlog= tmp_write_to_binlog;
3285 diff -r 23e5576aa59a sql/sql_prepare.cc
3286 --- a/sql/sql_prepare.cc Tue Feb 17 22:33:00 2009 -0800
3287 +++ b/sql/sql_prepare.cc Tue Feb 17 22:33:23 2009 -0800
3290 #include <mysql_com.h>
3293 +// Uses the THD to update the global stats by user name and client IP
3294 +void update_global_user_stats(THD* thd, bool create_user, time_t now);
3296 /* A result class used to send cursor rows using the binary protocol. */
3298 @@ -1910,8 +1913,32 @@
3299 /* First of all clear possible warnings from the previous command */
3300 mysql_reset_thd_for_next_command(thd);
3302 + int start_time_error = 0;
3303 + int end_time_error = 0;
3304 + struct timeval start_time, end_time;
3305 + double start_usecs = 0;
3306 + double end_usecs = 0;
3308 + int cputime_error = 0;
3309 + struct timespec tp;
3310 + double start_cpu_nsecs = 0;
3311 + double end_cpu_nsecs = 0;
3313 + if (opt_userstat_running) {
3314 +#ifdef HAVE_CLOCK_GETTIME
3315 + /* get start cputime */
3316 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3317 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3320 + // Gets the start time, in order to measure how long this command takes.
3321 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3322 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3326 if (! (stmt= new Prepared_statement(thd, &thd->protocol_prep)))
3327 - DBUG_VOID_RETURN; /* out of memory: error is set in Sql_alloc */
3328 + goto end; /* out of memory: error is set in Sql_alloc */
3330 if (thd->stmt_map.insert(thd, stmt))
3332 @@ -1919,7 +1946,7 @@
3333 The error is set in the insert. The statement itself
3334 will be also deleted there (this is how the hash works).
3340 /* Reset warnings from previous command */
3341 @@ -1941,6 +1968,44 @@
3342 thd->stmt_map.erase(stmt);
3344 /* check_prepared_statemnt sends the metadata packet in case of success */
3346 + if (opt_userstat_running) {
3347 + // Gets the end time.
3348 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3349 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3352 + // Calculates the difference between the end and start times.
3353 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3354 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3355 + // In case there are bad values, 2629743 is the #seconds in a month.
3356 + if (thd->busy_time > 2629743) {
3357 + thd->busy_time = 0;
3360 + // end time went back in time, or gettimeofday() failed.
3361 + thd->busy_time = 0;
3364 +#ifdef HAVE_CLOCK_GETTIME
3365 + /* get end cputime */
3366 + if (!cputime_error &&
3367 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3368 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3370 + if (start_cpu_nsecs && !cputime_error) {
3371 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3372 + // In case there are bad values, 2629743 is the #seconds in a month.
3373 + if (thd->cpu_time > 2629743) {
3374 + thd->cpu_time = 0;
3377 + thd->cpu_time = 0;
3379 + // Updates THD stats and the global user stats.
3380 + thd->update_stats(true);
3381 + update_global_user_stats(thd, true, time(NULL));
3386 @@ -2281,8 +2346,32 @@
3387 /* First of all clear possible warnings from the previous command */
3388 mysql_reset_thd_for_next_command(thd);
3390 + int start_time_error = 0;
3391 + int end_time_error = 0;
3392 + struct timeval start_time, end_time;
3393 + double start_usecs = 0;
3394 + double end_usecs = 0;
3396 + int cputime_error = 0;
3397 + struct timespec tp;
3398 + double start_cpu_nsecs = 0;
3399 + double end_cpu_nsecs = 0;
3401 + if (opt_userstat_running) {
3402 +#ifdef HAVE_CLOCK_GETTIME
3403 + /* get start cputime */
3404 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3405 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3408 + // Gets the start time, in order to measure how long this command takes.
3409 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3410 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3414 if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_execute")))
3418 #ifdef ENABLED_PROFILING
3419 thd->profiling.set_query_source(stmt->query, stmt->query_length);
3420 @@ -2325,11 +2414,50 @@
3421 test(flags & (ulong) CURSOR_TYPE_READ_ONLY));
3422 if (!(specialflag & SPECIAL_NO_PRIOR))
3423 my_pthread_setprio(pthread_self(), WAIT_PRIOR);
3427 set_params_data_err:
3428 my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_stmt_execute");
3429 reset_stmt_params(stmt);
3432 + if (opt_userstat_running) {
3433 + // Gets the end time.
3434 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3435 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3438 + // Calculates the difference between the end and start times.
3439 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3440 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3441 + // In case there are bad values, 2629743 is the #seconds in a month.
3442 + if (thd->busy_time > 2629743) {
3443 + thd->busy_time = 0;
3446 + // end time went back in time, or gettimeofday() failed.
3447 + thd->busy_time = 0;
3450 +#ifdef HAVE_CLOCK_GETTIME
3451 + /* get end cputime */
3452 + if (!cputime_error &&
3453 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3454 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3456 + if (start_cpu_nsecs && !cputime_error) {
3457 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3458 + // In case there are bad values, 2629743 is the #seconds in a month.
3459 + if (thd->cpu_time > 2629743) {
3460 + thd->cpu_time = 0;
3463 + thd->cpu_time = 0;
3465 + // Updates THD stats and the global user stats.
3466 + thd->update_stats(true);
3467 + update_global_user_stats(thd, true, time(NULL));
3472 @@ -2423,6 +2551,31 @@
3474 /* First of all clear possible warnings from the previous command */
3475 mysql_reset_thd_for_next_command(thd);
3477 + int start_time_error = 0;
3478 + int end_time_error = 0;
3479 + struct timeval start_time, end_time;
3480 + double start_usecs = 0;
3481 + double end_usecs = 0;
3483 + int cputime_error = 0;
3484 + struct timespec tp;
3485 + double start_cpu_nsecs = 0;
3486 + double end_cpu_nsecs = 0;
3488 + if (opt_userstat_running) {
3489 +#ifdef HAVE_CLOCK_GETTIME
3490 + /* get start cputime */
3491 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3492 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3495 + // Gets the start time, in order to measure how long this command takes.
3496 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3497 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3501 statistic_increment(thd->status_var.com_stmt_fetch, &LOCK_status);
3502 if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_fetch")))
3504 @@ -2455,6 +2608,43 @@
3505 thd->restore_backup_statement(stmt, &stmt_backup);
3506 thd->stmt_arena= thd;
3508 + if (opt_userstat_running) {
3509 + // Gets the end time.
3510 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3511 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3514 + // Calculates the difference between the end and start times.
3515 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3516 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3517 + // In case there are bad values, 2629743 is the #seconds in a month.
3518 + if (thd->busy_time > 2629743) {
3519 + thd->busy_time = 0;
3522 + // end time went back in time, or gettimeofday() failed.
3523 + thd->busy_time = 0;
3526 +#ifdef HAVE_CLOCK_GETTIME
3527 + /* get end cputime */
3528 + if (!cputime_error &&
3529 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3530 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3532 + if (start_cpu_nsecs && !cputime_error) {
3533 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3534 + // In case there are bad values, 2629743 is the #seconds in a month.
3535 + if (thd->cpu_time > 2629743) {
3536 + thd->cpu_time = 0;
3539 + thd->cpu_time = 0;
3541 + // Updates THD stats and the global user stats.
3542 + thd->update_stats(true);
3543 + update_global_user_stats(thd, true, time(NULL));
3548 @@ -2487,6 +2677,30 @@
3549 /* First of all clear possible warnings from the previous command */
3550 mysql_reset_thd_for_next_command(thd);
3552 + int start_time_error = 0;
3553 + int end_time_error = 0;
3554 + struct timeval start_time, end_time;
3555 + double start_usecs = 0;
3556 + double end_usecs = 0;
3558 + int cputime_error = 0;
3559 + struct timespec tp;
3560 + double start_cpu_nsecs = 0;
3561 + double end_cpu_nsecs = 0;
3563 + if (opt_userstat_running) {
3564 +#ifdef HAVE_CLOCK_GETTIME
3565 + /* get start cputime */
3566 + if (!(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3567 + start_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3570 + // Gets the start time, in order to measure how long this command takes.
3571 + if (!(start_time_error = gettimeofday(&start_time, NULL))) {
3572 + start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
3576 statistic_increment(thd->status_var.com_stmt_reset, &LOCK_status);
3577 if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_reset")))
3579 @@ -2502,6 +2716,43 @@
3580 stmt->state= Query_arena::PREPARED;
3584 + if (opt_userstat_running) {
3585 + // Gets the end time.
3586 + if (!(end_time_error = gettimeofday(&end_time, NULL))) {
3587 + end_usecs = end_time.tv_sec * 1000000.0 + end_time.tv_usec;
3590 + // Calculates the difference between the end and start times.
3591 + if (start_usecs && end_usecs >= start_usecs && !start_time_error && !end_time_error) {
3592 + thd->busy_time = (end_usecs - start_usecs) / 1000000;
3593 + // In case there are bad values, 2629743 is the #seconds in a month.
3594 + if (thd->busy_time > 2629743) {
3595 + thd->busy_time = 0;
3598 + // end time went back in time, or gettimeofday() failed.
3599 + thd->busy_time = 0;
3602 +#ifdef HAVE_CLOCK_GETTIME
3603 + /* get end cputime */
3604 + if (!cputime_error &&
3605 + !(cputime_error = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)))
3606 + end_cpu_nsecs = tp.tv_sec*1000000000.0+tp.tv_nsec;
3608 + if (start_cpu_nsecs && !cputime_error) {
3609 + thd->cpu_time = (end_cpu_nsecs - start_cpu_nsecs) / 1000000000;
3610 + // In case there are bad values, 2629743 is the #seconds in a month.
3611 + if (thd->cpu_time > 2629743) {
3612 + thd->cpu_time = 0;
3615 + thd->cpu_time = 0;
3617 + // Updates THD stats and the global user stats.
3618 + thd->update_stats(true);
3619 + update_global_user_stats(thd, true, time(NULL));
3623 diff -r 23e5576aa59a sql/sql_show.cc
3624 --- a/sql/sql_show.cc Tue Feb 17 22:33:00 2009 -0800
3625 +++ b/sql/sql_show.cc Tue Feb 17 22:33:23 2009 -0800
3627 sctx->master_access);
3628 if (!(db_access & DB_ACLS) && (!grant_option || check_grant_db(thd,dbname)))
3630 + thd->diff_access_denied_errors++;
3631 my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
3632 sctx->priv_user, sctx->host_or_ip, dbname);
3633 mysql_log.write(thd,COM_INIT_DB,ER(ER_DBACCESS_DENIED_ERROR),
3634 @@ -1872,6 +1873,300 @@
3639 + Aggregate values for mapped_user entries by their role.
3642 + aggregate_user_stats
3643 + all_user_stats - input to aggregate
3644 + agg_user_stats - returns aggregated values
3651 +aggregate_user_stats(HASH *all_user_stats, HASH *agg_user_stats)
3653 + DBUG_ENTER("aggregate_user_stats");
3654 + if (hash_init(agg_user_stats, system_charset_info,
3655 + max(all_user_stats->records, 1),
3656 + 0, 0, (hash_get_key)get_key_user_stats,
3657 + (hash_free_key)free_user_stats, 0))
3659 + sql_print_error("Malloc in aggregate_user_stats failed");
3663 + for (int i = 0; i < all_user_stats->records; ++i) {
3664 + USER_STATS *user = (USER_STATS*)hash_element(all_user_stats, i);
3665 + USER_STATS *agg_user;
3666 + if (!(agg_user = (USER_STATS*)hash_search(agg_user_stats,
3667 + (byte*)user->priv_user,
3668 + strlen(user->priv_user))))
3670 + // First entry for this role.
3672 + (USER_STATS*) my_malloc(sizeof(USER_STATS), MYF(MY_WME | MY_ZEROFILL))))
3674 + sql_print_error("Malloc in aggregate_user_stats failed");
3678 + init_user_stats(agg_user, user->priv_user, user->priv_user,
3679 + user->total_connections, user->concurrent_connections,
3680 + user->connected_time, user->busy_time, user->cpu_time,
3681 + user->bytes_received, user->bytes_sent,
3682 + user->binlog_bytes_written,
3683 + user->rows_fetched, user->rows_updated, user->rows_read,
3684 + user->select_commands, user->update_commands,
3685 + user->other_commands,
3686 + user->commit_trans, user->rollback_trans,
3687 + user->denied_connections, user->lost_connections,
3688 + user->access_denied_errors, user->empty_queries);
3690 + if (my_hash_insert(agg_user_stats, (byte*)agg_user))
3693 + my_free((char*)agg_user, 0);
3694 + sql_print_error("Malloc in aggregate_user_stats failed");
3700 + // Aggregate with existing values for this role.
3701 + add_user_stats(agg_user,
3702 + user->total_connections, user->concurrent_connections,
3703 + user->connected_time, user->busy_time, user->cpu_time,
3704 + user->bytes_received, user->bytes_sent,
3705 + user->binlog_bytes_written,
3706 + user->rows_fetched, user->rows_updated, user->rows_read,
3707 + user->select_commands, user->update_commands,
3708 + user->other_commands,
3709 + user->commit_trans, user->rollback_trans,
3710 + user->denied_connections, user->lost_connections,
3711 + user->access_denied_errors, user->empty_queries);
3714 + DBUG_PRINT("exit", ("aggregated %d input into %d output entries",
3715 + all_user_stats->records, agg_user_stats->records));
3720 + Write result to network for SHOW USER_STATISTICS
3724 + all_user_stats - values to return
3731 +int send_user_stats(THD* thd, HASH *all_user_stats, TABLE *table)
3733 + DBUG_ENTER("send_user_stats");
3734 + for (int i = 0; i < all_user_stats->records; ++i) {
3735 + restore_record(table, s->default_values);
3736 + USER_STATS *user_stats = (USER_STATS*)hash_element(all_user_stats, i);
3737 + table->field[0]->store(user_stats->user, strlen(user_stats->user), system_charset_info);
3738 + table->field[1]->store((longlong)user_stats->total_connections);
3739 + table->field[2]->store((longlong)user_stats->concurrent_connections);
3740 + table->field[3]->store((longlong)user_stats->connected_time);
3741 + table->field[4]->store((longlong)user_stats->busy_time);
3742 + table->field[5]->store((longlong)user_stats->cpu_time);
3743 + table->field[6]->store((longlong)user_stats->bytes_received);
3744 + table->field[7]->store((longlong)user_stats->bytes_sent);
3745 + table->field[8]->store((longlong)user_stats->binlog_bytes_written);
3746 + table->field[9]->store((longlong)user_stats->rows_fetched);
3747 + table->field[10]->store((longlong)user_stats->rows_updated);
3748 + table->field[11]->store((longlong)user_stats->rows_read);
3749 + table->field[12]->store((longlong)user_stats->select_commands);
3750 + table->field[13]->store((longlong)user_stats->update_commands);
3751 + table->field[14]->store((longlong)user_stats->other_commands);
3752 + table->field[15]->store((longlong)user_stats->commit_trans);
3753 + table->field[16]->store((longlong)user_stats->rollback_trans);
3754 + table->field[17]->store((longlong)user_stats->denied_connections);
3755 + table->field[18]->store((longlong)user_stats->lost_connections);
3756 + table->field[19]->store((longlong)user_stats->access_denied_errors);
3757 + table->field[20]->store((longlong)user_stats->empty_queries);
3758 + if (schema_table_store_record(thd, table))
3760 + DBUG_PRINT("error", ("store record error"));
3768 + Process SHOW USER_STATISTICS
3771 + mysqld_show_user_stats
3772 + thd - current thread
3773 + wild - limit results to the entry for this user
3774 + with_roles - when true, display role for mapped users
3782 +int fill_schema_user_stats(THD* thd, TABLE_LIST* tables, COND* cond)
3784 + TABLE *table= tables->table;
3785 + DBUG_ENTER("fill_schema_user_stats");
3787 + if (check_global_access(thd, SUPER_ACL | PROCESS_ACL))
3790 + // Iterates through all the global stats and sends them to the client.
3791 + // Pattern matching on the client IP is supported.
3793 + pthread_mutex_lock(&LOCK_global_user_client_stats);
3794 + int result= send_user_stats(thd, &global_user_stats, table);
3795 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
3799 + DBUG_PRINT("exit", ("fill_schema_user_stats result is 0"));
3803 + DBUG_PRINT("exit", ("fill_schema_user_stats result is 1"));
3808 + Process SHOW CLIENT_STATISTICS
3811 + mysqld_show_client_stats
3812 + thd - current thread
3813 + wild - limit results to the entry for this client
3821 +int fill_schema_client_stats(THD* thd, TABLE_LIST* tables, COND* cond)
3823 + TABLE *table= tables->table;
3824 + DBUG_ENTER("fill_schema_client_stats");
3826 + if (check_global_access(thd, SUPER_ACL | PROCESS_ACL))
3829 + // Iterates through all the global stats and sends them to the client.
3830 + // Pattern matching on the client IP is supported.
3832 + pthread_mutex_lock(&LOCK_global_user_client_stats);
3833 + int result= send_user_stats(thd, &global_client_stats, table);
3834 + pthread_mutex_unlock(&LOCK_global_user_client_stats);
3838 + DBUG_PRINT("exit", ("mysqld_show_client_stats result is 0"));
3842 + DBUG_PRINT("exit", ("mysqld_show_client_stats result is 1"));
3847 +// Sends the global table stats back to the client.
3848 +int fill_schema_table_stats(THD* thd, TABLE_LIST* tables, COND* cond)
3850 + TABLE *table= tables->table;
3851 + DBUG_ENTER("fill_schema_table_stats");
3852 + char *table_full_name, *table_schema;
3854 + pthread_mutex_lock(&LOCK_global_table_stats);
3855 + for (int i = 0; i < global_table_stats.records; ++i) {
3856 + restore_record(table, s->default_values);
3857 + TABLE_STATS *table_stats =
3858 + (TABLE_STATS*)hash_element(&global_table_stats, i);
3860 + table_full_name= thd->strdup(table_stats->table);
3861 + table_schema= strsep(&table_full_name, ".");
3863 + TABLE_LIST tmp_table;
3864 + bzero((char*) &tmp_table,sizeof(tmp_table));
3865 + tmp_table.table_name= table_full_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_full_name, strlen(table_full_name), system_charset_info);
3876 + table->field[2]->store((longlong)table_stats->rows_read, TRUE);
3877 + table->field[3]->store((longlong)table_stats->rows_changed, TRUE);
3878 + table->field[4]->store((longlong)table_stats->rows_changed_x_indexes, TRUE);
3880 + if (schema_table_store_record(thd, table))
3882 + VOID(pthread_mutex_unlock(&LOCK_global_table_stats));
3886 + pthread_mutex_unlock(&LOCK_global_table_stats);
3890 +// Sends the global index stats back to the client.
3891 +int fill_schema_index_stats(THD* thd, TABLE_LIST* tables, COND* cond)
3893 + TABLE *table= tables->table;
3894 + DBUG_ENTER("fill_schema_index_stats");
3895 + char *index_full_name, *table_schema, *table_name;
3897 + pthread_mutex_lock(&LOCK_global_index_stats);
3898 + for (int i = 0; i < global_index_stats.records; ++i) {
3899 + restore_record(table, s->default_values);
3900 + INDEX_STATS *index_stats =
3901 + (INDEX_STATS*)hash_element(&global_index_stats, i);
3903 + index_full_name= thd->strdup(index_stats->index);
3904 + table_schema= strsep(&index_full_name, ".");
3905 + table_name= strsep(&index_full_name, ".");
3907 + TABLE_LIST tmp_table;
3908 + bzero((char*) &tmp_table,sizeof(tmp_table));
3909 + tmp_table.table_name= table_name;
3910 + tmp_table.db= table_schema;
3911 + tmp_table.grant.privilege= 0;
3912 + if (check_access(thd, SELECT_ACL | EXTRA_ACL, tmp_table.db,
3913 + &tmp_table.grant.privilege, 0, 0,
3914 + is_schema_db(table_schema)) ||
3915 + grant_option && check_grant(thd, SELECT_ACL, &tmp_table, 1, UINT_MAX, 1))
3918 + table->field[0]->store(table_schema, strlen(table_schema), system_charset_info);
3919 + table->field[1]->store(table_name, strlen(table_name), system_charset_info);
3920 + table->field[2]->store(index_full_name, strlen(index_full_name), system_charset_info);
3921 + table->field[3]->store((longlong)index_stats->rows_read, TRUE);
3923 + if (schema_table_store_record(thd, table))
3925 + VOID(pthread_mutex_unlock(&LOCK_global_index_stats));
3929 + pthread_mutex_unlock(&LOCK_global_index_stats);
3933 /* collect status for all running threads */
3935 @@ -4482,6 +4777,77 @@
3936 {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3939 +ST_FIELD_INFO user_stats_fields_info[]=
3941 + {"USER", 16, MYSQL_TYPE_STRING, 0, 0, "User"},
3942 + {"TOTAL_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Total_connections"},
3943 + {"CONCURRENT_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Concurrent_connections"},
3944 + {"CONNECTED_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Connected_time"},
3945 + {"BUSY_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Busy_time"},
3946 + {"CPU_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Cpu_time"},
3947 + {"BYTES_RECEIVED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_received"},
3948 + {"BYTES_SENT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_sent"},
3949 + {"BINLOG_BYTES_WRITTEN", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Binlog_bytes_written"},
3950 + {"ROWS_FETCHED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_fetched"},
3951 + {"ROWS_UPDATED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_updated"},
3952 + {"TABLE_ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Table_rows_read"},
3953 + {"SELECT_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Select_commands"},
3954 + {"UPDATE_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Update_commands"},
3955 + {"OTHER_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Other_commands"},
3956 + {"COMMIT_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Commit_transactions"},
3957 + {"ROLLBACK_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rollback_transactions"},
3958 + {"DENIED_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Denied_connections"},
3959 + {"LOST_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Lost_connections"},
3960 + {"ACCESS_DENIED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Access_denied"},
3961 + {"EMPTY_QUERIES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Empty_queries"},
3962 + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3965 +ST_FIELD_INFO client_stats_fields_info[]=
3967 + {"CLIENT", 16, MYSQL_TYPE_STRING, 0, 0, "Client"},
3968 + {"TOTAL_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Total_connections"},
3969 + {"CONCURRENT_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Concurrent_connections"},
3970 + {"CONNECTED_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Connected_time"},
3971 + {"BUSY_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Busy_time"},
3972 + {"CPU_TIME", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Cpu_time"},
3973 + {"BYTES_RECEIVED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_received"},
3974 + {"BYTES_SENT", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Bytes_sent"},
3975 + {"BINLOG_BYTES_WRITTEN", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Binlog_bytes_written"},
3976 + {"ROWS_FETCHED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_fetched"},
3977 + {"ROWS_UPDATED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_updated"},
3978 + {"TABLE_ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Table_rows_read"},
3979 + {"SELECT_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Select_commands"},
3980 + {"UPDATE_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Update_commands"},
3981 + {"OTHER_COMMANDS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Other_commands"},
3982 + {"COMMIT_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Commit_transactions"},
3983 + {"ROLLBACK_TRANSACTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rollback_transactions"},
3984 + {"DENIED_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Denied_connections"},
3985 + {"LOST_CONNECTIONS", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Lost_connections"},
3986 + {"ACCESS_DENIED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Access_denied"},
3987 + {"EMPTY_QUERIES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Empty_queries"},
3988 + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
3992 +ST_FIELD_INFO table_stats_fields_info[]=
3994 + {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_schema"},
3995 + {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_name"},
3996 + {"ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_read"},
3997 + {"ROWS_CHANGED", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_changed"},
3998 + {"ROWS_CHANGED_X_INDEXES", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_changed_x_#indexes"},
3999 + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
4002 +ST_FIELD_INFO index_stats_fields_info[]=
4004 + {"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_schema"},
4005 + {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table_name"},
4006 + {"INDEX_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Index_name"},
4007 + {"ROWS_READ", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "Rows_read"},
4008 + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
4012 Description of ST_FIELD_INFO in table.h
4013 @@ -4491,6 +4857,8 @@
4015 {"CHARACTER_SETS", charsets_fields_info, create_schema_table,
4016 fill_schema_charsets, make_character_sets_old_format, 0, -1, -1, 0},
4017 + {"CLIENT_STATISTICS", client_stats_fields_info, create_schema_table,
4018 + fill_schema_client_stats, make_old_format, 0, -1, -1, 0},
4019 {"COLLATIONS", collation_fields_info, create_schema_table,
4020 fill_schema_collation, make_old_format, 0, -1, -1, 0},
4021 {"COLLATION_CHARACTER_SET_APPLICABILITY", coll_charset_app_fields_info,
4022 @@ -4499,6 +4867,8 @@
4023 get_all_tables, make_columns_old_format, get_schema_column_record, 1, 2, 0},
4024 {"COLUMN_PRIVILEGES", column_privileges_fields_info, create_schema_table,
4025 fill_schema_column_privileges, 0, 0, -1, -1, 0},
4026 + {"INDEX_STATISTICS", index_stats_fields_info, create_schema_table,
4027 + fill_schema_index_stats, make_old_format, 0, -1, -1, 0},
4028 {"KEY_COLUMN_USAGE", key_column_usage_fields_info, create_schema_table,
4029 get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0},
4030 {"OPEN_TABLES", open_tables_fields_info, create_schema_table,
4031 @@ -4524,10 +4894,14 @@
4032 get_all_tables, make_table_names_old_format, 0, 1, 2, 1},
4033 {"TABLE_PRIVILEGES", table_privileges_fields_info, create_schema_table,
4034 fill_schema_table_privileges, 0, 0, -1, -1, 0},
4035 + {"TABLE_STATISTICS", table_stats_fields_info, create_schema_table,
4036 + fill_schema_table_stats, make_old_format, 0, -1, -1, 0},
4037 {"TRIGGERS", triggers_fields_info, create_schema_table,
4038 get_all_tables, make_old_format, get_schema_triggers_record, 5, 6, 0},
4039 {"USER_PRIVILEGES", user_privileges_fields_info, create_schema_table,
4040 fill_schema_user_privileges, 0, 0, -1, -1, 0},
4041 + {"USER_STATISTICS", user_stats_fields_info, create_schema_table,
4042 + fill_schema_user_stats, make_old_format, 0, -1, -1, 0},
4043 {"VARIABLES", variables_fields_info, create_schema_table, fill_variables,
4044 make_old_format, 0, -1, -1, 1},
4045 {"VIEWS", view_fields_info, create_schema_table,
4046 diff -r 23e5576aa59a sql/sql_update.cc
4047 --- a/sql/sql_update.cc Tue Feb 17 22:33:00 2009 -0800
4048 +++ b/sql/sql_update.cc Tue Feb 17 22:33:23 2009 -0800
4050 (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
4051 send_ok(thd, (ulong) thd->row_count_func,
4052 thd->insert_id_used ? thd->last_insert_id : 0L,buff);
4053 - DBUG_PRINT("info",("%ld records updated", (long) updated));
4054 + thd->updated_row_count += thd->row_count_func;
4055 + DBUG_PRINT("info",("%d records updated",updated));
4057 thd->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */
4058 thd->abort_on_warning= 0;
4059 @@ -1832,5 +1833,6 @@
4060 (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
4061 ::send_ok(thd, (ulong) thd->row_count_func,
4062 thd->insert_id_used ? thd->last_insert_id : 0L,buff);
4063 + thd->updated_row_count += thd->row_count_func;
4066 diff -r 23e5576aa59a sql/sql_yacc.yy
4067 --- a/sql/sql_yacc.yy Tue Feb 17 22:33:00 2009 -0800
4068 +++ b/sql/sql_yacc.yy Tue Feb 17 22:33:23 2009 -0800
4073 +%token CLIENT_STATS_SYM
4081 +%token INDEX_STATS_SYM
4097 +%token TABLE_STATS_SYM
4099 %token TEMPTABLE_SYM
4105 +%token USER_STATS_SYM
4109 @@ -8244,6 +8249,38 @@
4111 Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
4113 + | CLIENT_STATS_SYM wild_and_where
4116 + Lex->sql_command = SQLCOM_SELECT;
4117 + lex->orig_sql_command= SQLCOM_SHOW_CLIENT_STATS;
4118 + if (prepare_schema_table(YYTHD, lex, 0, SCH_CLIENT_STATS))
4121 + | USER_STATS_SYM wild_and_where
4124 + lex->sql_command = SQLCOM_SELECT;
4125 + lex->orig_sql_command= SQLCOM_SHOW_USER_STATS;
4126 + if (prepare_schema_table(YYTHD, lex, 0, SCH_USER_STATS))
4129 + | TABLE_STATS_SYM wild_and_where
4132 + lex->sql_command= SQLCOM_SELECT;
4133 + lex->orig_sql_command= SQLCOM_SHOW_TABLE_STATS;
4134 + if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_STATS))
4137 + | INDEX_STATS_SYM wild_and_where
4140 + lex->sql_command= SQLCOM_SELECT;
4141 + lex->orig_sql_command= SQLCOM_SHOW_INDEX_STATS;
4142 + if (prepare_schema_table(YYTHD, lex, 0, SCH_INDEX_STATS))
4145 | CREATE PROCEDURE sp_name
4148 @@ -8448,9 +8485,14 @@
4149 | LOGS_SYM { Lex->type|= REFRESH_LOG; }
4150 | STATUS_SYM { Lex->type|= REFRESH_STATUS; }
4151 | SLAVE { Lex->type|= REFRESH_SLAVE; }
4152 + | SLOW_SYM QUERY_SYM LOGS_SYM { Lex->type |= REFRESH_SLOW_QUERY_LOG; }
4153 | MASTER_SYM { Lex->type|= REFRESH_MASTER; }
4154 | DES_KEY_FILE { Lex->type|= REFRESH_DES_KEY_FILE; }
4155 - | RESOURCES { Lex->type|= REFRESH_USER_RESOURCES; };
4156 + | RESOURCES { Lex->type|= REFRESH_USER_RESOURCES; }
4157 + | CLIENT_STATS_SYM { Lex->type|= REFRESH_CLIENT_STATS; }
4158 + | USER_STATS_SYM { Lex->type|= REFRESH_USER_STATS; }
4159 + | TABLE_STATS_SYM { Lex->type|= REFRESH_TABLE_STATS; }
4160 + | INDEX_STATS_SYM { Lex->type|= REFRESH_INDEX_STATS; };
4164 @@ -9439,6 +9481,7 @@
4168 + | CLIENT_STATS_SYM {}
4172 @@ -9491,6 +9534,7 @@
4176 + | INDEX_STATS_SYM {}
4180 @@ -9600,6 +9644,7 @@
4188 @@ -9616,6 +9661,7 @@
4192 + | TABLE_STATS_SYM {}
4196 @@ -9636,6 +9682,7 @@
4200 + | USER_STATS_SYM {}
4204 diff -r 23e5576aa59a sql/structs.h
4205 --- a/sql/structs.h Tue Feb 17 22:33:00 2009 -0800
4206 +++ b/sql/structs.h Tue Feb 17 22:33:23 2009 -0800
4207 @@ -273,6 +273,98 @@
4211 +typedef struct st_user_stats {
4212 + char user[USERNAME_LENGTH + 1];
4213 + // Account name the user is mapped to when this is a user from mapped_user.
4214 + // Otherwise, the same value as user.
4215 + char priv_user[USERNAME_LENGTH + 1];
4216 + uint total_connections;
4217 + uint concurrent_connections;
4218 + time_t connected_time; // in seconds
4219 + double busy_time; // in seconds
4220 + double cpu_time; // in seconds
4221 + ulonglong bytes_received;
4222 + ulonglong bytes_sent;
4223 + ulonglong binlog_bytes_written;
4224 + ha_rows rows_fetched, rows_updated, rows_read;
4225 + ulonglong select_commands, update_commands, other_commands;
4226 + ulonglong commit_trans, rollback_trans;
4227 + ulonglong denied_connections, lost_connections;
4228 + ulonglong access_denied_errors;
4229 + ulonglong empty_queries;
4232 +/* Lookup function for hash tables with USER_STATS entries */
4233 +extern byte *get_key_user_stats(USER_STATS *user_stats, uint *length,
4234 + my_bool not_used __attribute__((unused)));
4236 +/* Free all memory for a hash table with USER_STATS entries */
4237 +extern void free_user_stats(USER_STATS* user_stats);
4239 +/* Intialize an instance of USER_STATS */
4241 +init_user_stats(USER_STATS *user_stats,
4243 + const char *priv_user,
4244 + uint total_connections,
4245 + uint concurrent_connections,
4246 + time_t connected_time,
4249 + ulonglong bytes_received,
4250 + ulonglong bytes_sent,
4251 + ulonglong binlog_bytes_written,
4252 + ha_rows rows_fetched,
4253 + ha_rows rows_updated,
4254 + ha_rows rows_read,
4255 + ulonglong select_commands,
4256 + ulonglong update_commands,
4257 + ulonglong other_commands,
4258 + ulonglong commit_trans,
4259 + ulonglong rollback_trans,
4260 + ulonglong denied_connections,
4261 + ulonglong lost_connections,
4262 + ulonglong access_denied_errors,
4263 + ulonglong empty_queries);
4265 +/* Increment values of an instance of USER_STATS */
4267 +add_user_stats(USER_STATS *user_stats,
4268 + uint total_connections,
4269 + uint concurrent_connections,
4270 + time_t connected_time,
4273 + ulonglong bytes_received,
4274 + ulonglong bytes_sent,
4275 + ulonglong binlog_bytes_written,
4276 + ha_rows rows_fetched,
4277 + ha_rows rows_updated,
4278 + ha_rows rows_read,
4279 + ulonglong select_commands,
4280 + ulonglong update_commands,
4281 + ulonglong other_commands,
4282 + ulonglong commit_trans,
4283 + ulonglong rollback_trans,
4284 + ulonglong denied_connections,
4285 + ulonglong lost_connections,
4286 + ulonglong access_denied_errors,
4287 + ulonglong empty_queries);
4289 +typedef struct st_table_stats {
4290 + char table[NAME_LEN * 2 + 2]; // [db] + '.' + [table] + '\0'
4291 + ulonglong rows_read, rows_changed;
4292 + ulonglong rows_changed_x_indexes;
4293 + /* Stores enum db_type, but forward declarations cannot be done */
4297 +typedef struct st_index_stats {
4298 + char index[NAME_LEN * 3 + 3]; // [db] + '.' + [table] + '.' + [index] + '\0'
4299 + ulonglong rows_read;
4303 /* Bits in form->update */
4304 #define REG_MAKE_DUPP 1 /* Make a copy of record when read */
4305 #define REG_NEW_RECORD 2 /* Write a new record if not found */
4306 diff -r 23e5576aa59a sql/table.h
4307 --- a/sql/table.h Tue Feb 17 22:33:00 2009 -0800
4308 +++ b/sql/table.h Tue Feb 17 22:33:23 2009 -0800
4309 @@ -371,10 +371,12 @@
4310 enum enum_schema_tables
4315 SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
4317 SCH_COLUMN_PRIVILEGES,
4319 SCH_KEY_COLUMN_USAGE,
4322 @@ -387,8 +389,10 @@
4323 SCH_TABLE_CONSTRAINTS,
4325 SCH_TABLE_PRIVILEGES,
4328 SCH_USER_PRIVILEGES,
4333 diff -r 23e5576aa59a strings/Makefile.in
4334 --- a/strings/Makefile.in Tue Feb 17 22:33:00 2009 -0800
4335 +++ b/strings/Makefile.in Tue Feb 17 22:33:23 2009 -0800
4338 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4343 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4344 diff -r 23e5576aa59a support-files/MacOSX/Makefile.in
4345 --- a/support-files/MacOSX/Makefile.in Tue Feb 17 22:33:00 2009 -0800
4346 +++ b/support-files/MacOSX/Makefile.in Tue Feb 17 22:33:23 2009 -0800
4349 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4354 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4355 diff -r 23e5576aa59a support-files/Makefile.in
4356 --- a/support-files/Makefile.in Tue Feb 17 22:33:00 2009 -0800
4357 +++ b/support-files/Makefile.in Tue Feb 17 22:33:23 2009 -0800
4360 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4365 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4366 diff -r 23e5576aa59a support-files/RHEL4-SElinux/Makefile.in
4367 --- a/support-files/RHEL4-SElinux/Makefile.in Tue Feb 17 22:33:00 2009 -0800
4368 +++ b/support-files/RHEL4-SElinux/Makefile.in Tue Feb 17 22:33:23 2009 -0800
4371 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4376 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4377 diff -r 23e5576aa59a tests/Makefile.in
4378 --- a/tests/Makefile.in Tue Feb 17 22:33:00 2009 -0800
4379 +++ b/tests/Makefile.in Tue Feb 17 22:33:23 2009 -0800
4382 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4385 LIBS = @CLIENT_LIBS@
4387 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4388 diff -r 23e5576aa59a tools/Makefile.in
4389 --- a/tools/Makefile.in Tue Feb 17 22:33:00 2009 -0800
4390 +++ b/tools/Makefile.in Tue Feb 17 22:33:23 2009 -0800
4393 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4398 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4399 diff -r 23e5576aa59a vio/Makefile.in
4400 --- a/vio/Makefile.in Tue Feb 17 22:33:00 2009 -0800
4401 +++ b/vio/Makefile.in Tue Feb 17 22:33:23 2009 -0800
4404 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4409 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4410 diff -r 23e5576aa59a win/Makefile.in
4411 --- a/win/Makefile.in Tue Feb 17 22:33:00 2009 -0800
4412 +++ b/win/Makefile.in Tue Feb 17 22:33:23 2009 -0800
4415 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4420 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
4421 diff -r 23e5576aa59a zlib/Makefile.in
4422 --- a/zlib/Makefile.in Tue Feb 17 22:33:00 2009 -0800
4423 +++ b/zlib/Makefile.in Tue Feb 17 22:33:23 2009 -0800
4426 LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
4429 LIBS = $(NON_THREADED_LIBS)
4431 LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@