Skip to content

Commit 71a0ece

Browse files
author
cmiller@zippy.cornsilk.net
committed
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-enterprise-formergecomm
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-unified02
2 parents db6eab9 + 9dd7812 commit 71a0ece

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2285
-192
lines changed

BitKeeper/etc/collapsed

+16
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,25 @@
3838
459a70691aYIfU2ohV0a3P5iTLpO2A
3939
459a7422KF_P7PuU3YQ5qG6ZLEVpiA
4040
459a74e4nRcXppMSBYeQQ5efDkTADg
41+
459c03b9N_mqF2XJKK6DwSrIt7e6_g
42+
459c1965_BQMBzBO8S_gVqjTHYQrmw
43+
459c2098XoAUsUn8N07IVRDD6CTM-A
44+
459ea845XenN-uWqEM5LFvUT60tW_A
4145
45ae6628gqKTsUFfnoNExadETVIkbA
46+
45af88c9RIIJWPfBxs3o7zekI-ELPQ
4247
45ba4faf2oqu6eR8fqecR3LfSNcYUg
4348
45ba5238-NKl80QVXzdGo8hO9M75Xg
4449
45c0fdfb2mz6NdOIsLenJtf6_ZelTA
50+
45c38d90tNwOTSaYKHXd3ccLtnytlQ
51+
45c390d6BbWrwyEi5T5VsWKYxl06Rg
52+
45c39d31g0iik6UE_oTK5N55ry-ycA
4553
45d1ffcd-r3v8A7uh92hQaMfQM9UPQ
4654
45d21437Vg_-i4uOWyvzYWHESXDP6A
55+
45da6370nnZlAAIieMCrXkxF9toOyQ
56+
45da6551zUuplwxuqcT2fhRgceC0CQ
57+
45db0d4bkGtxBk21sZFJgbCV1FcNRg
58+
45db468b-DKE8kUTV42eYMYmk8_g9g
59+
45dd21d1rVPnDfvZTNVHLalcjnbsZw
60+
45ddaf15_Ld7IAEpUUP3FJjJ-oSEFg
61+
45ddc763DodLG1BqH_wRBJXMbCSB5A
62+
45ddc8282KnaNGuijqCTphlXV_eeog

client/mysqlcheck.c

+15-12
Original file line numberDiff line numberDiff line change
@@ -472,14 +472,17 @@ static int process_all_tables_in_db(char *database)
472472
{
473473
MYSQL_RES *res;
474474
MYSQL_ROW row;
475+
uint num_columns;
475476

476477
LINT_INIT(res);
477478
if (use_db(database))
478479
return 1;
479-
if (mysql_query(sock, "SHOW TABLE STATUS") ||
480+
if (mysql_query(sock, "SHOW /*!50002 FULL*/ TABLES") ||
480481
!((res= mysql_store_result(sock))))
481482
return 1;
482483

484+
num_columns= mysql_num_fields(res);
485+
483486
if (opt_all_in_1)
484487
{
485488
/*
@@ -502,12 +505,11 @@ static int process_all_tables_in_db(char *database)
502505
}
503506
for (end = tables + 1; (row = mysql_fetch_row(res)) ;)
504507
{
505-
/* Skip tables with an engine of NULL (probably a view). */
506-
if (row[1])
507-
{
508-
end= fix_table_name(end, row[0]);
509-
*end++= ',';
510-
}
508+
if ((num_columns == 2) && (strcmp(row[1], "VIEW") == 0))
509+
continue;
510+
511+
end= fix_table_name(end, row[0]);
512+
*end++= ',';
511513
}
512514
*--end = 0;
513515
if (tot_length)
@@ -517,11 +519,12 @@ static int process_all_tables_in_db(char *database)
517519
else
518520
{
519521
while ((row = mysql_fetch_row(res)))
520-
/* Skip tables with an engine of NULL (probably a view). */
521-
if (row[1])
522-
{
523-
handle_request_for_tables(row[0], strlen(row[0]));
524-
}
522+
{
523+
if ((num_columns == 2) && (strcmp(row[1], "VIEW") == 0))
524+
continue;
525+
526+
handle_request_for_tables(row[0], strlen(row[0]));
527+
}
525528
}
526529
mysql_free_result(res);
527530
return 0;

configure.in

+44-11
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ AC_CANONICAL_SYSTEM
1212
# in mysqlbinlog::check_master_version().
1313
AM_INIT_AUTOMAKE(mysql, 5.1.18-beta)
1414
AM_CONFIG_HEADER(config.h)
15+
is_this_community_tree=no
1516

1617
PROTOCOL_VERSION=10
1718
DOT_FRM_VERSION=6
@@ -578,6 +579,23 @@ then
578579
fi
579580
fi
580581

582+
AC_MSG_CHECKING(whether features provided by the user community should be included.)
583+
AC_ARG_ENABLE(community-features,
584+
AC_HELP_STRING(
585+
[--enable-community-features],
586+
[Enable additional features provided by the user community.]),
587+
[ ENABLE_COMMUNITY_FEATURES=$enableval ],
588+
[ ENABLE_COMMUNITY_FEATURES=$is_this_community_tree ]
589+
)
590+
591+
if test "$ENABLE_COMMUNITY_FEATURES" = "yes"
592+
then
593+
AC_DEFINE([COMMUNITY_SERVER], [1],
594+
[Whether features provided by the user community should be included])
595+
AC_MSG_RESULT([yes, community server])
596+
else
597+
AC_MSG_RESULT([no, enterprise server])
598+
fi
581599

582600
AC_ARG_WITH(server-suffix,
583601
[ --with-server-suffix Append value to the version string.],
@@ -641,6 +659,27 @@ else
641659
AC_MSG_RESULT([no])
642660
fi
643661

662+
# Add query profiler
663+
AC_MSG_CHECKING(if SHOW PROFILE should be enabled.)
664+
AC_ARG_ENABLE(profiling,
665+
AS_HELP_STRING([--disable-profiling], [Build a version without query profiling code]),
666+
[ ENABLED_PROFILING=$enableval ],
667+
[ ENABLED_PROFILING=$is_this_community_tree ])
668+
669+
if test "$ENABLED_PROFILING" = "yes"
670+
then
671+
if test "$ENABLE_COMMUNITY_FEATURES" = "yes";
672+
then
673+
AC_DEFINE([ENABLED_PROFILING], [1],
674+
[If SHOW PROFILE should be enabled])
675+
AC_MSG_RESULT([yes])
676+
else
677+
ENABLED_PROFILING="no"
678+
AC_MSG_RESULT([no, overridden by community-features disabled])
679+
fi
680+
else
681+
AC_MSG_RESULT([no])
682+
fi
644683

645684
# Use this to set the place used for unix socket used to local communication.
646685
AC_ARG_WITH(unix-socket-path,
@@ -745,6 +784,7 @@ AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
745784
AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
746785
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
747786
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
787+
AC_SEARCH_LIBS(inet_aton, [socket nsl resolv])
748788

749789
# For the sched_yield() function on Solaris
750790
AC_CHECK_FUNC(sched_yield, , AC_CHECK_LIB(posix4, sched_yield))
@@ -988,7 +1028,6 @@ case $SYSTEM_TYPE in
9881028
fi
9891029
;;
9901030
*darwin*)
991-
AC_DEFINE([DEFAULT_SKIP_THREAD_PRIORITY], [1], [default to skip thread priority])
9921031
if test "$ac_cv_prog_gcc" = "yes"
9931032
then
9941033
FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL"
@@ -2457,15 +2496,13 @@ thread_dirs=
24572496

24582497
dnl This probably should be cleaned up more - for now the threaded
24592498
dnl client is just using plain-old libs.
2460-
sql_client_dirs=
2499+
sql_client_dirs="strings regex mysys libmysql client"
24612500

24622501
AM_CONDITIONAL(THREAD_SAFE_CLIENT, test "$THREAD_SAFE_CLIENT" != "no")
24632502

2464-
if test "$THREAD_SAFE_CLIENT" = "no"
2503+
if test "$THREAD_SAFE_CLIENT" != "no"
24652504
then
2466-
sql_client_dirs="strings regex mysys dbug extra libmysql client"
2467-
else
2468-
sql_client_dirs="strings regex mysys dbug extra libmysql libmysql_r client"
2505+
sql_client_dirs="libmysql_r $sql_client_dirs"
24692506
AC_CONFIG_FILES(libmysql_r/Makefile)
24702507
AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should the client be thread safe])
24712508
fi
@@ -2487,17 +2524,13 @@ fi
24872524
AC_SUBST(netware_dir)
24882525
AM_CONDITIONAL(HAVE_NETWARE, test "$netware_dir" = "netware")
24892526

2490-
if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"
2527+
if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no"
24912528
then
24922529
AC_DEFINE([THREAD], [1],
24932530
[Define if you want to have threaded code. This may be undef on client code])
24942531
# Avoid _PROGRAMS names
24952532
THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o mf_keycache.o"
24962533
AC_SUBST(THREAD_LOBJECTS)
2497-
fi
2498-
2499-
if test "$with_server" != "no"
2500-
then
25012534
server_scripts="mysqld_safe mysql_install_db"
25022535
sql_server_dirs="strings mysys dbug extra regex"
25032536

include/config-win.h

+3
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ typedef uint rf_SetTimer;
206206
/* If LOAD DATA LOCAL INFILE should be enabled by default */
207207
#define ENABLED_LOCAL_INFILE 1
208208

209+
/* If query profiling should be enabled by default */
210+
#define ENABLED_PROFILING 1
211+
209212
/* Convert some simple functions to Posix */
210213

211214
#define my_sigset(A,B) signal((A),(B))

libmysqld/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
5959
protocol.cc net_serv.cc opt_range.cc \
6060
opt_sum.cc procedure.cc records.cc sql_acl.cc \
6161
sql_load.cc discover.cc sql_locale.cc \
62+
sql_profile.cc \
6263
sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
6364
sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \
6465
sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc \

mysql-test/include/profiling.inc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- require r/profiling.require
2+
disable_query_log;
3+
show variables like "profiling";
4+
enable_query_log;

mysql-test/r/information_schema.result

+13-2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ KEY_COLUMN_USAGE
5050
PARTITIONS
5151
PLUGINS
5252
PROCESSLIST
53+
PROFILING
5354
REFERENTIAL_CONSTRAINTS
5455
ROUTINES
5556
SCHEMATA
@@ -852,7 +853,7 @@ delete from mysql.db where user='mysqltest_4';
852853
flush privileges;
853854
SELECT table_schema, count(*) FROM information_schema.TABLES where table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
854855
table_schema count(*)
855-
information_schema 27
856+
information_schema 28
856857
mysql 22
857858
create table t1 (i int, j int);
858859
create trigger trg1 before insert on t1 for each row
@@ -1146,7 +1147,7 @@ table_schema='information_schema' and
11461147
group by column_type order by num;
11471148
column_type group_concat(table_schema, '.', table_name) num
11481149
varchar(7) information_schema.ROUTINES,information_schema.VIEWS 2
1149-
varchar(20) information_schema.COLUMNS,information_schema.FILES,information_schema.FILES,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PLUGINS 6
1150+
varchar(20) information_schema.COLUMNS,information_schema.FILES,information_schema.FILES,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PROFILING 7
11501151
create table t1(f1 char(1) not null, f2 char(9) not null)
11511152
default character set utf8;
11521153
select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from
@@ -1251,6 +1252,7 @@ KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
12511252
PARTITIONS TABLE_SCHEMA
12521253
PLUGINS PLUGIN_NAME
12531254
PROCESSLIST ID
1255+
PROFILING QUERY_ID
12541256
REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
12551257
ROUTINES ROUTINE_SCHEMA
12561258
SCHEMATA SCHEMA_NAME
@@ -1293,6 +1295,7 @@ KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
12931295
PARTITIONS TABLE_SCHEMA
12941296
PLUGINS PLUGIN_NAME
12951297
PROCESSLIST ID
1298+
PROFILING QUERY_ID
12961299
REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
12971300
ROUTINES ROUTINE_SCHEMA
12981301
SCHEMATA SCHEMA_NAME
@@ -1386,6 +1389,7 @@ KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
13861389
PARTITIONS information_schema.PARTITIONS 1
13871390
PLUGINS information_schema.PLUGINS 1
13881391
PROCESSLIST information_schema.PROCESSLIST 1
1392+
PROFILING information_schema.PROFILING 1
13891393
REFERENTIAL_CONSTRAINTS information_schema.REFERENTIAL_CONSTRAINTS 1
13901394
ROUTINES information_schema.ROUTINES 1
13911395
SCHEMATA information_schema.SCHEMATA 1
@@ -1399,6 +1403,13 @@ TABLE_PRIVILEGES information_schema.TABLE_PRIVILEGES 1
13991403
TRIGGERS information_schema.TRIGGERS 1
14001404
USER_PRIVILEGES information_schema.USER_PRIVILEGES 1
14011405
VIEWS information_schema.VIEWS 1
1406+
show global status like "Uptime_%";
1407+
Variable_name Value
1408+
Uptime_since_flush_status #
1409+
flush status;
1410+
show global status like "Uptime_%";
1411+
Variable_name Value
1412+
Uptime_since_flush_status #
14021413
End of 5.0 tests.
14031414
select * from information_schema.engines WHERE ENGINE="MyISAM";
14041415
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS

mysql-test/r/information_schema_db.result

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ KEY_COLUMN_USAGE
1919
PARTITIONS
2020
PLUGINS
2121
PROCESSLIST
22+
PROFILING
2223
REFERENTIAL_CONSTRAINTS
2324
ROUTINES
2425
SCHEMATA

mysql-test/r/mysqlcheck.result

+35
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,39 @@ test.t1 OK
5757
test.t1 OK
5858
drop view v1;
5959
drop table t1;
60+
create database d_bug25347;
61+
use d_bug25347;
62+
create table t_bug25347 (a int);
63+
create view v_bug25347 as select * from t_bug25347;
64+
insert into t_bug25347 values (1),(2),(3);
65+
flush tables;
66+
removing and creating
67+
d_bug25347.t_bug25347
68+
error : Incorrect file format 't_bug25347'
69+
insert into t_bug25347 values (4),(5),(6);
70+
ERROR HY000: Incorrect file format 't_bug25347'
71+
d_bug25347.t_bug25347
72+
warning : Number of rows changed from 0 to 3
73+
status : OK
74+
insert into t_bug25347 values (7),(8),(9);
75+
select * from t_bug25347;
76+
a
77+
1
78+
2
79+
3
80+
7
81+
8
82+
9
83+
select * from v_bug25347;
84+
a
85+
1
86+
2
87+
3
88+
7
89+
8
90+
9
91+
drop view v_bug25347;
92+
drop table t_bug25347;
93+
drop database d_bug25347;
94+
use test;
6095
End of 5.0 tests

mysql-test/r/mysqlshow.result

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Database: information_schema
9393
| PARTITIONS |
9494
| PLUGINS |
9595
| PROCESSLIST |
96+
| PROFILING |
9697
| REFERENTIAL_CONSTRAINTS |
9798
| ROUTINES |
9899
| SCHEMATA |
@@ -125,6 +126,7 @@ Database: INFORMATION_SCHEMA
125126
| PARTITIONS |
126127
| PLUGINS |
127128
| PROCESSLIST |
129+
| PROFILING |
128130
| REFERENTIAL_CONSTRAINTS |
129131
| ROUTINES |
130132
| SCHEMATA |

mysql-test/r/profiling.require

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Variable_name Value
2+
profiling OFF

0 commit comments

Comments
 (0)