Merge lp:~paul-mccullagh/maria/maria-pbxt-rc2 into lp:~maria-captains/maria/5.1-converting

Proposed by Paul McCullagh
Status: Merged
Merged at revision: not available
Proposed branch: lp:~paul-mccullagh/maria/maria-pbxt-rc2
Merge into: lp:~maria-captains/maria/5.1-converting
Diff against target: None lines
To merge this branch: bzr merge lp:~paul-mccullagh/maria/maria-pbxt-rc2
Reviewer Review Type Date Requested Status
Maria-captains Pending
Review via email: mp+10303@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Updated the PBXT engine to RC2 (lp:pbxt/rc2), version 1.0.08c. All tests in the PBXT suite pass.

Note that this branch does not yet include the entire history of PBXT because attempts to do this have failed so far due to problems with bzr.

Revision history for this message
Kristian Nielsen (knielsen) wrote :

Paul McCullagh <email address hidden> writes:

> Paul McCullagh has proposed merging lp:~paul-mccullagh/maria/maria-pbxt-rc2 into lp:maria.
>
> Requested reviews:
> Maria-captains (maria-captains)
>
> Updated the PBXT engine to RC2 (lp:pbxt/rc2), version 1.0.08c. All tests in the PBXT suite pass.
>
> Note that this branch does not yet include the entire history of PBXT because attempts to do this have failed so far due to problems with bzr.

Thanks a lot for working on this.

I have been a bit busy last week due to meetings. But I plan to look into this
sometimes this week.

 - Kristian.

Revision history for this message
Kristian Nielsen (knielsen) wrote :
Download full text (4.0 KiB)

Paul McCullagh <email address hidden> writes:

> Paul McCullagh has proposed merging lp:~paul-mccullagh/maria/maria-pbxt-rc2 into lp:maria.
>
> Requested reviews:
> Maria-captains (maria-captains)
>
> Updated the PBXT engine to RC2 (lp:pbxt/rc2), version 1.0.08c. All tests in the PBXT suite pass.
>
> Note that this branch does not yet include the entire history of PBXT because attempts to do this have failed so far due to problems with bzr.

Thanks a lot Paul for preparing this.

I tried building your tree and running the test suite. I have a question, as I
got some build and test failures. I suspect that perhaps your tree is missing
a commit, or maybe has one too many.

Your tree has the following 3 commits in addition to lp:maria:

 2722 Paul McCullagh 2009-08-18
      Merged changes for bug fix update 1.0.08c RC2

 2721 Paul McCullagh 2009-08-17
      Updated all tests for RC2

 2720 Paul McCullagh 2009-08-17
      Updated PBXT to version 1.0.08 RC2

If I build revision 2721 (drop the last commit), things look good. I even have
zero failures in the test suite with a simple patch (attached), mostly some
simple fixes for case-sensitive file system.

But if I try the current tree, revision 2722, I get both build and test
failures, as detailed below.

So the basic question is, should I merge just revision 2721, or should I merge
2722 with some additional build (and test?) fixes?

-----------------------------------------------------------------------

So some more details.

First, I fixed all of the test failures in revision 2721 with a simple patch
(attached). The only problem was the *-master.opt files were not copied along
with test .test files from the main suite. This caused failures on
case-sensitive file systems (and also failure in udf.test due to wrong search
path for .so). You should of course check the patch, but I think it should be
ok.

Now, for the problems in revision 2722:

They might be related to the replacement of stream_xt with pbms_enabled. To
even build, I need this patch:

--- storage/pbxt/src/Makefile.am 2009-05-09 04:01:53 +0000
+++ storage/pbxt/src/Makefile.am 2009-08-28 10:11:41 +0000
@@ -19,7 +19,7 @@ noinst_HEADERS = bsearch_xt.h cache_xt.
       datadic_xt.h datalog_xt.h filesys_xt.h hashtab_xt.h \
       ha_pbxt.h heap_xt.h index_xt.h linklist_xt.h \
       memory_xt.h myxt_xt.h pthread_xt.h restart_xt.h \
- streaming_xt.h sortedlist_xt.h strutil_xt.h \
+ pbms_enabled.h sortedlist_xt.h strutil_xt.h \
       tabcache_xt.h table_xt.h trace_xt.h thread_xt.h \
       util_xt.h xaction_xt.h xactlog_xt.h lock_xt.h \
       systab_xt.h ha_xtsys.h discover_xt.h \
@@ -30,7 +30,7 @@ libpbxt_la_SOURCES = bsearch_xt.cc cache
       datadic_xt.cc datalog_xt.cc filesys_xt.cc hashtab_xt.cc \
       ha_pbxt.cc heap_xt.cc index_xt.cc linklist_xt.cc \
       memory_xt.cc myxt_xt.cc pthread_xt.cc restart_xt.cc \
- streaming_xt.cc sortedlist_xt.cc strutil_xt.cc \
+ pbms_enabled.cc sortedlist_xt.cc strutil_xt.cc \
       tabcache_xt.cc table_xt.cc trace_xt.cc thread_xt.cc \
       systab_xt.cc ha_xtsys.cc discover_xt.cc \
       util_xt.cc xaction_xt.cc xactlog_xt.cc lock_xt.cc locklist_xt.cc...

Read more...

=== modified file 'mysql-test/suite/pbxt/r/lowercase_view.result'
--- mysql-test/suite/pbxt/r/lowercase_view.result 2009-04-02 20:36:52 +0000
+++ mysql-test/suite/pbxt/r/lowercase_view.result 2009-08-28 11:19:59 +0000
@@ -119,7 +119,7 @@ create table t1Aa (col1 int);
119create view v1Aa as select col1 from t1Aa as AaA;119create view v1Aa as select col1 from t1Aa as AaA;
120show create view v1AA;120show create view v1AA;
121View Create View character_set_client collation_connection121View Create View character_set_client collation_connection
122v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `AaA`.`col1` AS `col1` from `t1aa` `AaA` latin1 latin1_swedish_ci122v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `aaa` latin1 latin1_swedish_ci
123drop view v1AA;123drop view v1AA;
124select Aaa.col1 from t1Aa as AaA;124select Aaa.col1 from t1Aa as AaA;
125col1125col1
@@ -128,7 +128,7 @@ drop view v1AA;
128create view v1Aa as select AaA.col1 from t1Aa as AaA;128create view v1Aa as select AaA.col1 from t1Aa as AaA;
129show create view v1AA;129show create view v1AA;
130View Create View character_set_client collation_connection130View Create View character_set_client collation_connection
131v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `AaA`.`col1` AS `col1` from `t1aa` `AaA` latin1 latin1_swedish_ci131v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `aaa` latin1 latin1_swedish_ci
132drop view v1AA;132drop view v1AA;
133drop table t1Aa;133drop table t1Aa;
134CREATE TABLE t1 (a int, b int);134CREATE TABLE t1 (a int, b int);
@@ -142,7 +142,7 @@ CREATE OR REPLACE VIEW v1 AS
142select X.a from t1 AS X group by X.b having (X.a = 1);142select X.a from t1 AS X group by X.b having (X.a = 1);
143SHOW CREATE VIEW v1;143SHOW CREATE VIEW v1;
144View Create View character_set_client collation_connection144View Create View character_set_client collation_connection
145v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `X`.`a` AS `a` from `t1` `X` group by `X`.`b` having (`X`.`a` = 1) latin1 latin1_swedish_ci145v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `x`.`a` AS `a` from `t1` `x` group by `x`.`b` having (`x`.`a` = 1) latin1 latin1_swedish_ci
146SELECT * FROM v1;146SELECT * FROM v1;
147a147a
148DROP VIEW v1;148DROP VIEW v1;
149149
=== added file 'mysql-test/suite/pbxt/t/lowercase_table_grant-master.opt'
--- mysql-test/suite/pbxt/t/lowercase_table_grant-master.opt 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/pbxt/t/lowercase_table_grant-master.opt 2009-08-28 11:13:02 +0000
@@ -0,0 +1 @@
1--lower_case_table_names
02
=== added file 'mysql-test/suite/pbxt/t/lowercase_table_qcache-master.opt'
--- mysql-test/suite/pbxt/t/lowercase_table_qcache-master.opt 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/pbxt/t/lowercase_table_qcache-master.opt 2009-08-28 11:22:29 +0000
@@ -0,0 +1 @@
1--lower_case_table_names
02
=== added file 'mysql-test/suite/pbxt/t/lowercase_view-master.opt'
--- mysql-test/suite/pbxt/t/lowercase_view-master.opt 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/pbxt/t/lowercase_view-master.opt 2009-08-28 11:10:22 +0000
@@ -0,0 +1 @@
1--lower_case_table_names=1
02
=== added file 'mysql-test/suite/pbxt/t/udf-master.opt'
--- mysql-test/suite/pbxt/t/udf-master.opt 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/pbxt/t/udf-master.opt 2009-08-28 11:24:08 +0000
@@ -0,0 +1 @@
1$UDF_EXAMPLE_LIB_OPT
Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :
Download full text (8.4 KiB)

Hi Kristian,

The following error:

> mysqltest: At line 3: query 'alter table t1 rename mysqltest.t1'
> failed: 1025: Error on rename of './test/t1' to './mysqltest/
> t1' (errno: 16)

Occurs because the PBMS code is compiled in.

This can be disabled by commenting out:

#define PBMS_ENABLED

in xt_defs.h

This is, in fact, a bug in PBMS. I have already reported the bug here: https://bugs.launchpad.net/pbms/+bug/416969

So, if the PBMS_ENABLED code is disable (which should probably be the
default at the moment), then that test should run through.

The other problems seem to have to do with case-sensitivity. I will
see if I can repeat those errors on one of my machines.

Best regards,

Paul

On Aug 28, 2009, at 3:33 PM, Kristian Nielsen wrote:

> Paul McCullagh <email address hidden> writes:
>
>> Paul McCullagh has proposed merging lp:~paul-mccullagh/maria/maria-
>> pbxt-rc2 into lp:maria.
>>
>> Requested reviews:
>> Maria-captains (maria-captains)
>>
>> Updated the PBXT engine to RC2 (lp:pbxt/rc2), version 1.0.08c. All
>> tests in the PBXT suite pass.
>>
>> Note that this branch does not yet include the entire history of
>> PBXT because attempts to do this have failed so far due to problems
>> with bzr.
>
> Thanks a lot Paul for preparing this.
>
> I tried building your tree and running the test suite. I have a
> question, as I
> got some build and test failures. I suspect that perhaps your tree
> is missing
> a commit, or maybe has one too many.
>
> Your tree has the following 3 commits in addition to lp:maria:
>
> 2722 Paul McCullagh 2009-08-18
> Merged changes for bug fix update 1.0.08c RC2
>
> 2721 Paul McCullagh 2009-08-17
> Updated all tests for RC2
>
> 2720 Paul McCullagh 2009-08-17
> Updated PBXT to version 1.0.08 RC2
>
> If I build revision 2721 (drop the last commit), things look good. I
> even have
> zero failures in the test suite with a simple patch (attached),
> mostly some
> simple fixes for case-sensitive file system.
>
> But if I try the current tree, revision 2722, I get both build and
> test
> failures, as detailed below.
>
> So the basic question is, should I merge just revision 2721, or
> should I merge
> 2722 with some additional build (and test?) fixes?
>
> -----------------------------------------------------------------------
>
> So some more details.
>
> First, I fixed all of the test failures in revision 2721 with a
> simple patch
> (attached). The only problem was the *-master.opt files were not
> copied along
> with test .test files from the main suite. This caused failures on
> case-sensitive file systems (and also failure in udf.test due to
> wrong search
> path for .so). You should of course check the patch, but I think it
> should be
> ok.
>
> Now, for the problems in revision 2722:
>
> They might be related to the replacement of stream_xt with
> pbms_enabled. To
> even build, I need this patch:
>
> --- storage/pbxt/src/Makefile.am 2009-05-09 04:01:53 +0000
> +++ storage/pbxt/src/Makefile.am 2009-08-28 10:11:41 +0000
> @@ -19,7 +19,7 @@ noinst_HEADERS = bsearch_xt.h cache_xt.
> datadic_xt.h datalog_xt.h filesys_xt.h hashtab_xt.h \
...

Read more...

Revision history for this message
Kristian Nielsen (knielsen) wrote :

Paul McCullagh <email address hidden> writes:

>> mysqltest: At line 3: query 'alter table t1 rename mysqltest.t1'
>> failed: 1025: Error on rename of './test/t1' to './mysqltest/
>> t1' (errno: 16)
>
>
> Occurs because the PBMS code is compiled in.
>
> This can be disabled by commenting out:
>
> #define PBMS_ENABLED
>
> in xt_defs.h

[xt_config.h actually]

> This is, in fact, a bug in PBMS. I have already reported the bug here: https://bugs.launchpad.net/pbms/+bug/416969
>
> So, if the PBMS_ENABLED code is disable (which should probably be the
> default at the moment), then that test should run through.

Ok, thanks, that solved 3 of the 4 remaining failures.

And the last one is just a missing result file update for test
pbxt.ps_1general. You have this diff in the last commit for ha_pbxt.cc:

- stats.data_file_length = ot->ot_table->tab_rec_eof_id;
+ stats.data_file_length = xt_rec_id_to_rec_offset(ot->ot_table, ot->ot_table->tab_rec_eof_id);

So the data file length output of show table status was fixed from units of
records to units of bytes. I just updated the result file accordingly, from 1
to 1024.

> The other problems seem to have to do with case-sensitivity. I will
> see if I can repeat those errors on one of my machines.

Yes, they are case sensitivity issues (except udf maybe). As I said, they all
pass with the patch I gave, which just adds missing *-master.opt files that
are in the main test suite, but where not copied into the pbxt suite along
with the *.test files.

So I will merge this into MariaDB with attached patch to disable PBMS and fix
test failures.

I really want to also enable the PBXT test suite in our
Buildbot. Unfortunately I am really pressed for time do do this now. For one,
I see a number of Valgrind errors when running the suite that I need to
investigate. But one of these days,

Thanks,

 - Kristian.

=== modified file 'mysql-test/suite/pbxt/r/lowercase_view.result'
--- mysql-test/suite/pbxt/r/lowercase_view.result 2009-04-02 20:36:52 +0000
+++ mysql-test/suite/pbxt/r/lowercase_view.result 2009-08-31 11:07:44 +0000
@@ -119,7 +119,7 @@ create table t1Aa (col1 int);
119create view v1Aa as select col1 from t1Aa as AaA;119create view v1Aa as select col1 from t1Aa as AaA;
120show create view v1AA;120show create view v1AA;
121View Create View character_set_client collation_connection121View Create View character_set_client collation_connection
122v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `AaA`.`col1` AS `col1` from `t1aa` `AaA` latin1 latin1_swedish_ci122v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `aaa` latin1 latin1_swedish_ci
123drop view v1AA;123drop view v1AA;
124select Aaa.col1 from t1Aa as AaA;124select Aaa.col1 from t1Aa as AaA;
125col1125col1
@@ -128,7 +128,7 @@ drop view v1AA;
128create view v1Aa as select AaA.col1 from t1Aa as AaA;128create view v1Aa as select AaA.col1 from t1Aa as AaA;
129show create view v1AA;129show create view v1AA;
130View Create View character_set_client collation_connection130View Create View character_set_client collation_connection
131v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `AaA`.`col1` AS `col1` from `t1aa` `AaA` latin1 latin1_swedish_ci131v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `aaa` latin1 latin1_swedish_ci
132drop view v1AA;132drop view v1AA;
133drop table t1Aa;133drop table t1Aa;
134CREATE TABLE t1 (a int, b int);134CREATE TABLE t1 (a int, b int);
@@ -142,7 +142,7 @@ CREATE OR REPLACE VIEW v1 AS
142select X.a from t1 AS X group by X.b having (X.a = 1);142select X.a from t1 AS X group by X.b having (X.a = 1);
143SHOW CREATE VIEW v1;143SHOW CREATE VIEW v1;
144View Create View character_set_client collation_connection144View Create View character_set_client collation_connection
145v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `X`.`a` AS `a` from `t1` `X` group by `X`.`b` having (`X`.`a` = 1) latin1 latin1_swedish_ci145v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `x`.`a` AS `a` from `t1` `x` group by `x`.`b` having (`x`.`a` = 1) latin1 latin1_swedish_ci
146SELECT * FROM v1;146SELECT * FROM v1;
147a147a
148DROP VIEW v1;148DROP VIEW v1;
149149
=== modified file 'mysql-test/suite/pbxt/r/ps_1general.result'
--- mysql-test/suite/pbxt/r/ps_1general.result 2009-08-17 15:57:58 +0000
+++ mysql-test/suite/pbxt/r/ps_1general.result 2009-08-31 11:07:44 +0000
@@ -293,7 +293,7 @@ t2 1 t2_idx 1 b A 0 NULL NULL YES BTREE
293prepare stmt4 from ' show table status from test like ''t2%'' ';293prepare stmt4 from ' show table status from test like ''t2%'' ';
294execute stmt4;294execute stmt4;
295Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment295Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
296t2 PBXT 10 Fixed 0 29 1 # 4096 0 NULL # # # latin1_swedish_ci NULL 296t2 PBXT 10 Fixed 0 29 1024 # 4096 0 NULL # # # latin1_swedish_ci NULL
297prepare stmt4 from ' show table status from test like ''t9%'' ';297prepare stmt4 from ' show table status from test like ''t9%'' ';
298execute stmt4;298execute stmt4;
299Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment299Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
300300
=== added file 'mysql-test/suite/pbxt/t/lowercase_table_grant-master.opt'
--- mysql-test/suite/pbxt/t/lowercase_table_grant-master.opt 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/pbxt/t/lowercase_table_grant-master.opt 2009-08-31 11:07:44 +0000
@@ -0,0 +1 @@
1--lower_case_table_names
02
=== added file 'mysql-test/suite/pbxt/t/lowercase_table_qcache-master.opt'
--- mysql-test/suite/pbxt/t/lowercase_table_qcache-master.opt 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/pbxt/t/lowercase_table_qcache-master.opt 2009-08-31 11:07:44 +0000
@@ -0,0 +1 @@
1--lower_case_table_names
02
=== added file 'mysql-test/suite/pbxt/t/lowercase_view-master.opt'
--- mysql-test/suite/pbxt/t/lowercase_view-master.opt 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/pbxt/t/lowercase_view-master.opt 2009-08-31 11:07:44 +0000
@@ -0,0 +1 @@
1--lower_case_table_names=1
02
=== added file 'mysql-test/suite/pbxt/t/udf-master.opt'
--- mysql-test/suite/pbxt/t/udf-master.opt 1970-01-01 00:00:00 +0000
+++ mysql-test/suite/pbxt/t/udf-master.opt 2009-08-31 11:07:44 +0000
@@ -0,0 +1 @@
1$UDF_EXAMPLE_LIB_OPT
02
=== modified file 'storage/pbxt/src/Makefile.am'
--- storage/pbxt/src/Makefile.am 2009-05-09 04:01:53 +0000
+++ storage/pbxt/src/Makefile.am 2009-08-31 11:07:44 +0000
@@ -19,7 +19,7 @@ noinst_HEADERS = bsearch_xt.h cache_xt.
19 datadic_xt.h datalog_xt.h filesys_xt.h hashtab_xt.h \19 datadic_xt.h datalog_xt.h filesys_xt.h hashtab_xt.h \
20 ha_pbxt.h heap_xt.h index_xt.h linklist_xt.h \20 ha_pbxt.h heap_xt.h index_xt.h linklist_xt.h \
21 memory_xt.h myxt_xt.h pthread_xt.h restart_xt.h \21 memory_xt.h myxt_xt.h pthread_xt.h restart_xt.h \
22 streaming_xt.h sortedlist_xt.h strutil_xt.h \22 pbms_enabled.h sortedlist_xt.h strutil_xt.h \
23 tabcache_xt.h table_xt.h trace_xt.h thread_xt.h \23 tabcache_xt.h table_xt.h trace_xt.h thread_xt.h \
24 util_xt.h xaction_xt.h xactlog_xt.h lock_xt.h \24 util_xt.h xaction_xt.h xactlog_xt.h lock_xt.h \
25 systab_xt.h ha_xtsys.h discover_xt.h \25 systab_xt.h ha_xtsys.h discover_xt.h \
@@ -30,7 +30,7 @@ libpbxt_la_SOURCES = bsearch_xt.cc cache
30 datadic_xt.cc datalog_xt.cc filesys_xt.cc hashtab_xt.cc \30 datadic_xt.cc datalog_xt.cc filesys_xt.cc hashtab_xt.cc \
31 ha_pbxt.cc heap_xt.cc index_xt.cc linklist_xt.cc \31 ha_pbxt.cc heap_xt.cc index_xt.cc linklist_xt.cc \
32 memory_xt.cc myxt_xt.cc pthread_xt.cc restart_xt.cc \32 memory_xt.cc myxt_xt.cc pthread_xt.cc restart_xt.cc \
33 streaming_xt.cc sortedlist_xt.cc strutil_xt.cc \33 pbms_enabled.cc sortedlist_xt.cc strutil_xt.cc \
34 tabcache_xt.cc table_xt.cc trace_xt.cc thread_xt.cc \34 tabcache_xt.cc table_xt.cc trace_xt.cc thread_xt.cc \
35 systab_xt.cc ha_xtsys.cc discover_xt.cc \35 systab_xt.cc ha_xtsys.cc discover_xt.cc \
36 util_xt.cc xaction_xt.cc xactlog_xt.cc lock_xt.cc locklist_xt.cc36 util_xt.cc xaction_xt.cc xactlog_xt.cc lock_xt.cc locklist_xt.cc
3737
=== modified file 'storage/pbxt/src/xt_config.h'
--- storage/pbxt/src/xt_config.h 2009-08-18 07:46:53 +0000
+++ storage/pbxt/src/xt_config.h 2009-08-31 11:07:44 +0000
@@ -81,7 +81,8 @@ const int max_connections = 500;
81#define DEBUG81#define DEBUG
82#endif // _DEBUG82#endif // _DEBUG
83#else83#else
84#define PBMS_ENABLED84// Paul suggested to disable PBMS in MariaDB for now.
85// #define PBMS_ENABLED
85#endif86#endif
8687
87#ifdef __FreeBSD__88#ifdef __FreeBSD__
Revision history for this message
Greg Stark (stark-mit) wrote :

I'm not too familiar with launchpad so I'm a bit puzzled how you
generated this email. The headers are really messed up.

1) It has a bogus reply-to header (but this seems to be standard
launchpad bogosity)
2) The mailing list doesn't appear in the To or Cc headers (ie, it's "bcc"ed)
3) There is no List-Id or other headers to indicate what list it was sent to
4) The envelope sender is a generic "<email address hidden>"

Basically it resists any attempt to filter it intelligently or to
conform to any sane mailing list practices. If this is a symptom of
launchpad design could it be addressed?

--
greg
http://mit.edu/~gsstark/resume.pdf

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Hi Kristian,

On Aug 31, 2009, at 1:27 PM, Kristian Nielsen wrote:

> Paul McCullagh <email address hidden> writes:
>
>>> mysqltest: At line 3: query 'alter table t1 rename mysqltest.t1'
>>> failed: 1025: Error on rename of './test/t1' to './mysqltest/
>>> t1' (errno: 16)
>>
>>
>> Occurs because the PBMS code is compiled in.
>>
>> This can be disabled by commenting out:
>>
>> #define PBMS_ENABLED
>>
>> in xt_defs.h
>
> [xt_config.h actually]

Oops, sorry. It has been moved to xt_defs.h (where it belongs), in a
later release.

>> This is, in fact, a bug in PBMS. I have already reported the bug
>> here: https://bugs.launchpad.net/pbms/+bug/416969
>>
>> So, if the PBMS_ENABLED code is disable (which should probably be the
>> default at the moment), then that test should run through.
>
> Ok, thanks, that solved 3 of the 4 remaining failures.
>
> And the last one is just a missing result file update for test
> pbxt.ps_1general. You have this diff in the last commit for
> ha_pbxt.cc:
>
> - stats.data_file_length = ot->ot_table->tab_rec_eof_id;
> + stats.data_file_length = xt_rec_id_to_rec_offset(ot->ot_table,
> ot->ot_table->tab_rec_eof_id);
>
> So the data file length output of show table status was fixed from
> units of
> records to units of bytes. I just updated the result file
> accordingly, from 1
> to 1024.

Yup. That is correct.

>> The other problems seem to have to do with case-sensitivity. I will
>> see if I can repeat those errors on one of my machines.
>
> Yes, they are case sensitivity issues (except udf maybe). As I said,
> they all
> pass with the patch I gave, which just adds missing *-master.opt
> files that
> are in the main test suite, but where not copied into the pbxt suite
> along
> with the *.test files.
>
> So I will merge this into MariaDB with attached patch to disable
> PBMS and fix
> test failures.

OK, Great! Thanks.

In general, we will always take care that all patches you (or anyone
else) make to PBXT in MariaDB will find there way back into the PBXT
trunk.

> I really want to also enable the PBXT test suite in our
> Buildbot. Unfortunately I am really pressed for time do do this now.
> For one,
> I see a number of Valgrind errors when running the suite that I need
> to
> investigate. But one of these days,

Yup. Valgrind will be great to have.

There is still work to done on our side. Current status is that when
we run it we get warnings but we have not understood why there is a
problem.

Of course, when you have time, any help there would be greatly
appreciated. But of course, there are higher priorities at the moment.

Best regards,

Paul

--
Paul McCullagh
PrimeBase Technologies
www.primebase.org
www.blobstreaming.org
pbxt.blogspot.com

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'mysql-test/suite/pbxt/r/alter_table.result'
--- mysql-test/suite/pbxt/r/alter_table.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/alter_table.result 2009-08-17 11:12:36 +0000
@@ -126,23 +126,23 @@
126alter table t1 disable keys;126alter table t1 disable keys;
127show keys from t1;127show keys from t1;
128Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment128Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
129t1 0 n1 1 n1 NULL 0 NULL NULL BTREE 129t1 0 n1 1 n1 A 0 NULL NULL BTREE
130t1 1 n1_2 1 n1 NULL NULL NULL NULL BTREE 130t1 1 n1_2 1 n1 A 0 NULL NULL BTREE
131t1 1 n1_2 2 n2 NULL NULL NULL NULL YES BTREE 131t1 1 n1_2 2 n2 A 0 NULL NULL YES BTREE
132t1 1 n1_2 3 n3 NULL NULL NULL NULL YES BTREE 132t1 1 n1_2 3 n3 A 0 NULL NULL YES BTREE
133t1 1 n1_2 4 n4 NULL NULL NULL NULL YES BTREE 133t1 1 n1_2 4 n4 A 0 NULL NULL YES BTREE
134t1 1 n2 1 n2 NULL NULL NULL NULL YES BTREE 134t1 1 n2 1 n2 A 0 NULL NULL YES BTREE
135t1 1 n2 2 n3 NULL NULL NULL NULL YES BTREE 135t1 1 n2 2 n3 A 0 NULL NULL YES BTREE
136t1 1 n2 3 n4 NULL NULL NULL NULL YES BTREE 136t1 1 n2 3 n4 A 0 NULL NULL YES BTREE
137t1 1 n2 4 n1 NULL NULL NULL NULL BTREE 137t1 1 n2 4 n1 A 0 NULL NULL BTREE
138t1 1 n3 1 n3 NULL NULL NULL NULL YES BTREE 138t1 1 n3 1 n3 A 0 NULL NULL YES BTREE
139t1 1 n3 2 n4 NULL NULL NULL NULL YES BTREE 139t1 1 n3 2 n4 A 0 NULL NULL YES BTREE
140t1 1 n3 3 n1 NULL NULL NULL NULL BTREE 140t1 1 n3 3 n1 A 0 NULL NULL BTREE
141t1 1 n3 4 n2 NULL NULL NULL NULL YES BTREE 141t1 1 n3 4 n2 A 0 NULL NULL YES BTREE
142t1 1 n4 1 n4 NULL NULL NULL NULL YES BTREE 142t1 1 n4 1 n4 A 0 NULL NULL YES BTREE
143t1 1 n4 2 n1 NULL NULL NULL NULL BTREE 143t1 1 n4 2 n1 A 0 NULL NULL BTREE
144t1 1 n4 3 n2 NULL NULL NULL NULL YES BTREE 144t1 1 n4 3 n2 A 0 NULL NULL YES BTREE
145t1 1 n4 4 n3 NULL NULL NULL NULL YES BTREE 145t1 1 n4 4 n3 A 0 NULL NULL YES BTREE
146insert into t1 values(10,RAND()*1000,RAND()*1000,RAND());146insert into t1 values(10,RAND()*1000,RAND()*1000,RAND());
147insert into t1 values(9,RAND()*1000,RAND()*1000,RAND());147insert into t1 values(9,RAND()*1000,RAND()*1000,RAND());
148insert into t1 values(8,RAND()*1000,RAND()*1000,RAND());148insert into t1 values(8,RAND()*1000,RAND()*1000,RAND());
@@ -156,23 +156,23 @@
156alter table t1 enable keys;156alter table t1 enable keys;
157show keys from t1;157show keys from t1;
158Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment158Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
159t1 0 n1 1 n1 NULL 10 NULL NULL BTREE 159t1 0 n1 1 n1 A 10 NULL NULL BTREE
160t1 1 n1_2 1 n1 NULL NULL NULL NULL BTREE 160t1 1 n1_2 1 n1 A 10 NULL NULL BTREE
161t1 1 n1_2 2 n2 NULL NULL NULL NULL YES BTREE 161t1 1 n1_2 2 n2 A 10 NULL NULL YES BTREE
162t1 1 n1_2 3 n3 NULL NULL NULL NULL YES BTREE 162t1 1 n1_2 3 n3 A 10 NULL NULL YES BTREE
163t1 1 n1_2 4 n4 NULL NULL NULL NULL YES BTREE 163t1 1 n1_2 4 n4 A 10 NULL NULL YES BTREE
164t1 1 n2 1 n2 NULL NULL NULL NULL YES BTREE 164t1 1 n2 1 n2 A 10 NULL NULL YES BTREE
165t1 1 n2 2 n3 NULL NULL NULL NULL YES BTREE 165t1 1 n2 2 n3 A 10 NULL NULL YES BTREE
166t1 1 n2 3 n4 NULL NULL NULL NULL YES BTREE 166t1 1 n2 3 n4 A 10 NULL NULL YES BTREE
167t1 1 n2 4 n1 NULL NULL NULL NULL BTREE 167t1 1 n2 4 n1 A 10 NULL NULL BTREE
168t1 1 n3 1 n3 NULL NULL NULL NULL YES BTREE 168t1 1 n3 1 n3 A 10 NULL NULL YES BTREE
169t1 1 n3 2 n4 NULL NULL NULL NULL YES BTREE 169t1 1 n3 2 n4 A 10 NULL NULL YES BTREE
170t1 1 n3 3 n1 NULL NULL NULL NULL BTREE 170t1 1 n3 3 n1 A 10 NULL NULL BTREE
171t1 1 n3 4 n2 NULL NULL NULL NULL YES BTREE 171t1 1 n3 4 n2 A 10 NULL NULL YES BTREE
172t1 1 n4 1 n4 NULL NULL NULL NULL YES BTREE 172t1 1 n4 1 n4 A 10 NULL NULL YES BTREE
173t1 1 n4 2 n1 NULL NULL NULL NULL BTREE 173t1 1 n4 2 n1 A 10 NULL NULL BTREE
174t1 1 n4 3 n2 NULL NULL NULL NULL YES BTREE 174t1 1 n4 3 n2 A 10 NULL NULL YES BTREE
175t1 1 n4 4 n3 NULL NULL NULL NULL YES BTREE 175t1 1 n4 4 n3 A 10 NULL NULL YES BTREE
176drop table t1;176drop table t1;
177create table t1 (i int unsigned not null auto_increment primary key);177create table t1 (i int unsigned not null auto_increment primary key);
178alter table t1 rename t2;178alter table t1 rename t2;
@@ -286,17 +286,17 @@
286alter table t1 add unique (a,b), add key (b);286alter table t1 add unique (a,b), add key (b);
287show keys from t1;287show keys from t1;
288Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment288Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
289t1 0 a 1 a A NULL NULL NULL YES BTREE 289t1 0 a 1 a A 300 NULL NULL YES BTREE
290t1 0 a 2 b A NULL NULL NULL YES BTREE 290t1 0 a 2 b A 300 NULL NULL YES BTREE
291t1 1 b 1 b A NULL NULL NULL YES BTREE 291t1 1 b 1 b A 300 NULL NULL YES BTREE
292analyze table t1;292analyze table t1;
293Table Op Msg_type Msg_text293Table Op Msg_type Msg_text
294test.t1 analyze status OK294test.t1 analyze status OK
295show keys from t1;295show keys from t1;
296Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment296Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
297t1 0 a 1 a A NULL NULL NULL YES BTREE 297t1 0 a 1 a A 300 NULL NULL YES BTREE
298t1 0 a 2 b A NULL NULL NULL YES BTREE 298t1 0 a 2 b A 300 NULL NULL YES BTREE
299t1 1 b 1 b A NULL NULL NULL YES BTREE 299t1 1 b 1 b A 300 NULL NULL YES BTREE
300drop table t1;300drop table t1;
301CREATE TABLE t1 (i int(10), index(i) );301CREATE TABLE t1 (i int(10), index(i) );
302ALTER TABLE t1 DISABLE KEYS;302ALTER TABLE t1 DISABLE KEYS;
@@ -545,37 +545,37 @@
545create table t1 (a int, key(a));545create table t1 (a int, key(a));
546show indexes from t1;546show indexes from t1;
547Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment547Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
548t1 1 a 1 a A NULL NULL NULL YES BTREE 548t1 1 a 1 a A 0 NULL NULL YES BTREE
549"this used not to disable the index"549"this used not to disable the index"
550alter table t1 modify a int, disable keys;550alter table t1 modify a int, disable keys;
551show indexes from t1;551show indexes from t1;
552Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment552Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
553t1 1 a 1 a A NULL NULL NULL YES BTREE 553t1 1 a 1 a A 0 NULL NULL YES BTREE
554alter table t1 enable keys;554alter table t1 enable keys;
555show indexes from t1;555show indexes from t1;
556Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment556Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
557t1 1 a 1 a NULL NULL NULL NULL YES BTREE 557t1 1 a 1 a A 0 NULL NULL YES BTREE
558alter table t1 modify a bigint, disable keys;558alter table t1 modify a bigint, disable keys;
559show indexes from t1;559show indexes from t1;
560Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment560Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
561t1 1 a 1 a A NULL NULL NULL YES BTREE 561t1 1 a 1 a A 0 NULL NULL YES BTREE
562alter table t1 enable keys;562alter table t1 enable keys;
563show indexes from t1;563show indexes from t1;
564Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment564Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
565t1 1 a 1 a NULL NULL NULL NULL YES BTREE 565t1 1 a 1 a A 0 NULL NULL YES BTREE
566alter table t1 add b char(10), disable keys;566alter table t1 add b char(10), disable keys;
567show indexes from t1;567show indexes from t1;
568Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment568Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
569t1 1 a 1 a A NULL NULL NULL YES BTREE 569t1 1 a 1 a A 0 NULL NULL YES BTREE
570alter table t1 add c decimal(10,2), enable keys;570alter table t1 add c decimal(10,2), enable keys;
571show indexes from t1;571show indexes from t1;
572Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment572Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
573t1 1 a 1 a A NULL NULL NULL YES BTREE 573t1 1 a 1 a A 0 NULL NULL YES BTREE
574"this however did"574"this however did"
575alter table t1 disable keys;575alter table t1 disable keys;
576show indexes from t1;576show indexes from t1;
577Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment577Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
578t1 1 a 1 a NULL NULL NULL NULL YES BTREE 578t1 1 a 1 a A 0 NULL NULL YES BTREE
579desc t1;579desc t1;
580Field Type Null Key Default Extra580Field Type Null Key Default Extra
581a bigint(20) YES MUL NULL 581a bigint(20) YES MUL NULL
@@ -585,7 +585,7 @@
585"The key should still be disabled"585"The key should still be disabled"
586show indexes from t1;586show indexes from t1;
587Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment587Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
588t1 1 a 1 a A NULL NULL NULL YES BTREE 588t1 1 a 1 a A 0 NULL NULL YES BTREE
589drop table t1;589drop table t1;
590"Now will test with one unique index"590"Now will test with one unique index"
591create table t1(a int, b char(10), unique(a));591create table t1(a int, b char(10), unique(a));
@@ -595,7 +595,7 @@
595alter table t1 disable keys;595alter table t1 disable keys;
596show indexes from t1;596show indexes from t1;
597Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment597Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
598t1 0 a 1 a NULL 0 NULL NULL YES BTREE 598t1 0 a 1 a A 0 NULL NULL YES BTREE
599alter table t1 enable keys;599alter table t1 enable keys;
600"If no copy on noop change, this won't touch the data file"600"If no copy on noop change, this won't touch the data file"
601"Unique index, no change"601"Unique index, no change"
@@ -623,12 +623,12 @@
623show indexes from t1;623show indexes from t1;
624Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment624Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
625t1 0 a 1 a A 0 NULL NULL YES BTREE 625t1 0 a 1 a A 0 NULL NULL YES BTREE
626t1 1 b 1 b A NULL NULL NULL YES BTREE 626t1 1 b 1 b A 0 NULL NULL YES BTREE
627alter table t1 disable keys;627alter table t1 disable keys;
628show indexes from t1;628show indexes from t1;
629Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment629Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
630t1 0 a 1 a NULL 0 NULL NULL YES BTREE 630t1 0 a 1 a A 0 NULL NULL YES BTREE
631t1 1 b 1 b NULL NULL NULL NULL YES BTREE 631t1 1 b 1 b A 0 NULL NULL YES BTREE
632alter table t1 enable keys;632alter table t1 enable keys;
633"If no copy on noop change, this won't touch the data file"633"If no copy on noop change, this won't touch the data file"
634"The non-unique index will be disabled"634"The non-unique index will be disabled"
@@ -636,31 +636,31 @@
636show indexes from t1;636show indexes from t1;
637Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment637Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
638t1 0 a 1 a A 0 NULL NULL YES BTREE 638t1 0 a 1 a A 0 NULL NULL YES BTREE
639t1 1 b 1 b A NULL NULL NULL YES BTREE 639t1 1 b 1 b A 0 NULL NULL YES BTREE
640alter table t1 enable keys;640alter table t1 enable keys;
641show indexes from t1;641show indexes from t1;
642Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment642Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
643t1 0 a 1 a NULL 0 NULL NULL YES BTREE 643t1 0 a 1 a A 0 NULL NULL YES BTREE
644t1 1 b 1 b NULL NULL NULL NULL YES BTREE 644t1 1 b 1 b A 0 NULL NULL YES BTREE
645"Change the type implying data copy"645"Change the type implying data copy"
646"The non-unique index will be disabled"646"The non-unique index will be disabled"
647alter table t1 modify a bigint, disable keys;647alter table t1 modify a bigint, disable keys;
648show indexes from t1;648show indexes from t1;
649Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment649Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
650t1 0 a 1 a A 0 NULL NULL YES BTREE 650t1 0 a 1 a A 0 NULL NULL YES BTREE
651t1 1 b 1 b A NULL NULL NULL YES BTREE 651t1 1 b 1 b A 0 NULL NULL YES BTREE
652"Change again the type, but leave the indexes as_is"652"Change again the type, but leave the indexes as_is"
653alter table t1 modify a int;653alter table t1 modify a int;
654show indexes from t1;654show indexes from t1;
655Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment655Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
656t1 0 a 1 a A 0 NULL NULL YES BTREE 656t1 0 a 1 a A 0 NULL NULL YES BTREE
657t1 1 b 1 b A NULL NULL NULL YES BTREE 657t1 1 b 1 b A 0 NULL NULL YES BTREE
658"Try the same. When data is no copied on similar tables, this is noop"658"Try the same. When data is no copied on similar tables, this is noop"
659alter table t1 modify a int;659alter table t1 modify a int;
660show indexes from t1;660show indexes from t1;
661Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment661Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
662t1 0 a 1 a A 0 NULL NULL YES BTREE 662t1 0 a 1 a A 0 NULL NULL YES BTREE
663t1 1 b 1 b A NULL NULL NULL YES BTREE 663t1 1 b 1 b A 0 NULL NULL YES BTREE
664drop table t1;664drop table t1;
665create database mysqltest;665create database mysqltest;
666create table t1 (c1 int);666create table t1 (c1 int);
@@ -697,11 +697,11 @@
697CREATE TABLE bug24219 (a INT, INDEX(a));697CREATE TABLE bug24219 (a INT, INDEX(a));
698SHOW INDEX FROM bug24219;698SHOW INDEX FROM bug24219;
699Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment699Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
700bug24219 1 a 1 a A NULL NULL NULL YES BTREE 700bug24219 1 a 1 a A 0 NULL NULL YES BTREE
701ALTER TABLE bug24219 RENAME TO bug24219_2, DISABLE KEYS;701ALTER TABLE bug24219 RENAME TO bug24219_2, DISABLE KEYS;
702SHOW INDEX FROM bug24219_2;702SHOW INDEX FROM bug24219_2;
703Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment703Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
704bug24219_2 1 a 1 a A NULL NULL NULL YES BTREE 704bug24219_2 1 a 1 a A 0 NULL NULL YES BTREE
705DROP TABLE bug24219_2;705DROP TABLE bug24219_2;
706create table t1 (mycol int(10) not null);706create table t1 (mycol int(10) not null);
707alter table t1 alter column mycol set default 0;707alter table t1 alter column mycol set default 0;
@@ -882,7 +882,7 @@
882char_field char(10) YES NULL 882char_field char(10) YES NULL
883SHOW INDEXES FROM t1;883SHOW INDEXES FROM t1;
884Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment884Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
885t1 1 int_field 1 int_field A NULL NULL NULL BTREE 885t1 1 int_field 1 int_field A 0 NULL NULL BTREE
886INSERT INTO t1 VALUES (1, "edno"), (1, "edno"), (2, "dve"), (3, "tri"), (5, "pet");886INSERT INTO t1 VALUES (1, "edno"), (1, "edno"), (2, "dve"), (3, "tri"), (5, "pet");
887"Non-copy data change - new frm, but old data and index files"887"Non-copy data change - new frm, but old data and index files"
888ALTER TABLE t1888ALTER TABLE t1
889889
=== modified file 'mysql-test/suite/pbxt/r/analyze.result'
--- mysql-test/suite/pbxt/r/analyze.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/analyze.result 2009-08-17 15:57:58 +0000
@@ -56,5 +56,5 @@
56test.t1 analyze status OK56test.t1 analyze status OK
57show index from t1;57show index from t1;
58Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment58Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
59t1 1 a 1 a A NULL NULL NULL YES BTREE 59t1 1 a 1 a A 5 NULL NULL YES BTREE
60drop table t1;60drop table t1;
6161
=== modified file 'mysql-test/suite/pbxt/r/auto_increment.result'
--- mysql-test/suite/pbxt/r/auto_increment.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/auto_increment.result 2009-08-17 15:57:58 +0000
@@ -229,7 +229,8 @@
229204 7229204 7
230delete from t1 where a=0;230delete from t1 where a=0;
231update t1 set a=NULL where b=6;231update t1 set a=NULL where b=6;
232ERROR 23000: Column 'a' cannot be null232Warnings:
233Warning 1048 Column 'a' cannot be null
233update t1 set a=300 where b=7;234update t1 set a=300 where b=7;
234SET SQL_MODE='';235SET SQL_MODE='';
235insert into t1(a,b)values(NULL,8);236insert into t1(a,b)values(NULL,8);
@@ -244,7 +245,7 @@
2441 12451 1
245200 2246200 2
246201 4247201 4
247203 62480 6
248300 7249300 7
249301 8250301 8
250400 9251400 9
@@ -260,7 +261,6 @@
2601 12611 1
261200 2262200 2
262201 4263201 4
263203 6
264300 7264300 7
265301 8265301 8
266400 9266400 9
@@ -271,20 +271,20 @@
271405 14271405 14
272delete from t1 where a=0;272delete from t1 where a=0;
273update t1 set a=NULL where b=13;273update t1 set a=NULL where b=13;
274ERROR 23000: Column 'a' cannot be null274Warnings:
275Warning 1048 Column 'a' cannot be null
275update t1 set a=500 where b=14;276update t1 set a=500 where b=14;
276select * from t1 order by b;277select * from t1 order by b;
277a b278a b
2781 12791 1
279200 2280200 2
280201 4281201 4
281203 6
282300 7282300 7
283301 8283301 8
284400 9284400 9
285401 10285401 10
286402 11286402 11
287404 132870 13
288500 14288500 14
289drop table t1;289drop table t1;
290create table t1 (a bigint);290create table t1 (a bigint);
291291
=== modified file 'mysql-test/suite/pbxt/r/delete.result'
--- mysql-test/suite/pbxt/r/delete.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/delete.result 2009-08-17 15:57:58 +0000
@@ -125,18 +125,19 @@
1250 111250 11
1262 121262 12
127delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);127delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
128Warnings:128ERROR 21000: Subquery returns more than 1 row
129Error 1242 Subquery returns more than 1 row
130Error 1242 Subquery returns more than 1 row
131select * from t11;129select * from t11;
132a b130a b
1330 101310 10
1341 111321 11
1332 12
135select * from t12;134select * from t12;
136a b135a b
13733 1013633 10
1380 111370 11
1382 12
139insert into t11 values (2, 12);139insert into t11 values (2, 12);
140ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
140delete from t11 where t11.b <> (select b from t2 where t11.a < t2.a);141delete from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
141ERROR 21000: Subquery returns more than 1 row142ERROR 21000: Subquery returns more than 1 row
142select * from t11;143select * from t11;
@@ -145,13 +146,12 @@
1451 111461 11
1462 121472 12
147delete ignore from t11 where t11.b <> (select b from t2 where t11.a < t2.a);148delete ignore from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
148Warnings:149ERROR 21000: Subquery returns more than 1 row
149Error 1242 Subquery returns more than 1 row
150Error 1242 Subquery returns more than 1 row
151select * from t11;150select * from t11;
152a b151a b
1530 101520 10
1541 111531 11
1542 12
155drop table t11, t12, t2;155drop table t11, t12, t2;
156create table t1 (a int, b int, unique key (a), key (b));156create table t1 (a int, b int, unique key (a), key (b));
157insert into t1 values (3, 3), (7, 7);157insert into t1 values (3, 3), (7, 7);
158158
=== modified file 'mysql-test/suite/pbxt/r/distinct.result'
--- mysql-test/suite/pbxt/r/distinct.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/distinct.result 2009-08-17 15:57:58 +0000
@@ -174,8 +174,8 @@
174explain SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;174explain SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
175id select_type table type possible_keys key key_len ref rows Extra175id select_type table type possible_keys key key_len ref rows Extra
1761 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using temporary1761 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using temporary
1771 SIMPLE t3 ref a a 5 test.t1.b 2 Using where; Using index1771 SIMPLE t2 ref a a 4 test.t1.a 1 Using index
1781 SIMPLE t2 index a a 4 NULL 5 Using where; Using index; Distinct; Using join buffer1781 SIMPLE t3 ref a a 5 test.t1.b 1 Using where; Using index
179SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;179SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
180a180a
18111811
@@ -190,7 +190,7 @@
190explain select distinct t1.a from t1,t3 where t1.a=t3.a;190explain select distinct t1.a from t1,t3 where t1.a=t3.a;
191id select_type table type possible_keys key key_len ref rows Extra191id select_type table type possible_keys key key_len ref rows Extra
1921 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary1921 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary
1931 SIMPLE t3 ref a a 5 test.t1.a 11 Using where; Using index; Distinct1931 SIMPLE t3 ref a a 5 test.t1.a 1 Using where; Using index; Distinct
194select distinct t1.a from t1,t3 where t1.a=t3.a;194select distinct t1.a from t1,t3 where t1.a=t3.a;
195a195a
19611961
@@ -212,7 +212,7 @@
2121 SIMPLE t1 index NULL PRIMARY 4 NULL 1 Using index2121 SIMPLE t1 index NULL PRIMARY 4 NULL 1 Using index
213explain SELECT distinct a from t3 order by a desc limit 2;213explain SELECT distinct a from t3 order by a desc limit 2;
214id select_type table type possible_keys key key_len ref rows Extra214id select_type table type possible_keys key key_len ref rows Extra
2151 SIMPLE t3 index NULL a 5 NULL 40 Using index2151 SIMPLE t3 index NULL a 5 NULL 2 Using index
216explain SELECT distinct a,b from t3 order by a+1;216explain SELECT distinct a,b from t3 order by a+1;
217id select_type table type possible_keys key key_len ref rows Extra217id select_type table type possible_keys key key_len ref rows Extra
2181 SIMPLE t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort2181 SIMPLE t3 ALL NULL NULL NULL NULL 204 Using temporary; Using filesort
219219
=== modified file 'mysql-test/suite/pbxt/r/func_group.result'
--- mysql-test/suite/pbxt/r/func_group.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/func_group.result 2009-08-17 15:57:58 +0000
@@ -61,7 +61,7 @@
61NULL NULL61NULL NULL
621 7621 7
632 20.25632 20.25
643 45.483163247594643 45.4831632475944
65create table t2 (grp int, a bigint unsigned, c char(10));65create table t2 (grp int, a bigint unsigned, c char(10));
66insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp;66insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp;
67replace into t2 select grp, a, c from t1 limit 2,1;67replace into t2 select grp, a, c from t1 limit 2,1;
@@ -613,8 +613,8 @@
613explain613explain
614select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 > 'CA';614select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 > 'CA';
615id select_type table type possible_keys key key_len ref rows Extra615id select_type table type possible_keys key key_len ref rows Extra
6161 SIMPLE t2 range k1 k1 3 NULL 1 Using where; Using index6161 SIMPLE t1 range k1 k1 7 NULL 1 Using where; Using index
6171 SIMPLE t1 range k1 k1 7 NULL 1 Using where; Using index; Using join buffer6171 SIMPLE t2 range k1 k1 3 NULL 1 Using where; Using index; Using join buffer
618explain618explain
619select min(a4 - 0.01) from t1;619select min(a4 - 0.01) from t1;
620id select_type table type possible_keys key key_len ref rows Extra620id select_type table type possible_keys key key_len ref rows Extra
@@ -1186,7 +1186,7 @@
11860.2132576411860.21325764
1187select std(o1/o2) from bug22555;1187select std(o1/o2) from bug22555;
1188std(o1/o2)1188std(o1/o2)
11890.2132576358664911890.213257635866493
1190select std(e1/e2) from bug22555;1190select std(e1/e2) from bug22555;
1191std(e1/e2)1191std(e1/e2)
11920.2132576411920.21325764
@@ -1212,7 +1212,7 @@
12120.2132576358664934112120.21325763586649341
1213select std(o1/o2) from bug22555;1213select std(o1/o2) from bug22555;
1214std(o1/o2)1214std(o1/o2)
12150.2132576358664912150.213257635866493
1216select round(std(e1/e2), 17) from bug22555;1216select round(std(e1/e2), 17) from bug22555;
1217round(std(e1/e2), 17)1217round(std(e1/e2), 17)
12180.2132576358664934112180.21325763586649341
@@ -1237,7 +1237,7 @@
12370.2132576358664934112370.21325763586649341
1238select std(o1/o2) from bug22555;1238select std(o1/o2) from bug22555;
1239std(o1/o2)1239std(o1/o2)
12400.2132576358664912400.213257635866493
1241select round(std(e1/e2), 17) from bug22555;1241select round(std(e1/e2), 17) from bug22555;
1242round(std(e1/e2), 17)1242round(std(e1/e2), 17)
12430.2132576358664934112430.21325763586649341
12441244
=== modified file 'mysql-test/suite/pbxt/r/func_math.result'
--- mysql-test/suite/pbxt/r/func_math.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/func_math.result 2009-08-17 15:57:58 +0000
@@ -60,7 +60,7 @@
60Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`60Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`
61select log2(8),log2(15),log2(-2),log2(0),log2(NULL);61select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
62log2(8) log2(15) log2(-2) log2(0) log2(NULL)62log2(8) log2(15) log2(-2) log2(0) log2(NULL)
633 3.9068905956085 NULL NULL NULL633 3.90689059560852 NULL NULL NULL
64explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);64explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
65id select_type table type possible_keys key key_len ref rows filtered Extra65id select_type table type possible_keys key key_len ref rows filtered Extra
661 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used661 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
@@ -68,7 +68,7 @@
68Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`68Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`
69select log10(100),log10(18),log10(-4),log10(0),log10(NULL);69select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
70log10(100) log10(18) log10(-4) log10(0) log10(NULL)70log10(100) log10(18) log10(-4) log10(0) log10(NULL)
712 1.2552725051033 NULL NULL NULL712 1.25527250510331 NULL NULL NULL
72explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);72explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
73id select_type table type possible_keys key key_len ref rows filtered Extra73id select_type table type possible_keys key key_len ref rows filtered Extra
741 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used741 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
@@ -85,7 +85,7 @@
85set @@rand_seed1=10000000,@@rand_seed2=1000000;85set @@rand_seed1=10000000,@@rand_seed2=1000000;
86select rand(999999),rand();86select rand(999999),rand();
87rand(999999) rand()87rand(999999) rand()
880.014231365187309 0.028870999839968880.0142313651873091 0.028870999839968
89explain extended select rand(999999),rand();89explain extended select rand(999999),rand();
90id select_type table type possible_keys key key_len ref rows filtered Extra90id select_type table type possible_keys key key_len ref rows filtered Extra
911 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used911 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
@@ -101,7 +101,7 @@
101Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)`101Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)`
102select degrees(pi()),radians(360);102select degrees(pi()),radians(360);
103degrees(pi()) radians(360)103degrees(pi()) radians(360)
104180 6.2831853071796104180 6.28318530717959
105select format(atan(-2, 2), 6);105select format(atan(-2, 2), 6);
106format(atan(-2, 2), 6)106format(atan(-2, 2), 6)
107-0.785398107-0.785398
108108
=== modified file 'mysql-test/suite/pbxt/r/func_str.result'
--- mysql-test/suite/pbxt/r/func_str.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/func_str.result 2009-08-17 15:57:58 +0000
@@ -1327,10 +1327,10 @@
132720.06132720.06
1328select conv("18383815659218730760",10,10) + 0;1328select conv("18383815659218730760",10,10) + 0;
1329conv("18383815659218730760",10,10) + 01329conv("18383815659218730760",10,10) + 0
13301.8383815659219e+1913301.83838156592187e+19
1331select "18383815659218730760" + 0;1331select "18383815659218730760" + 0;
1332"18383815659218730760" + 01332"18383815659218730760" + 0
13331.8383815659219e+1913331.83838156592187e+19
1334CREATE TABLE t1 (code varchar(10));1334CREATE TABLE t1 (code varchar(10));
1335INSERT INTO t1 VALUES ('a12'), ('A12'), ('a13');1335INSERT INTO t1 VALUES ('a12'), ('A12'), ('a13');
1336SELECT ASCII(code), code FROM t1 WHERE code='A12';1336SELECT ASCII(code), code FROM t1 WHERE code='A12';
13371337
=== modified file 'mysql-test/suite/pbxt/r/grant.result'
--- mysql-test/suite/pbxt/r/grant.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/grant.result 2009-08-17 15:57:58 +0000
@@ -457,7 +457,7 @@
457Alter Tables To alter the table457Alter Tables To alter the table
458Alter routine Functions,Procedures To alter or drop stored functions/procedures458Alter routine Functions,Procedures To alter or drop stored functions/procedures
459Create Databases,Tables,Indexes To create new databases and tables459Create Databases,Tables,Indexes To create new databases and tables
460Create routine Functions,Procedures To use CREATE FUNCTION/PROCEDURE460Create routine Databases To use CREATE FUNCTION/PROCEDURE
461Create temporary tables Databases To use CREATE TEMPORARY TABLE461Create temporary tables Databases To use CREATE TEMPORARY TABLE
462Create view Tables To create new views462Create view Tables To create new views
463Create user Server Admin To create new users463Create user Server Admin To create new users
464464
=== modified file 'mysql-test/suite/pbxt/r/group_min_max.result'
--- mysql-test/suite/pbxt/r/group_min_max.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/group_min_max.result 2009-08-17 15:57:58 +0000
@@ -133,34 +133,34 @@
133test.t3 analyze status OK133test.t3 analyze status OK
134explain select a1, min(a2) from t1 group by a1;134explain select a1, min(a2) from t1 group by a1;
135id select_type table type possible_keys key key_len ref rows Extra135id select_type table type possible_keys key key_len ref rows Extra
1361 SIMPLE t1 range NULL idx_t1_1 130 NULL 10 Using index for group-by1361 SIMPLE t1 range NULL idx_t1_1 130 NULL 129 Using index for group-by
137explain select a1, max(a2) from t1 group by a1;137explain select a1, max(a2) from t1 group by a1;
138id select_type table type possible_keys key key_len ref rows Extra138id select_type table type possible_keys key key_len ref rows Extra
1391 SIMPLE t1 range NULL idx_t1_1 65 NULL 10 Using index for group-by1391 SIMPLE t1 range NULL idx_t1_1 65 NULL 129 Using index for group-by
140explain select a1, min(a2), max(a2) from t1 group by a1;140explain select a1, min(a2), max(a2) from t1 group by a1;
141id select_type table type possible_keys key key_len ref rows Extra141id select_type table type possible_keys key key_len ref rows Extra
1421 SIMPLE t1 range NULL idx_t1_1 130 NULL 10 Using index for group-by1421 SIMPLE t1 range NULL idx_t1_1 130 NULL 129 Using index for group-by
143explain select a1, a2, b, min(c), max(c) from t1 group by a1,a2,b;143explain select a1, a2, b, min(c), max(c) from t1 group by a1,a2,b;
144id select_type table type possible_keys key key_len ref rows Extra144id select_type table type possible_keys key key_len ref rows Extra
1451 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using index for group-by1451 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using index for group-by
146explain select a1,a2,b,max(c),min(c) from t1 group by a1,a2,b;146explain select a1,a2,b,max(c),min(c) from t1 group by a1,a2,b;
147id select_type table type possible_keys key key_len ref rows Extra147id select_type table type possible_keys key key_len ref rows Extra
1481 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using index for group-by1481 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using index for group-by
149explain select a1,a2,b,max(c),min(c) from t2 group by a1,a2,b;149explain select a1,a2,b,max(c),min(c) from t2 group by a1,a2,b;
150id select_type table type possible_keys key key_len ref rows Extra150id select_type table type possible_keys key key_len ref rows Extra
1511 SIMPLE t2 range NULL idx_t2_1 # NULL # Using index for group-by1511 SIMPLE t2 range NULL idx_t2_1 # NULL # Using index for group-by
152explain select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1;152explain select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1;
153id select_type table type possible_keys key key_len ref rows Extra153id select_type table type possible_keys key key_len ref rows Extra
1541 SIMPLE t1 range NULL idx_t1_1 130 NULL 10 Using index for group-by1541 SIMPLE t1 range NULL idx_t1_1 130 NULL 129 Using index for group-by
155explain select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by a1, a2, b;155explain select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by a1, a2, b;
156id select_type table type possible_keys key key_len ref rows Extra156id select_type table type possible_keys key key_len ref rows Extra
1571 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using index for group-by1571 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using index for group-by
158explain select min(a2) from t1 group by a1;158explain select min(a2) from t1 group by a1;
159id select_type table type possible_keys key key_len ref rows Extra159id select_type table type possible_keys key key_len ref rows Extra
1601 SIMPLE t1 range NULL idx_t1_1 130 NULL 10 Using index for group-by1601 SIMPLE t1 range NULL idx_t1_1 130 NULL 129 Using index for group-by
161explain select a2, min(c), max(c) from t1 group by a1,a2,b;161explain select a2, min(c), max(c) from t1 group by a1,a2,b;
162id select_type table type possible_keys key key_len ref rows Extra162id select_type table type possible_keys key key_len ref rows Extra
1631 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using index for group-by1631 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using index for group-by
164select a1, min(a2) from t1 group by a1;164select a1, min(a2) from t1 group by a1;
165a1 min(a2)165a1 min(a2)
166a a166a a
@@ -293,13 +293,13 @@
2931 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 1 Using where2931 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 1 Using where
294explain select a1,a2,b, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;294explain select a1,a2,b, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
295id select_type table type possible_keys key key_len ref rows Extra295id select_type table type possible_keys key key_len ref rows Extra
2961 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 1 Using where; Using index for group-by2961 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 2 Using where; Using index for group-by
297explain select a1, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;297explain select a1, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
298id select_type table type possible_keys key key_len ref rows Extra298id select_type table type possible_keys key key_len ref rows Extra
2991 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 1 Using where; Using index for group-by2991 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 2 Using where; Using index for group-by
300explain select a1,a2,b,min(c),max(c) from t1 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;300explain select a1,a2,b,min(c),max(c) from t1 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
301id select_type table type possible_keys key key_len ref rows Extra301id select_type table type possible_keys key key_len ref rows Extra
3021 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 10 Using where; Using index for group-by3021 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 129 Using where; Using index for group-by
303explain select a1,a2,b, max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;303explain select a1,a2,b, max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
304id select_type table type possible_keys key key_len ref rows Extra304id select_type table type possible_keys key key_len ref rows Extra
3051 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 65 NULL 3 Using where; Using index3051 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 65 NULL 3 Using where; Using index
@@ -669,40 +669,40 @@
669d p422669d p422
670explain select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;670explain select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
671id select_type table type possible_keys key key_len ref rows Extra671id select_type table type possible_keys key key_len ref rows Extra
6721 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by6721 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
673explain select a1,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;673explain select a1,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
674id select_type table type possible_keys key key_len ref rows Extra674id select_type table type possible_keys key key_len ref rows Extra
6751 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by6751 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
676explain select a1,a2,b, max(c) from t1 where (b = 'b') group by a1,a2;676explain select a1,a2,b, max(c) from t1 where (b = 'b') group by a1,a2;
677id select_type table type possible_keys key key_len ref rows Extra677id select_type table type possible_keys key key_len ref rows Extra
6781 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by6781 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
679explain select a1,a2,b,min(c),max(c) from t1 where (b = 'b') group by a1,a2;679explain select a1,a2,b,min(c),max(c) from t1 where (b = 'b') group by a1,a2;
680id select_type table type possible_keys key key_len ref rows Extra680id select_type table type possible_keys key key_len ref rows Extra
6811 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by6811 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
682explain select a1,a2, max(c) from t1 where (b = 'b') group by a1,a2;682explain select a1,a2, max(c) from t1 where (b = 'b') group by a1,a2;
683id select_type table type possible_keys key key_len ref rows Extra683id select_type table type possible_keys key key_len ref rows Extra
6841 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by6841 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
685explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') group by a1;685explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') group by a1;
686id select_type table type possible_keys key key_len ref rows Extra686id select_type table type possible_keys key key_len ref rows Extra
6871 SIMPLE t2 range NULL idx_t2_1 163 NULL 10 Using where; Using index for group-by6871 SIMPLE t2 range NULL idx_t2_1 163 NULL 165 Using where; Using index for group-by
688explain select a1,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') group by a1;688explain select a1,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') group by a1;
689id select_type table type possible_keys key key_len ref rows Extra689id select_type table type possible_keys key key_len ref rows Extra
6901 SIMPLE t2 range NULL idx_t2_1 163 NULL 10 Using where; Using index for group-by6901 SIMPLE t2 range NULL idx_t2_1 163 NULL 165 Using where; Using index for group-by
691explain select a1,a2,b, max(c) from t2 where (b = 'b') group by a1,a2;691explain select a1,a2,b, max(c) from t2 where (b = 'b') group by a1,a2;
692id select_type table type possible_keys key key_len ref rows Extra692id select_type table type possible_keys key key_len ref rows Extra
6931 SIMPLE t2 range NULL idx_t2_1 146 NULL 10 Using where; Using index for group-by6931 SIMPLE t2 range NULL idx_t2_1 146 NULL 165 Using where; Using index for group-by
694explain select a1,a2,b,min(c),max(c) from t2 where (b = 'b') group by a1,a2;694explain select a1,a2,b,min(c),max(c) from t2 where (b = 'b') group by a1,a2;
695id select_type table type possible_keys key key_len ref rows Extra695id select_type table type possible_keys key key_len ref rows Extra
6961 SIMPLE t2 range NULL idx_t2_1 163 NULL 10 Using where; Using index for group-by6961 SIMPLE t2 range NULL idx_t2_1 163 NULL 165 Using where; Using index for group-by
697explain select a1,a2, max(c) from t2 where (b = 'b') group by a1,a2;697explain select a1,a2, max(c) from t2 where (b = 'b') group by a1,a2;
698id select_type table type possible_keys key key_len ref rows Extra698id select_type table type possible_keys key key_len ref rows Extra
6991 SIMPLE t2 range NULL idx_t2_1 146 NULL 10 Using where; Using index for group-by6991 SIMPLE t2 range NULL idx_t2_1 146 NULL 165 Using where; Using index for group-by
700explain select a1,a2,b,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;700explain select a1,a2,b,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
701id select_type table type possible_keys key key_len ref rows Extra701id select_type table type possible_keys key key_len ref rows Extra
7021 SIMPLE t3 range NULL idx_t3_1 6 NULL 10 Using where; Using index for group-by7021 SIMPLE t3 range NULL idx_t3_1 6 NULL 193 Using where; Using index for group-by
703explain select a1,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;703explain select a1,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
704id select_type table type possible_keys key key_len ref rows Extra704id select_type table type possible_keys key key_len ref rows Extra
7051 SIMPLE t3 range NULL idx_t3_1 6 NULL 10 Using where; Using index for group-by7051 SIMPLE t3 range NULL idx_t3_1 6 NULL 193 Using where; Using index for group-by
706select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;706select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
707a1 a2 b max(c) min(c)707a1 a2 b max(c) min(c)
708a a b h112 e112708a a b h112 e112
@@ -804,22 +804,22 @@
804c h312 e312804c h312 e312
805explain select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1;805explain select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1;
806id select_type table type possible_keys key key_len ref rows Extra806id select_type table type possible_keys key key_len ref rows Extra
8071 SIMPLE t2 range NULL idx_t2_1 163 NULL 10 Using where; Using index for group-by8071 SIMPLE t2 range NULL idx_t2_1 163 NULL 165 Using where; Using index for group-by
808explain select a1,a2,b,max(c) from t2 where (a2 = 'a') and b is NULL group by a1;808explain select a1,a2,b,max(c) from t2 where (a2 = 'a') and b is NULL group by a1;
809id select_type table type possible_keys key key_len ref rows Extra809id select_type table type possible_keys key key_len ref rows Extra
8101 SIMPLE t2 range NULL idx_t2_1 146 NULL 10 Using where; Using index for group-by8101 SIMPLE t2 range NULL idx_t2_1 146 NULL 165 Using where; Using index for group-by
811explain select a1,a2,b,min(c) from t2 where b is NULL group by a1,a2;811explain select a1,a2,b,min(c) from t2 where b is NULL group by a1,a2;
812id select_type table type possible_keys key key_len ref rows Extra812id select_type table type possible_keys key key_len ref rows Extra
8131 SIMPLE t2 range NULL idx_t2_1 163 NULL 10 Using where; Using index for group-by8131 SIMPLE t2 range NULL idx_t2_1 163 NULL 165 Using where; Using index for group-by
814explain select a1,a2,b,max(c) from t2 where b is NULL group by a1,a2;814explain select a1,a2,b,max(c) from t2 where b is NULL group by a1,a2;
815id select_type table type possible_keys key key_len ref rows Extra815id select_type table type possible_keys key key_len ref rows Extra
8161 SIMPLE t2 range NULL idx_t2_1 146 NULL 10 Using where; Using index for group-by8161 SIMPLE t2 range NULL idx_t2_1 146 NULL 165 Using where; Using index for group-by
817explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;817explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
818id select_type table type possible_keys key key_len ref rows Extra818id select_type table type possible_keys key key_len ref rows Extra
8191 SIMPLE t2 range NULL idx_t2_1 163 NULL 10 Using where; Using index for group-by8191 SIMPLE t2 range NULL idx_t2_1 163 NULL 165 Using where; Using index for group-by
820explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;820explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
821id select_type table type possible_keys key key_len ref rows Extra821id select_type table type possible_keys key key_len ref rows Extra
8221 SIMPLE t2 range NULL idx_t2_1 163 NULL 10 Using where; Using index for group-by8221 SIMPLE t2 range NULL idx_t2_1 163 NULL 165 Using where; Using index for group-by
823select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1;823select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1;
824a1 a2 b min(c)824a1 a2 b min(c)
825a a NULL a777825a a NULL a777
@@ -849,49 +849,49 @@
8491 SIMPLE t1 range NULL idx_t1_1 147 NULL # Using where; Using index for group-by8491 SIMPLE t1 range NULL idx_t1_1 147 NULL # Using where; Using index for group-by
850explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b;850explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b;
851id select_type table type possible_keys key key_len ref rows Extra851id select_type table type possible_keys key key_len ref rows Extra
8521 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by8521 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
853explain select a1,a2,b, max(c) from t1 where (c > 'f123') group by a1,a2,b;853explain select a1,a2,b, max(c) from t1 where (c > 'f123') group by a1,a2,b;
854id select_type table type possible_keys key key_len ref rows Extra854id select_type table type possible_keys key key_len ref rows Extra
8551 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by8551 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
856explain select a1,a2,b,min(c),max(c) from t1 where (c > 'f123') group by a1,a2,b;856explain select a1,a2,b,min(c),max(c) from t1 where (c > 'f123') group by a1,a2,b;
857id select_type table type possible_keys key key_len ref rows Extra857id select_type table type possible_keys key key_len ref rows Extra
8581 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by8581 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
859explain select a1,a2,b, max(c) from t1 where (c < 'a0') group by a1,a2,b;859explain select a1,a2,b, max(c) from t1 where (c < 'a0') group by a1,a2,b;
860id select_type table type possible_keys key key_len ref rows Extra860id select_type table type possible_keys key key_len ref rows Extra
8611 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by8611 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
862explain select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') group by a1,a2,b;862explain select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') group by a1,a2,b;
863id select_type table type possible_keys key key_len ref rows Extra863id select_type table type possible_keys key key_len ref rows Extra
8641 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by8641 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
865explain select a1,a2,b, max(c) from t1 where (c < 'k321') group by a1,a2,b;865explain select a1,a2,b, max(c) from t1 where (c < 'k321') group by a1,a2,b;
866id select_type table type possible_keys key key_len ref rows Extra866id select_type table type possible_keys key key_len ref rows Extra
8671 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by8671 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
868explain select a1,a2,b,min(c),max(c) from t1 where (c < 'k321') group by a1,a2,b;868explain select a1,a2,b,min(c),max(c) from t1 where (c < 'k321') group by a1,a2,b;
869id select_type table type possible_keys key key_len ref rows Extra869id select_type table type possible_keys key key_len ref rows Extra
8701 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by8701 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
871explain select a1,a2,b, max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;871explain select a1,a2,b, max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
872id select_type table type possible_keys key key_len ref rows Extra872id select_type table type possible_keys key key_len ref rows Extra
8731 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by8731 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
874explain select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;874explain select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
875id select_type table type possible_keys key key_len ref rows Extra875id select_type table type possible_keys key key_len ref rows Extra
8761 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by8761 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
877explain select a1,a2,b, max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;877explain select a1,a2,b, max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
878id select_type table type possible_keys key key_len ref rows Extra878id select_type table type possible_keys key key_len ref rows Extra
8791 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by8791 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
880explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;880explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
881id select_type table type possible_keys key key_len ref rows Extra881id select_type table type possible_keys key key_len ref rows Extra
8821 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by8821 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
883explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b111') and (c <= 'g112') group by a1,a2,b;883explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b111') and (c <= 'g112') group by a1,a2,b;
884id select_type table type possible_keys key key_len ref rows Extra884id select_type table type possible_keys key key_len ref rows Extra
8851 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by8851 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
886explain select a1,a2,b,min(c),max(c) from t1 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b;886explain select a1,a2,b,min(c),max(c) from t1 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b;
887id select_type table type possible_keys key key_len ref rows Extra887id select_type table type possible_keys key key_len ref rows Extra
8881 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by8881 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
889explain select a1,a2,b,min(c),max(c) from t1 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b;889explain select a1,a2,b,min(c),max(c) from t1 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b;
890id select_type table type possible_keys key key_len ref rows Extra890id select_type table type possible_keys key key_len ref rows Extra
8911 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by8911 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
892explain select a1,a2,b,min(c),max(c) from t1 where (c between 'b111' and 'g112') or (c between 'd000' and 'i110') group by a1,a2,b;892explain select a1,a2,b,min(c),max(c) from t1 where (c between 'b111' and 'g112') or (c between 'd000' and 'i110') group by a1,a2,b;
893id select_type table type possible_keys key key_len ref rows Extra893id select_type table type possible_keys key key_len ref rows Extra
8941 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by8941 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
895explain select a1,a2,b, max(c) from t2 where (c > 'b1') group by a1,a2,b;895explain select a1,a2,b, max(c) from t2 where (c > 'b1') group by a1,a2,b;
896id select_type table type possible_keys key key_len ref rows Extra896id select_type table type possible_keys key key_len ref rows Extra
8971 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by8971 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
@@ -1364,29 +1364,29 @@
1364where exists ( select * from t2 where t2.c > 'b1' )1364where exists ( select * from t2 where t2.c > 'b1' )
1365group by a1,a2,b;1365group by a1,a2,b;
1366id select_type table type possible_keys key key_len ref rows Extra1366id select_type table type possible_keys key key_len ref rows Extra
13671 PRIMARY t1 range NULL idx_t1_1 147 NULL 10 Using index for group-by13671 PRIMARY t1 range NULL idx_t1_1 147 NULL 129 Using index for group-by
13682 SUBQUERY t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index13682 SUBQUERY t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index
1369explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;1369explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
1370id select_type table type possible_keys key key_len ref rows Extra1370id select_type table type possible_keys key key_len ref rows Extra
13711 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 10 Using where; Using index for group-by13711 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 129 Using where; Using index for group-by
1372explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;1372explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
1373id select_type table type possible_keys key key_len ref rows Extra1373id select_type table type possible_keys key key_len ref rows Extra
13741 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 163 NULL 10 Using where; Using index for group-by13741 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 163 NULL 129 Using where; Using index for group-by
1375explain select a1,a2,b,min(c),max(c) from t1 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;1375explain select a1,a2,b,min(c),max(c) from t1 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
1376id select_type table type possible_keys key key_len ref rows Extra1376id select_type table type possible_keys key key_len ref rows Extra
13771 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by13771 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
1378explain select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b;1378explain select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b;
1379id select_type table type possible_keys key key_len ref rows Extra1379id select_type table type possible_keys key key_len ref rows Extra
13801 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 163 NULL 1 Using where; Using index for group-by13801 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 163 NULL 2 Using where; Using index for group-by
1381explain select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b;1381explain select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b;
1382id select_type table type possible_keys key key_len ref rows Extra1382id select_type table type possible_keys key key_len ref rows Extra
13831 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 163 NULL 1 Using where; Using index for group-by13831 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 163 NULL 2 Using where; Using index for group-by
1384explain select a1,a2,b,min(c) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;1384explain select a1,a2,b,min(c) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
1385id select_type table type possible_keys key key_len ref rows Extra1385id select_type table type possible_keys key key_len ref rows Extra
13861 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 1 Using where13861 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 1 Using where
1387explain select a1,a2,b,min(c) from t1 where (ord(a1) > 97) and (ord(a2) + ord(a1) > 194) and (b = 'c') group by a1,a2,b;1387explain select a1,a2,b,min(c) from t1 where (ord(a1) > 97) and (ord(a2) + ord(a1) > 194) and (b = 'c') group by a1,a2,b;
1388id select_type table type possible_keys key key_len ref rows Extra1388id select_type table type possible_keys key key_len ref rows Extra
13891 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by13891 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
1390explain select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;1390explain select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
1391id select_type table type possible_keys key key_len ref rows Extra1391id select_type table type possible_keys key key_len ref rows Extra
13921 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by13921 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
@@ -1491,13 +1491,13 @@
1491a1 a2 b min(c)1491a1 a2 b min(c)
1492explain select a1,a2,b from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;1492explain select a1,a2,b from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
1493id select_type table type possible_keys key key_len ref rows Extra1493id select_type table type possible_keys key key_len ref rows Extra
14941 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 10 Using where; Using index for group-by14941 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 129 Using where; Using index for group-by
1495explain select a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;1495explain select a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
1496id select_type table type possible_keys key key_len ref rows Extra1496id select_type table type possible_keys key key_len ref rows Extra
14971 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by14971 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
1498explain select a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;1498explain select a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
1499id select_type table type possible_keys key key_len ref rows Extra1499id select_type table type possible_keys key key_len ref rows Extra
15001 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by15001 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
1501explain select a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;1501explain select a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
1502id select_type table type possible_keys key key_len ref rows Extra1502id select_type table type possible_keys key key_len ref rows Extra
15031 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 1 Using where15031 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 1 Using where
@@ -1554,13 +1554,13 @@
1554a1 a2 b1554a1 a2 b
1555explain select distinct a1,a2,b from t1;1555explain select distinct a1,a2,b from t1;
1556id select_type table type possible_keys key key_len ref rows Extra1556id select_type table type possible_keys key key_len ref rows Extra
15571 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using index for group-by15571 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using index for group-by
1558explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a');1558explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a');
1559id select_type table type possible_keys key key_len ref rows Extra1559id select_type table type possible_keys key key_len ref rows Extra
15601 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by15601 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
1561explain extended select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');1561explain extended select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
1562id select_type table type possible_keys key key_len ref rows filtered Extra1562id select_type table type possible_keys key key_len ref rows filtered Extra
15631 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 100.00 Using where; Using index for group-by15631 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 99.22 Using where; Using index for group-by
1564Warnings:1564Warnings:
1565Note 1003 select distinct `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`c` = 'i121') and (`test`.`t1`.`b` = 'a') and (`test`.`t1`.`a2` >= 'b'))1565Note 1003 select distinct `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`c` = 'i121') and (`test`.`t1`.`b` = 'a') and (`test`.`t1`.`a2` >= 'b'))
1566explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');1566explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
@@ -1577,7 +1577,7 @@
15771 SIMPLE t2 range NULL idx_t2_2 146 NULL # Using where; Using index for group-by15771 SIMPLE t2 range NULL idx_t2_2 146 NULL # Using where; Using index for group-by
1578explain extended select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121');1578explain extended select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
1579id select_type table type possible_keys key key_len ref rows filtered Extra1579id select_type table type possible_keys key key_len ref rows filtered Extra
15801 SIMPLE t2 range NULL idx_t2_1 163 NULL 10 100.00 Using where; Using index for group-by15801 SIMPLE t2 range NULL idx_t2_1 163 NULL 165 99.39 Using where; Using index for group-by
1581Warnings:1581Warnings:
1582Note 1003 select distinct `test`.`t2`.`a1` AS `a1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` = 'i121') and (`test`.`t2`.`b` = 'a') and (`test`.`t2`.`a2` >= 'b'))1582Note 1003 select distinct `test`.`t2`.`a1` AS `a1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` = 'i121') and (`test`.`t2`.`b` = 'a') and (`test`.`t2`.`a2` >= 'b'))
1583explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c');1583explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
@@ -1702,19 +1702,19 @@
1702d e1702d e
1703explain select distinct a1,a2,b from t1;1703explain select distinct a1,a2,b from t1;
1704id select_type table type possible_keys key key_len ref rows Extra1704id select_type table type possible_keys key key_len ref rows Extra
17051 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using index for group-by17051 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using index for group-by
1706explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;1706explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
1707id select_type table type possible_keys key key_len ref rows Extra1707id select_type table type possible_keys key key_len ref rows Extra
17081 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by17081 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by
1709explain select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;1709explain select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
1710id select_type table type possible_keys key key_len ref rows Extra1710id select_type table type possible_keys key key_len ref rows Extra
17111 SIMPLE t1 range NULL idx_t1_1 163 NULL 10 Using where; Using index for group-by17111 SIMPLE t1 range NULL idx_t1_1 163 NULL 129 Using where; Using index for group-by
1712explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;1712explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
1713id select_type table type possible_keys key key_len ref rows Extra1713id select_type table type possible_keys key key_len ref rows Extra
17141 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 1 Using where17141 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 1 Using where
1715explain select distinct b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;1715explain select distinct b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
1716id select_type table type possible_keys key key_len ref rows Extra1716id select_type table type possible_keys key key_len ref rows Extra
17171 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using where; Using index for group-by; Using temporary; Using filesort17171 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using where; Using index for group-by; Using temporary; Using filesort
1718explain select distinct a1,a2,b from t2;1718explain select distinct a1,a2,b from t2;
1719id select_type table type possible_keys key key_len ref rows Extra1719id select_type table type possible_keys key key_len ref rows Extra
17201 SIMPLE t2 range NULL idx_t2_2 146 NULL # Using index for group-by17201 SIMPLE t2 range NULL idx_t2_2 146 NULL # Using index for group-by
@@ -1846,7 +1846,7 @@
18461 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 1 Using where18461 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 65 NULL 1 Using where
1847explain select concat(ord(min(b)),ord(max(b))),min(b),max(b) from t1 group by a1,a2;1847explain select concat(ord(min(b)),ord(max(b))),min(b),max(b) from t1 group by a1,a2;
1848id select_type table type possible_keys key key_len ref rows Extra1848id select_type table type possible_keys key key_len ref rows Extra
18491 SIMPLE t1 range NULL idx_t1_1 147 NULL 10 Using index for group-by18491 SIMPLE t1 range NULL idx_t1_1 147 NULL 129 Using index for group-by
1850select a1,a2,b, concat(min(c), max(c)) from t1 where a1 < 'd' group by a1,a2,b;1850select a1,a2,b, concat(min(c), max(c)) from t1 where a1 < 'd' group by a1,a2,b;
1851a1 a2 b concat(min(c), max(c))1851a1 a2 b concat(min(c), max(c))
1852a a a a111d1111852a a a a111d111
@@ -1985,7 +1985,7 @@
1985d1985d
1986explain select a1 from t1 where a2 = 'b' group by a1;1986explain select a1 from t1 where a2 = 'b' group by a1;
1987id select_type table type possible_keys key key_len ref rows Extra1987id select_type table type possible_keys key key_len ref rows Extra
19881 SIMPLE t1 range NULL idx_t1_1 130 NULL 10 Using where; Using index for group-by19881 SIMPLE t1 range NULL idx_t1_1 130 NULL 129 Using where; Using index for group-by
1989select a1 from t1 where a2 = 'b' group by a1;1989select a1 from t1 where a2 = 'b' group by a1;
1990a11990a1
1991a1991a
@@ -1994,7 +1994,7 @@
1994d1994d
1995explain select distinct a1 from t1 where a2 = 'b';1995explain select distinct a1 from t1 where a2 = 'b';
1996id select_type table type possible_keys key key_len ref rows Extra1996id select_type table type possible_keys key key_len ref rows Extra
19971 SIMPLE t1 range NULL idx_t1_1 130 NULL 10 Using where; Using index for group-by19971 SIMPLE t1 range NULL idx_t1_1 130 NULL 129 Using where; Using index for group-by
1998select distinct a1 from t1 where a2 = 'b';1998select distinct a1 from t1 where a2 = 'b';
1999a11999a1
2000a2000a
@@ -2188,7 +2188,7 @@
2188(2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6);2188(2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6);
2189EXPLAIN SELECT max(b), a FROM t1 GROUP BY a;2189EXPLAIN SELECT max(b), a FROM t1 GROUP BY a;
2190id select_type table type possible_keys key key_len ref rows Extra2190id select_type table type possible_keys key key_len ref rows Extra
21911 SIMPLE t1 range NULL a 5 NULL 8 Using index for group-by21911 SIMPLE t1 index NULL a 10 NULL 15 Using index
2192FLUSH STATUS;2192FLUSH STATUS;
2193SELECT max(b), a FROM t1 GROUP BY a;2193SELECT max(b), a FROM t1 GROUP BY a;
2194max(b) a2194max(b) a
@@ -2202,7 +2202,7 @@
2202Handler_read_next 02202Handler_read_next 0
2203EXPLAIN SELECT max(b), a FROM t1 GROUP BY a;2203EXPLAIN SELECT max(b), a FROM t1 GROUP BY a;
2204id select_type table type possible_keys key key_len ref rows Extra2204id select_type table type possible_keys key key_len ref rows Extra
22051 SIMPLE t1 range NULL a 5 NULL 8 Using index for group-by22051 SIMPLE t1 index NULL a 10 NULL 15 Using index
2206FLUSH STATUS;2206FLUSH STATUS;
2207CREATE TABLE t2 SELECT max(b), a FROM t1 GROUP BY a;2207CREATE TABLE t2 SELECT max(b), a FROM t1 GROUP BY a;
2208SHOW STATUS LIKE 'handler_read__e%';2208SHOW STATUS LIKE 'handler_read__e%';
@@ -2235,14 +2235,14 @@
2235EXPLAIN (SELECT max(b), a FROM t1 GROUP BY a) UNION 2235EXPLAIN (SELECT max(b), a FROM t1 GROUP BY a) UNION
2236(SELECT max(b), a FROM t1 GROUP BY a);2236(SELECT max(b), a FROM t1 GROUP BY a);
2237id select_type table type possible_keys key key_len ref rows Extra2237id select_type table type possible_keys key key_len ref rows Extra
22381 PRIMARY t1 range NULL a 5 NULL 8 Using index for group-by22381 PRIMARY t1 index NULL a 10 NULL 15 Using index
22392 UNION t1 range NULL a 5 NULL 8 Using index for group-by22392 UNION t1 index NULL a 10 NULL 15 Using index
2240NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL 2240NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
2241EXPLAIN SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x2241EXPLAIN SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x
2242FROM t1 AS t1_outer;2242FROM t1 AS t1_outer;
2243id select_type table type possible_keys key key_len ref rows Extra2243id select_type table type possible_keys key key_len ref rows Extra
22441 PRIMARY t1_outer index NULL a 10 NULL 15 Using index22441 PRIMARY t1_outer index NULL a 10 NULL 15 Using index
22452 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by22452 SUBQUERY t1 index NULL a 10 NULL 15 Using index
2246EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE EXISTS 2246EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE EXISTS
2247(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);2247(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
2248id select_type table type possible_keys key key_len ref rows Extra2248id select_type table type possible_keys key key_len ref rows Extra
@@ -2252,7 +2252,7 @@
2252(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;2252(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
2253id select_type table type possible_keys key key_len ref rows Extra2253id select_type table type possible_keys key key_len ref rows Extra
22541 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE22541 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
22552 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by22552 SUBQUERY t1 index NULL a 10 NULL 15 Using index
2256EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE 2256EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
2257a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);2257a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
2258id select_type table type possible_keys key key_len ref rows Extra2258id select_type table type possible_keys key key_len ref rows Extra
@@ -2261,21 +2261,21 @@
2261EXPLAIN SELECT 1 FROM t1 AS t1_outer GROUP BY a HAVING 2261EXPLAIN SELECT 1 FROM t1 AS t1_outer GROUP BY a HAVING
2262a > (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);2262a > (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
2263id select_type table type possible_keys key key_len ref rows Extra2263id select_type table type possible_keys key key_len ref rows Extra
22641 PRIMARY t1_outer range NULL a 5 NULL 8 Using index for group-by22641 PRIMARY t1_outer index NULL a 10 NULL 15 Using index
22652 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by22652 SUBQUERY t1 index NULL a 10 NULL 15 Using index
2266EXPLAIN SELECT 1 FROM t1 AS t1_outer1 JOIN t1 AS t1_outer2 2266EXPLAIN SELECT 1 FROM t1 AS t1_outer1 JOIN t1 AS t1_outer2
2267ON t1_outer1.a = (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) 2267ON t1_outer1.a = (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2)
2268AND t1_outer1.b = t1_outer2.b;2268AND t1_outer1.b = t1_outer2.b;
2269id select_type table type possible_keys key key_len ref rows Extra2269id select_type table type possible_keys key key_len ref rows Extra
22701 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index22701 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index
22711 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer22711 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer
22722 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by22722 SUBQUERY t1 index NULL a 10 NULL 15 Using index
2273EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x2273EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x
2274FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2;2274FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2;
2275id select_type table type possible_keys key key_len ref rows Extra2275id select_type table type possible_keys key key_len ref rows Extra
22761 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using index22761 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using index
22772 SUBQUERY t1_outer index NULL a 10 NULL 15 Using index22772 SUBQUERY t1_outer index NULL a 10 NULL 15 Using index
22783 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by22783 SUBQUERY t1 index NULL a 10 NULL 15 Using index
2279CREATE TABLE t3 LIKE t1;2279CREATE TABLE t3 LIKE t1;
2280FLUSH STATUS;2280FLUSH STATUS;
2281INSERT INTO t3 SELECT a,MAX(b) FROM t1 GROUP BY a;2281INSERT INTO t3 SELECT a,MAX(b) FROM t1 GROUP BY a;
@@ -2312,7 +2312,7 @@
2312(4), (2), (1), (2), (2), (4), (1), (4);2312(4), (2), (1), (2), (2), (4), (1), (4);
2313EXPLAIN SELECT DISTINCT(a) FROM t1;2313EXPLAIN SELECT DISTINCT(a) FROM t1;
2314id select_type table type possible_keys key key_len ref rows Extra2314id select_type table type possible_keys key key_len ref rows Extra
23151 SIMPLE t1 range NULL idx 5 NULL 9 Using index for group-by23151 SIMPLE t1 index NULL idx 5 NULL 16 Using index
2316SELECT DISTINCT(a) FROM t1;2316SELECT DISTINCT(a) FROM t1;
2317a2317a
2318123181
@@ -2320,7 +2320,7 @@
2320423204
2321EXPLAIN SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;2321EXPLAIN SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
2322id select_type table type possible_keys key key_len ref rows Extra2322id select_type table type possible_keys key key_len ref rows Extra
23231 SIMPLE t1 range NULL idx 5 NULL 9 Using index for group-by23231 SIMPLE t1 index NULL idx 5 NULL 16 Using index
2324SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;2324SELECT SQL_BIG_RESULT DISTINCT(a) FROM t1;
2325a2325a
2326123261
@@ -2345,7 +2345,7 @@
2345EXPLAIN2345EXPLAIN
2346SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a;2346SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a;
2347id select_type table type possible_keys key key_len ref rows Extra2347id select_type table type possible_keys key key_len ref rows Extra
23481 SIMPLE t1 range NULL break_it 10 NULL 7 Using index for group-by23481 SIMPLE t1 index NULL break_it 10 NULL 12 Using index
2349SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a;2349SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a;
2350a MIN(b) MAX(b)2350a MIN(b) MAX(b)
23511 1 323511 1 3
@@ -2355,7 +2355,7 @@
2355EXPLAIN2355EXPLAIN
2356SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC;2356SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC;
2357id select_type table type possible_keys key key_len ref rows Extra2357id select_type table type possible_keys key key_len ref rows Extra
23581 SIMPLE t1 range NULL break_it 10 NULL 7 Using index for group-by; Using temporary; Using filesort23581 SIMPLE t1 index NULL break_it 10 NULL 12 Using index
2359SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC;2359SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC;
2360a MIN(b) MAX(b)2360a MIN(b) MAX(b)
23614 1 323614 1 3
23622362
=== modified file 'mysql-test/suite/pbxt/r/join.result'
--- mysql-test/suite/pbxt/r/join.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/join.result 2009-08-17 15:57:58 +0000
@@ -774,7 +774,7 @@
774explain select * from t2,t3 where t2.a < 200 and t2.b=t3.b;774explain select * from t2,t3 where t2.a < 200 and t2.b=t3.b;
775id select_type table type possible_keys key key_len ref rows Extra775id select_type table type possible_keys key key_len ref rows Extra
7761 SIMPLE t2 range a,b a 5 NULL 1 Using where7761 SIMPLE t2 range a,b a 5 NULL 1 Using where
7771 SIMPLE t3 ref b b 5 test.t2.b 11 Using where7771 SIMPLE t3 ref b b 5 test.t2.b 1 Using where
778drop table t1, t2, t3;778drop table t1, t2, t3;
779create table t1 (a int);779create table t1 (a int);
780insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);780insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
781781
=== modified file 'mysql-test/suite/pbxt/r/join_nested.result'
--- mysql-test/suite/pbxt/r/join_nested.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/join_nested.result 2009-08-17 15:57:58 +0000
@@ -851,7 +851,7 @@
851id select_type table type possible_keys key key_len ref rows filtered Extra851id select_type table type possible_keys key key_len ref rows filtered Extra
8521 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 8521 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
8531 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using join buffer8531 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
8541 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 2 100.00 8541 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 1 100.00
8551 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 8551 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
856Warnings:856Warnings:
857Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t3` join `test`.`t4` left join (`test`.`t1` join `test`.`t2`) on(((`test`.`t3`.`a` = 1) and (`test`.`t3`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` = `test`.`t4`.`b`))) where 1857Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t3` join `test`.`t4` left join (`test`.`t1` join `test`.`t2`) on(((`test`.`t3`.`a` = 1) and (`test`.`t3`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` = `test`.`t4`.`b`))) where 1
@@ -958,15 +958,15 @@
9581 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where9581 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
9591 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer9591 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
9601 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where9601 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
9611 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00
9611 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where9621 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
9621 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where
9631 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where9631 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
9641 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where9641 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
9651 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where9651 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
9661 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where9661 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where
9671 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer9671 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
968Warnings:968Warnings:
969Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))969Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t3`.`b` = `test`.`t4`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
970CREATE INDEX idx_b ON t8(b);970CREATE INDEX idx_b ON t8(b);
971EXPLAIN EXTENDED971EXPLAIN EXTENDED
972SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,972SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
@@ -1008,14 +1008,14 @@
10081 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer10081 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
10091 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where10091 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
10101 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where10101 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
10111 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where10111 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00
10121 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where10121 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
10131 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
10131 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where10141 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
10141 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where10151 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1 100.00 Using where
10151 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where
10161 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer10161 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
1017Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t3`.`b` = `test`.`t4`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
1017Warnings:1018Warnings:
1018Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
1019CREATE INDEX idx_b ON t1(b);1019CREATE INDEX idx_b ON t1(b);
1020CREATE INDEX idx_a ON t0(a);1020CREATE INDEX idx_a ON t0(a);
1021EXPLAIN EXTENDED1021EXPLAIN EXTENDED
@@ -1055,17 +1055,17 @@
1055(t9.a=1);1055(t9.a=1);
1056id select_type table type possible_keys key key_len ref rows filtered Extra1056id select_type table type possible_keys key key_len ref rows filtered Extra
10571 SIMPLE t0 ref idx_a idx_a 5 const 1 100.00 Using where10571 SIMPLE t0 ref idx_a idx_a 5 const 1 100.00 Using where
10581 SIMPLE t1 ref idx_b idx_b 5 test.t0.b 2 100.00 Using where10581 SIMPLE t1 ref idx_b idx_b 5 test.t0.b 1 100.00 Using where
10591 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where10591 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
10601 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where10601 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
10611 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where10611 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00
10621 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where10621 SIMPLE t5 ALL idx_b NULL NULL NULL 3 100.00 Using where
10631 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
10631 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where10641 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
10641 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where10651 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1 100.00 Using where
10651 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where
10661 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer10661 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer
1067Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t3`.`b` = `test`.`t4`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
1067Warnings:1068Warnings:
1068Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t3`.`a` = 1))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`)))
1069SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,1069SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
1070t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b1070t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
1071FROM t0,t11071FROM t0,t1
@@ -1102,21 +1102,21 @@
1102(t9.a=1);1102(t9.a=1);
1103a b a b a b a b a b a b a b a b a b a b1103a b a b a b a b a b a b a b a b a b a b
11041 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 111041 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1
11051 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 2
11061 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2 1 2
11051 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 111071 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 1
11081 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 2
11061 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 111091 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
11101 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
11111 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2 1 2
11071 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 111121 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 1
11131 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2
11081 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 111141 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
11151 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
11161 2 3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2 1 2
11091 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 111171 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 1
11181 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 2
11101 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 111191 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 1
11111 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 2
11121 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 2
11131 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2 1 2
11141 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
11151 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2
11161 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2 1 2
11171 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
11181 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 2
11191 2 3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2 1 2
11201 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 211201 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 2
1121SELECT t2.a,t2.b1121SELECT t2.a,t2.b
1122FROM t2;1122FROM t2;
@@ -1203,7 +1203,7 @@
1203id select_type table type possible_keys key key_len ref rows Extra1203id select_type table type possible_keys key key_len ref rows Extra
12041 SIMPLE t1 index NULL a 5 NULL 21 Using index12041 SIMPLE t1 index NULL a 5 NULL 21 Using index
12051 SIMPLE t3 index c c 5 NULL 6 Using index12051 SIMPLE t3 index c c 5 NULL 6 Using index
12061 SIMPLE t2 ref b b 5 test.t3.c 2 Using index12061 SIMPLE t2 ref b b 5 test.t3.c 1 Using index
1207EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;1207EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
1208id select_type table type possible_keys key key_len ref rows Extra1208id select_type table type possible_keys key key_len ref rows Extra
12091 SIMPLE t1 index NULL a 5 NULL # Using index12091 SIMPLE t1 index NULL a 5 NULL # Using index
@@ -1484,8 +1484,8 @@
1484on (t1.a = t2.a);1484on (t1.a = t2.a);
1485id select_type table type possible_keys key key_len ref rows Extra1485id select_type table type possible_keys key key_len ref rows Extra
14861 SIMPLE t1 ALL NULL NULL NULL NULL 10 14861 SIMPLE t1 ALL NULL NULL NULL NULL 10
14871 SIMPLE t2 ref a a 5 test.t1.a 11 14871 SIMPLE t2 ref a a 5 test.t1.a 1
14881 SIMPLE t3 ref a a 5 test.t2.a 11 14881 SIMPLE t3 ref a a 5 test.t2.a 1
1489drop table t1, t2, t3;1489drop table t1, t2, t3;
1490CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, type varchar(10));1490CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, type varchar(10));
1491CREATE TABLE t2 (pid int NOT NULL PRIMARY KEY, type varchar(10));1491CREATE TABLE t2 (pid int NOT NULL PRIMARY KEY, type varchar(10));
14921492
=== modified file 'mysql-test/suite/pbxt/r/key.result'
--- mysql-test/suite/pbxt/r/key.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/key.result 2009-08-17 15:57:58 +0000
@@ -153,7 +153,7 @@
153t1 0 a 1 a A 0 NULL NULL BTREE 153t1 0 a 1 a A 0 NULL NULL BTREE
154t1 0 e 1 e A 0 NULL NULL BTREE 154t1 0 e 1 e A 0 NULL NULL BTREE
155t1 0 b 1 b A 0 NULL NULL YES BTREE 155t1 0 b 1 b A 0 NULL NULL YES BTREE
156t1 1 c 1 c A NULL NULL NULL YES BTREE 156t1 1 c 1 c A 0 NULL NULL YES BTREE
157drop table t1;157drop table t1;
158CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,158CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
159UNIQUE (c,i));159UNIQUE (c,i));
160160
=== modified file 'mysql-test/suite/pbxt/r/key_cache.result'
--- mysql-test/suite/pbxt/r/key_cache.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/key_cache.result 2009-08-17 15:57:58 +0000
@@ -122,7 +122,7 @@
122explain select count(*) from t1, t2 where t1.p = t2.i;122explain select count(*) from t1, t2 where t1.p = t2.i;
123id select_type table type possible_keys key key_len ref rows Extra123id select_type table type possible_keys key key_len ref rows Extra
1241 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using index1241 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using index
1251 SIMPLE t2 ref k1 k1 5 test.t1.p 2 Using where; Using index1251 SIMPLE t2 ref k1 k1 5 test.t1.p 1 Using where; Using index
126select count(*) from t1, t2 where t1.p = t2.i;126select count(*) from t1, t2 where t1.p = t2.i;
127count(*)127count(*)
12831283
@@ -257,8 +257,6 @@
257drop table t1,t2,t3;257drop table t1,t2,t3;
258set global keycache2.key_buffer_size=0;258set global keycache2.key_buffer_size=0;
259set global keycache3.key_buffer_size=100;259set global keycache3.key_buffer_size=100;
260Warnings:
261Warning 1292 Truncated incorrect key_buffer_size value: '100'
262set global keycache3.key_buffer_size=0;260set global keycache3.key_buffer_size=0;
263create table t1 (mytext text, FULLTEXT (mytext)) engine=myisam;261create table t1 (mytext text, FULLTEXT (mytext)) engine=myisam;
264insert t1 values ('aaabbb');262insert t1 values ('aaabbb');
265263
=== modified file 'mysql-test/suite/pbxt/r/key_diff.result'
--- mysql-test/suite/pbxt/r/key_diff.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/key_diff.result 2009-08-17 15:57:58 +0000
@@ -36,7 +36,7 @@
36explain select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B;36explain select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B;
37id select_type table type possible_keys key key_len ref rows Extra37id select_type table type possible_keys key key_len ref rows Extra
381 SIMPLE t1 ALL a NULL NULL NULL 5 381 SIMPLE t1 ALL a NULL NULL NULL 5
391 SIMPLE t2 ALL b NULL NULL NULL 5 Using where; Using join buffer391 SIMPLE t2 ref b b 4 test.t1.a 1 Using where
40select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a;40select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a;
41a b a b41a b a b
42A B a a42A B a a
4343
=== modified file 'mysql-test/suite/pbxt/r/mysqlshow.result'
--- mysql-test/suite/pbxt/r/mysqlshow.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/mysqlshow.result 2009-08-17 15:57:58 +0000
@@ -107,7 +107,21 @@
107| TRIGGERS |107| TRIGGERS |
108| USER_PRIVILEGES |108| USER_PRIVILEGES |
109| VIEWS |109| VIEWS |
110| INNODB_BUFFER_POOL_PAGES |
110| PBXT_STATISTICS |111| PBXT_STATISTICS |
112| INNODB_CMP |
113| INNODB_RSEG |
114| XTRADB_ENHANCEMENTS |
115| INNODB_BUFFER_POOL_PAGES_INDEX |
116| INNODB_INDEX_STATS |
117| INNODB_TRX |
118| INNODB_CMP_RESET |
119| INNODB_LOCK_WAITS |
120| INNODB_CMPMEM_RESET |
121| INNODB_LOCKS |
122| INNODB_CMPMEM |
123| INNODB_TABLE_STATS |
124| INNODB_BUFFER_POOL_PAGES_BLOB |
111+---------------------------------------+125+---------------------------------------+
112Database: INFORMATION_SCHEMA126Database: INFORMATION_SCHEMA
113+---------------------------------------+127+---------------------------------------+
@@ -141,7 +155,21 @@
141| TRIGGERS |155| TRIGGERS |
142| USER_PRIVILEGES |156| USER_PRIVILEGES |
143| VIEWS |157| VIEWS |
158| INNODB_BUFFER_POOL_PAGES |
144| PBXT_STATISTICS |159| PBXT_STATISTICS |
160| INNODB_CMP |
161| INNODB_RSEG |
162| XTRADB_ENHANCEMENTS |
163| INNODB_BUFFER_POOL_PAGES_INDEX |
164| INNODB_INDEX_STATS |
165| INNODB_TRX |
166| INNODB_CMP_RESET |
167| INNODB_LOCK_WAITS |
168| INNODB_CMPMEM_RESET |
169| INNODB_LOCKS |
170| INNODB_CMPMEM |
171| INNODB_TABLE_STATS |
172| INNODB_BUFFER_POOL_PAGES_BLOB |
145+---------------------------------------+173+---------------------------------------+
146Wildcard: inf_rmation_schema174Wildcard: inf_rmation_schema
147+--------------------+175+--------------------+
148176
=== modified file 'mysql-test/suite/pbxt/r/null.result'
--- mysql-test/suite/pbxt/r/null.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/null.result 2009-08-17 15:57:58 +0000
@@ -93,9 +93,11 @@
93Warnings:93Warnings:
94Warning 1265 Data truncated for column 'd' at row 194Warning 1265 Data truncated for column 'd' at row 1
95UPDATE t1 SET d=1/NULL;95UPDATE t1 SET d=1/NULL;
96ERROR 23000: Column 'd' cannot be null96Warnings:
97Warning 1265 Data truncated for column 'd' at row 1
97UPDATE t1 SET d=NULL;98UPDATE t1 SET d=NULL;
98ERROR 23000: Column 'd' cannot be null99Warnings:
100Warning 1048 Column 'd' cannot be null
99INSERT INTO t1 (a) values (null);101INSERT INTO t1 (a) values (null);
100ERROR 23000: Column 'a' cannot be null102ERROR 23000: Column 'a' cannot be null
101INSERT INTO t1 (a) values (1/null);103INSERT INTO t1 (a) values (1/null);
@@ -130,7 +132,7 @@
130Warning 1048 Column 'd' cannot be null132Warning 1048 Column 'd' cannot be null
131select * from t1;133select * from t1;
132a b c d134a b c d
133 0 0000-00-00 00:00:00 2003135 0 0000-00-00 00:00:00 0
134 0 0000-00-00 00:00:00 0136 0 0000-00-00 00:00:00 0
135 0 0000-00-00 00:00:00 0137 0 0000-00-00 00:00:00 0
136 0 0000-00-00 00:00:00 0138 0 0000-00-00 00:00:00 0
137139
=== modified file 'mysql-test/suite/pbxt/r/null_key.result'
--- mysql-test/suite/pbxt/r/null_key.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/null_key.result 2009-08-17 15:57:58 +0000
@@ -407,8 +407,8 @@
407LEFT JOIN t3 ON t2.b=t3.b;407LEFT JOIN t3 ON t2.b=t3.b;
408id select_type table type possible_keys key key_len ref rows Extra408id select_type table type possible_keys key key_len ref rows Extra
4091 SIMPLE t1 ALL NULL NULL NULL NULL 4 4091 SIMPLE t1 ALL NULL NULL NULL NULL 4
4101 SIMPLE t2 ref idx idx 5 test.t1.a 2 4101 SIMPLE t2 ref idx idx 5 test.t1.a 1
4111 SIMPLE t3 ref idx idx 5 test.t2.b 186 Using index4111 SIMPLE t3 ref idx idx 5 test.t2.b 1 Using index
412FLUSH STATUS ;412FLUSH STATUS ;
413SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a413SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
414LEFT JOIN t3 ON t2.b=t3.b;414LEFT JOIN t3 ON t2.b=t3.b;
415415
=== modified file 'mysql-test/suite/pbxt/r/partition_pruning.result'
--- mysql-test/suite/pbxt/r/partition_pruning.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/partition_pruning.result 2009-08-17 15:57:58 +0000
@@ -338,12 +338,12 @@
338where X.b = Y.b and (X.a=1 or X.a=2) and (Y.a=2 or Y.a=3);338where X.b = Y.b and (X.a=1 or X.a=2) and (Y.a=2 or Y.a=3);
339id select_type table partitions type possible_keys key key_len ref rows Extra339id select_type table partitions type possible_keys key key_len ref rows Extra
3401 SIMPLE X p1,p2 ALL a,b NULL NULL NULL 2 Using where3401 SIMPLE X p1,p2 ALL a,b NULL NULL NULL 2 Using where
3411 SIMPLE Y p2,p3 ref a,b b 4 test.X.b 2 Using where3411 SIMPLE Y p2,p3 ref a,b b 4 test.X.b 1 Using where
342explain partitions342explain partitions
343select * from t1 X, t1 Y where X.a = Y.a and (X.a=1 or X.a=2);343select * from t1 X, t1 Y where X.a = Y.a and (X.a=1 or X.a=2);
344id select_type table partitions type possible_keys key key_len ref rows Extra344id select_type table partitions type possible_keys key key_len ref rows Extra
3451 SIMPLE X p1,p2 ALL a NULL NULL NULL 4 Using where3451 SIMPLE X p1,p2 ALL a NULL NULL NULL 4 Using where
3461 SIMPLE Y p1,p2 ref a a 4 test.X.a 2 3461 SIMPLE Y p1,p2 ref a a 4 test.X.a 1
347drop table t1;347drop table t1;
348create table t1 (a int) partition by hash(a) partitions 20;348create table t1 (a int) partition by hash(a) partitions 20;
349insert into t1 values (1),(2),(3);349insert into t1 values (1),(2),(3);
350350
=== modified file 'mysql-test/suite/pbxt/r/pbxt_bugs.result'
--- mysql-test/suite/pbxt/r/pbxt_bugs.result 2009-04-02 20:36:52 +0000
+++ mysql-test/suite/pbxt/r/pbxt_bugs.result 2009-08-17 15:57:58 +0000
@@ -1218,3 +1218,59 @@
12180 opq12180 opq
12191 jkl12191 jkl
1220DROP TABLE t1;1220DROP TABLE t1;
1221create table parent (id int primary key);
1222create table child (id int PRIMARY KEY, FOREIGN KEY (id) REFERENCES parent(id));
1223insert into parent values (2), (3), (4);
1224insert into child values (3), (4);
1225delete ignore from parent;
1226ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (Constraint: `FOREIGN_1`)
1227select * from parent;
1228id
12292
12303
12314
1232drop table child, parent;
1233create schema test378222;
1234use test378222;
1235create table t1 (id int primary key);
1236create table t2 (id int primary key);
1237alter table t1 add constraint foreign key (id) references t2 (id);
1238alter table t2 add constraint foreign key (id) references t1 (id);
1239drop schema test378222;
1240create schema test378222a;
1241create schema test378222b;
1242create table test378222a.t1 (id int primary key);
1243create table test378222b.t2 (id int primary key);
1244alter table test378222a.t1 add constraint foreign key (id) references test378222b.t2 (id);
1245alter table test378222b.t2 add constraint foreign key (id) references test378222a.t1 (id);
1246set foreign_key_checks = 1;
1247drop schema test378222a;
1248ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
1249drop schema test378222b;
1250ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
1251set foreign_key_checks = 0;
1252drop schema test378222a;
1253drop schema test378222b;
1254set foreign_key_checks = 1;
1255use test;
1256CREATE TABLE t1(c1 TINYINT AUTO_INCREMENT NULL KEY ) AUTO_INCREMENT=10;
1257SHOW CREATE TABLE t1;
1258Table Create Table
1259t1 CREATE TABLE `t1` (
1260 `c1` tinyint(4) NOT NULL AUTO_INCREMENT,
1261 PRIMARY KEY (`c1`)
1262) ENGINE=PBXT AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
1263INSERT INTO t1 VALUES(null);
1264INSERT INTO t1 VALUES(null);
1265INSERT INTO t1 VALUES(null);
1266SELECT * FROM t1;
1267c1
126810
126911
127012
1271TRUNCATE TABLE t1;
1272INSERT INTO t1 VALUES(null);
1273SELECT * FROM t1;
1274c1
12751
1276DROP TABLE t1;
12211277
=== modified file 'mysql-test/suite/pbxt/r/pbxt_ref_int.result'
--- mysql-test/suite/pbxt/r/pbxt_ref_int.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/pbxt_ref_int.result 2009-08-17 15:57:58 +0000
@@ -166,7 +166,7 @@
166 `parent_id` int(11) DEFAULT NULL,166 `parent_id` int(11) DEFAULT NULL,
167 KEY `par_ind` (`parent_id`),167 KEY `par_ind` (`parent_id`),
168 KEY `child_ind` (`id`),168 KEY `child_ind` (`id`),
169 CONSTRAINT `FOREIGN_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`)169 CONSTRAINT `FOREIGN_1` FOREIGN KEY (`parent_id`) REFERENCES `test`.`parent` (`id`)
170) ENGINE=PBXT DEFAULT CHARSET=latin1170) ENGINE=PBXT DEFAULT CHARSET=latin1
171drop index child_ind on child;171drop index child_ind on child;
172show create table child;172show create table child;
@@ -175,7 +175,7 @@
175 `id` int(11) DEFAULT NULL,175 `id` int(11) DEFAULT NULL,
176 `parent_id` int(11) DEFAULT NULL,176 `parent_id` int(11) DEFAULT NULL,
177 KEY `par_ind` (`parent_id`),177 KEY `par_ind` (`parent_id`),
178 CONSTRAINT `FOREIGN_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`)178 CONSTRAINT `FOREIGN_1` FOREIGN KEY (`parent_id`) REFERENCES `test`.`parent` (`id`)
179) ENGINE=PBXT DEFAULT CHARSET=latin1179) ENGINE=PBXT DEFAULT CHARSET=latin1
180alter table parent add column c1 varchar(40);180alter table parent add column c1 varchar(40);
181insert child values(2000, 2);181insert child values(2000, 2);
@@ -243,7 +243,7 @@
243 `id` int(11) DEFAULT NULL,243 `id` int(11) DEFAULT NULL,
244 `parent_id` int(11) DEFAULT NULL,244 `parent_id` int(11) DEFAULT NULL,
245 KEY `par_ind` (`parent_id`),245 KEY `par_ind` (`parent_id`),
246 CONSTRAINT `FOREIGN_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`)246 CONSTRAINT `FOREIGN_1` FOREIGN KEY (`parent_id`) REFERENCES `test`.`parent` (`id`)
247) ENGINE=PBXT DEFAULT CHARSET=latin1247) ENGINE=PBXT DEFAULT CHARSET=latin1
248alter table child add column c1 varchar(40);248alter table child add column c1 varchar(40);
249insert child values(400, 1, "asd");249insert child values(400, 1, "asd");
@@ -284,7 +284,7 @@
284 `id` int(11) DEFAULT NULL,284 `id` int(11) DEFAULT NULL,
285 `parent_id` int(11) DEFAULT NULL,285 `parent_id` int(11) DEFAULT NULL,
286 KEY `par_ind` (`parent_id`),286 KEY `par_ind` (`parent_id`),
287 CONSTRAINT `FOREIGN_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE CASCADE287 CONSTRAINT `FOREIGN_1` FOREIGN KEY (`parent_id`) REFERENCES `test`.`parent` (`id`) ON DELETE CASCADE
288) ENGINE=PBXT DEFAULT CHARSET=latin1288) ENGINE=PBXT DEFAULT CHARSET=latin1
289insert parent values(1);289insert parent values(1);
290insert child values(100, 1);290insert child values(100, 1);
291291
=== modified file 'mysql-test/suite/pbxt/r/preload.result'
--- mysql-test/suite/pbxt/r/preload.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/preload.result 2009-08-17 15:57:58 +0000
@@ -144,7 +144,7 @@
144load index into cache t3, t2 key (primary,b) ;144load index into cache t3, t2 key (primary,b) ;
145Table Op Msg_type Msg_text145Table Op Msg_type Msg_text
146test.t3 preload_keys Error Table 'test.t3' doesn't exist146test.t3 preload_keys Error Table 'test.t3' doesn't exist
147test.t3 preload_keys error Corrupt147test.t3 preload_keys status Operation failed
148test.t2 preload_keys note The storage engine for the table doesn't support preload_keys148test.t2 preload_keys note The storage engine for the table doesn't support preload_keys
149show status like "key_read%";149show status like "key_read%";
150Variable_name Value150Variable_name Value
@@ -159,7 +159,7 @@
159load index into cache t3 key (b), t2 key (c) ;159load index into cache t3 key (b), t2 key (c) ;
160Table Op Msg_type Msg_text160Table Op Msg_type Msg_text
161test.t3 preload_keys Error Table 'test.t3' doesn't exist161test.t3 preload_keys Error Table 'test.t3' doesn't exist
162test.t3 preload_keys error Corrupt162test.t3 preload_keys status Operation failed
163test.t2 preload_keys note The storage engine for the table doesn't support preload_keys163test.t2 preload_keys note The storage engine for the table doesn't support preload_keys
164show status like "key_read%";164show status like "key_read%";
165Variable_name Value165Variable_name Value
166166
=== modified file 'mysql-test/suite/pbxt/r/ps_1general.result'
--- mysql-test/suite/pbxt/r/ps_1general.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/ps_1general.result 2009-08-17 15:57:58 +0000
@@ -289,7 +289,7 @@
289execute stmt4;289execute stmt4;
290Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment290Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
291t2 0 PRIMARY 1 a A 0 NULL NULL BTREE 291t2 0 PRIMARY 1 a A 0 NULL NULL BTREE
292t2 1 t2_idx 1 b A NULL NULL NULL YES BTREE 292t2 1 t2_idx 1 b A 0 NULL NULL YES BTREE
293prepare stmt4 from ' show table status from test like ''t2%'' ';293prepare stmt4 from ' show table status from test like ''t2%'' ';
294execute stmt4;294execute stmt4;
295Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment295Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
@@ -447,7 +447,7 @@
447def possible_keys 253 4096 0 Y 0 31 8447def possible_keys 253 4096 0 Y 0 31 8
448def key 253 64 0 Y 0 31 8448def key 253 64 0 Y 0 31 8
449def key_len 253 4096 0 Y 0 31 8449def key_len 253 4096 0 Y 0 31 8
450def ref 253 1024 0 Y 0 31 8450def ref 253 2048 0 Y 0 31 8
451def rows 8 10 1 Y 32928 0 63451def rows 8 10 1 Y 32928 0 63
452def Extra 253 255 14 N 1 31 8452def Extra 253 255 14 N 1 31 8
453id select_type table type possible_keys key key_len ref rows Extra453id select_type table type possible_keys key key_len ref rows Extra
@@ -463,7 +463,7 @@
463def possible_keys 253 4096 7 Y 0 31 8463def possible_keys 253 4096 7 Y 0 31 8
464def key 253 64 7 Y 0 31 8464def key 253 64 7 Y 0 31 8
465def key_len 253 4096 1 Y 0 31 8465def key_len 253 4096 1 Y 0 31 8
466def ref 253 1024 0 Y 0 31 8466def ref 253 2048 0 Y 0 31 8
467def rows 8 10 1 Y 32928 0 63467def rows 8 10 1 Y 32928 0 63
468def Extra 253 255 27 N 1 31 8468def Extra 253 255 27 N 1 31 8
469id select_type table type possible_keys key key_len ref rows Extra469id select_type table type possible_keys key key_len ref rows Extra
470470
=== modified file 'mysql-test/suite/pbxt/r/range.result'
--- mysql-test/suite/pbxt/r/range.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/range.result 2009-08-17 15:57:58 +0000
@@ -423,19 +423,19 @@
423explain select * from t1, t2 where t1.uid=t2.uid AND t1.uid > 0;423explain select * from t1, t2 where t1.uid=t2.uid AND t1.uid > 0;
424id select_type table type possible_keys key key_len ref rows Extra424id select_type table type possible_keys key key_len ref rows Extra
4251 SIMPLE t1 range uid_index uid_index 4 NULL 1 Using where4251 SIMPLE t1 range uid_index uid_index 4 NULL 1 Using where
4261 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid 12 4261 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid 1
427explain select * from t1, t2 where t1.uid=t2.uid AND t2.uid > 0;427explain select * from t1, t2 where t1.uid=t2.uid AND t2.uid > 0;
428id select_type table type possible_keys key key_len ref rows Extra428id select_type table type possible_keys key key_len ref rows Extra
4291 SIMPLE t1 range uid_index uid_index 4 NULL 1 Using where4291 SIMPLE t1 range uid_index uid_index 4 NULL 1 Using where
4301 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid 12 4301 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid 1
431explain select * from t1, t2 where t1.uid=t2.uid AND t1.uid != 0;431explain select * from t1, t2 where t1.uid=t2.uid AND t1.uid != 0;
432id select_type table type possible_keys key key_len ref rows Extra432id select_type table type possible_keys key key_len ref rows Extra
4331 SIMPLE t1 range uid_index uid_index 4 NULL 2 Using where4331 SIMPLE t1 range uid_index uid_index 4 NULL 2 Using where
4341 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid 12 4341 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid 1
435explain select * from t1, t2 where t1.uid=t2.uid AND t2.uid != 0;435explain select * from t1, t2 where t1.uid=t2.uid AND t2.uid != 0;
436id select_type table type possible_keys key key_len ref rows Extra436id select_type table type possible_keys key key_len ref rows Extra
4371 SIMPLE t1 range uid_index uid_index 4 NULL 2 Using where4371 SIMPLE t1 range uid_index uid_index 4 NULL 2 Using where
4381 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid 12 4381 SIMPLE t2 ref uid_index uid_index 4 test.t1.uid 1
439select * from t1, t2 where t1.uid=t2.uid AND t1.uid > 0;439select * from t1, t2 where t1.uid=t2.uid AND t1.uid > 0;
440id name uid id name uid440id name uid id name uid
4411001 A 1 1001 A 14411001 A 1 1001 A 1
442442
=== modified file 'mysql-test/suite/pbxt/r/schema.result'
--- mysql-test/suite/pbxt/r/schema.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/schema.result 2009-08-17 15:57:58 +0000
@@ -3,11 +3,13 @@
3show create schema foo;3show create schema foo;
4Database Create Database4Database Create Database
5foo CREATE DATABASE `foo` /*!40100 DEFAULT CHARACTER SET latin1 */5foo CREATE DATABASE `foo` /*!40100 DEFAULT CHARACTER SET latin1 */
6create table t1 (id int) engine=pbxt;
6show schemas;7show schemas;
7Database8Database
8information_schema9information_schema
9foo10foo
10mtr11mtr
11mysql12mysql
13pbxt
12test14test
13drop schema foo;15drop schema foo;
1416
=== modified file 'mysql-test/suite/pbxt/r/select.result'
--- mysql-test/suite/pbxt/r/select.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/select.result 2009-08-17 15:57:58 +0000
@@ -604,15 +604,15 @@
604explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;604explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
605id select_type table type possible_keys key key_len ref rows Extra605id select_type table type possible_keys key key_len ref rows Extra
6061 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort6061 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
6071 SIMPLE t3 ref period period 4 test.t1.period 18 6071 SIMPLE t3 ref period period 4 test.t1.period 1
608explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;608explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
609id select_type table type possible_keys key key_len ref rows Extra609id select_type table type possible_keys key key_len ref rows Extra
6101 SIMPLE t3 index period period 4 NULL 1 6101 SIMPLE t3 index period period 4 NULL 10
6111 SIMPLE t1 ref period period 4 test.t3.period 18 6111 SIMPLE t1 ref period period 4 test.t3.period 1
612explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;612explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
613id select_type table type possible_keys key key_len ref rows Extra613id select_type table type possible_keys key key_len ref rows Extra
6141 SIMPLE t1 index period period 4 NULL 1 6141 SIMPLE t1 index period period 4 NULL 10
6151 SIMPLE t3 ref period period 4 test.t1.period 18 6151 SIMPLE t3 ref period period 4 test.t1.period 1
616select period from t1;616select period from t1;
617period617period
61894106189410
@@ -2095,7 +2095,7 @@
2095Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment2095Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
2096t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE 2096t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
2097t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE 2097t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
2098t2 1 fld3 1 fld3 A NULL NULL NULL BTREE 2098t2 1 fld3 1 fld3 A 1199 NULL NULL BTREE
2099drop table t4, t3, t2, t1;2099drop table t4, t3, t2, t1;
2100DO 1;2100DO 1;
2101DO benchmark(100,1+1),1,1;2101DO benchmark(100,1+1),1,1;
@@ -2369,7 +2369,7 @@
2369explain select * from t1 left join t2 on a=c where d in (4);2369explain select * from t1 left join t2 on a=c where d in (4);
2370id select_type table type possible_keys key key_len ref rows Extra2370id select_type table type possible_keys key key_len ref rows Extra
23711 SIMPLE t2 ref c,d d 5 const 1 Using where23711 SIMPLE t2 ref c,d d 5 const 1 Using where
23721 SIMPLE t1 ref a a 5 test.t2.c 2 Using where23721 SIMPLE t1 ref a a 5 test.t2.c 1 Using where
2373select * from t1 left join t2 on a=c where d in (4);2373select * from t1 left join t2 on a=c where d in (4);
2374a b c d2374a b c d
23753 2 3 423753 2 3 4
@@ -2377,7 +2377,7 @@
2377explain select * from t1 left join t2 on a=c where d = 4;2377explain select * from t1 left join t2 on a=c where d = 4;
2378id select_type table type possible_keys key key_len ref rows Extra2378id select_type table type possible_keys key key_len ref rows Extra
23791 SIMPLE t2 ref c,d d 5 const 1 Using where23791 SIMPLE t2 ref c,d d 5 const 1 Using where
23801 SIMPLE t1 ref a a 5 test.t2.c 2 Using where23801 SIMPLE t1 ref a a 5 test.t2.c 1 Using where
2381select * from t1 left join t2 on a=c where d = 4;2381select * from t1 left join t2 on a=c where d = 4;
2382a b c d2382a b c d
23833 2 3 423833 2 3 4
@@ -2403,11 +2403,11 @@
2403EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;2403EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
2404id select_type table type possible_keys key key_len ref rows Extra2404id select_type table type possible_keys key key_len ref rows Extra
24051 SIMPLE t1 ALL NULL NULL NULL NULL 5 24051 SIMPLE t1 ALL NULL NULL NULL NULL 5
24061 SIMPLE t2 ref a a 23 test.t1.a 2 24061 SIMPLE t2 ref a a 23 test.t1.a 1
2407EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;2407EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
2408id select_type table type possible_keys key key_len ref rows Extra2408id select_type table type possible_keys key key_len ref rows Extra
24091 SIMPLE t1 ALL NULL NULL NULL NULL 5 24091 SIMPLE t1 ALL NULL NULL NULL NULL 5
24101 SIMPLE t2 ref a a 23 test.t1.a 2 24101 SIMPLE t2 ref a a 23 test.t1.a 1
2411DROP TABLE t1, t2;2411DROP TABLE t1, t2;
2412CREATE TABLE t1 ( city char(30) );2412CREATE TABLE t1 ( city char(30) );
2413INSERT INTO t1 VALUES ('London');2413INSERT INTO t1 VALUES ('London');
@@ -2792,26 +2792,26 @@
27921 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away27921 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2793select max(key1) from t1 where key1 <= 0.6158;2793select max(key1) from t1 where key1 <= 0.6158;
2794max(key1)2794max(key1)
27950.6158000230789227950.615800023078918
2796select max(key2) from t2 where key2 <= 1.6158;2796select max(key2) from t2 where key2 <= 1.6158;
2797max(key2)2797max(key2)
27981.615800023078927981.61580002307892
2799select min(key1) from t1 where key1 >= 0.3762;2799select min(key1) from t1 where key1 >= 0.3762;
2800min(key1)2800min(key1)
28010.3761999905109428010.376199990510941
2802select min(key2) from t2 where key2 >= 1.3762;2802select min(key2) from t2 where key2 >= 1.3762;
2803min(key2)2803min(key2)
28041.376199960708628041.37619996070862
2805select max(key1), min(key2) from t1, t22805select max(key1), min(key2) from t1, t2
2806where key1 <= 0.6158 and key2 >= 1.3762;2806where key1 <= 0.6158 and key2 >= 1.3762;
2807max(key1) min(key2)2807max(key1) min(key2)
28080.61580002307892 1.376199960708628080.615800023078918 1.37619996070862
2809select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;2809select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
2810max(key1)2810max(key1)
28110.6158000230789228110.615800023078918
2812select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;2812select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
2813min(key1)2813min(key1)
28140.3761999905109428140.376199990510941
2815DROP TABLE t1,t2;2815DROP TABLE t1,t2;
2816CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL);2816CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL);
2817INSERT INTO t1 VALUES (10);2817INSERT INTO t1 VALUES (10);
@@ -3454,7 +3454,7 @@
3454and B.a=5 and B.b=A.e and (B.b =1 or B.b = 3 or B.b=5);3454and B.a=5 and B.b=A.e and (B.b =1 or B.b = 3 or B.b=5);
3455id select_type table type possible_keys key key_len ref rows Extra3455id select_type table type possible_keys key key_len ref rows Extra
34561 SIMPLE A range PRIMARY PRIMARY 12 NULL 1 Using where34561 SIMPLE A range PRIMARY PRIMARY 12 NULL 1 Using where
34571 SIMPLE B ref PRIMARY PRIMARY 8 const,test.A.e 11 34571 SIMPLE B ref PRIMARY PRIMARY 8 const,test.A.e 1
3458drop table t1, t2;3458drop table t1, t2;
3459CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b));3459CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b));
3460INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2),3460INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2),
@@ -3468,12 +3468,12 @@
3468SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6;3468SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6;
3469id select_type table type possible_keys key key_len ref rows Extra3469id select_type table type possible_keys key key_len ref rows Extra
34701 SIMPLE t1 range PRIMARY,b b 5 NULL 1 Using where34701 SIMPLE t1 range PRIMARY,b b 5 NULL 1 Using where
34711 SIMPLE t2 ref c c 5 test.t1.a 2 Using where34711 SIMPLE t2 ref c c 5 test.t1.a 1 Using where
3472EXPLAIN3472EXPLAIN
3473SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0;3473SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0;
3474id select_type table type possible_keys key key_len ref rows Extra3474id select_type table type possible_keys key key_len ref rows Extra
34751 SIMPLE t1 range PRIMARY,b PRIMARY 4 NULL 1 Using where34751 SIMPLE t1 range PRIMARY,b PRIMARY 4 NULL 1 Using where
34761 SIMPLE t2 ref c c 5 test.t1.a 2 Using where34761 SIMPLE t2 ref c c 5 test.t1.a 1 Using where
3477DROP TABLE t1, t2;3477DROP TABLE t1, t2;
3478create table t1 (3478create table t1 (
3479a int unsigned not null auto_increment primary key,3479a int unsigned not null auto_increment primary key,
34803480
=== modified file 'mysql-test/suite/pbxt/r/select_safe.result'
--- mysql-test/suite/pbxt/r/select_safe.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/select_safe.result 2009-08-17 15:57:58 +0000
@@ -70,12 +70,12 @@
70explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;70explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
71id select_type table type possible_keys key key_len ref rows Extra71id select_type table type possible_keys key key_len ref rows Extra
721 SIMPLE t1 ALL b NULL NULL NULL 21 721 SIMPLE t1 ALL b NULL NULL NULL 21
731 SIMPLE t2 ref b b 21 test.t1.b 2 Using where731 SIMPLE t2 ref b b 21 test.t1.b 1 Using where
74set MAX_SEEKS_FOR_KEY=1;74set MAX_SEEKS_FOR_KEY=1;
75explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;75explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
76id select_type table type possible_keys key key_len ref rows Extra76id select_type table type possible_keys key key_len ref rows Extra
771 SIMPLE t1 ALL b NULL NULL NULL 21 771 SIMPLE t1 ALL b NULL NULL NULL 21
781 SIMPLE t2 ref b b 21 test.t1.b 2 Using where781 SIMPLE t2 ref b b 21 test.t1.b 1 Using where
79SET MAX_SEEKS_FOR_KEY=DEFAULT;79SET MAX_SEEKS_FOR_KEY=DEFAULT;
80drop table t1;80drop table t1;
81create table t1 (a int);81create table t1 (a int);
8282
=== modified file 'mysql-test/suite/pbxt/r/subselect.result'
--- mysql-test/suite/pbxt/r/subselect.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/subselect.result 2009-08-17 15:57:58 +0000
@@ -1333,7 +1333,7 @@
1333explain extended select * from t2 where t2.a in (select a from t1);1333explain extended select * from t2 where t2.a in (select a from t1);
1334id select_type table type possible_keys key key_len ref rows filtered Extra1334id select_type table type possible_keys key key_len ref rows filtered Extra
13351 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index13351 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
13362 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where13362 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1 100.00 Using index; Using where
1337Warnings:1337Warnings:
1338Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))1338Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
1339select * from t2 where t2.a in (select a from t1 where t1.b <> 30);1339select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
@@ -1343,7 +1343,7 @@
1343explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);1343explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
1344id select_type table type possible_keys key key_len ref rows filtered Extra1344id select_type table type possible_keys key key_len ref rows filtered Extra
13451 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index13451 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
13462 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where13462 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1 100.00 Using index; Using where
1347Warnings:1347Warnings:
1348Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where ((`test`.`t1`.`b` <> 30) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))))1348Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where ((`test`.`t1`.`b` <> 30) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))))
1349select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);1349select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
@@ -1353,8 +1353,8 @@
1353explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);1353explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
1354id select_type table type possible_keys key key_len ref rows filtered Extra1354id select_type table type possible_keys key key_len ref rows filtered Extra
13551 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index13551 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
13562 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 100.00 Using where; Using index13562 DEPENDENT SUBQUERY t1 ref a a 5 func 1 100.00 Using where; Using index
13572 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 100.00 Using where; Using index; Using join buffer13572 DEPENDENT SUBQUERY t3 ref a a 5 test.t1.b 1 100.00 Using where; Using index
1358Warnings:1358Warnings:
1359Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))1359Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
1360insert into t1 values (3,31);1360insert into t1 values (3,31);
@@ -1370,7 +1370,7 @@
1370explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);1370explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
1371id select_type table type possible_keys key key_len ref rows filtered Extra1371id select_type table type possible_keys key key_len ref rows filtered Extra
13721 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index13721 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
13732 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where13732 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1 100.00 Using index; Using where
1374Warnings:1374Warnings:
1375Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where ((`test`.`t1`.`b` <> 30) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))))1375Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where ((`test`.`t1`.`b` <> 30) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))))
1376drop table t1, t2, t3;1376drop table t1, t2, t3;
@@ -3546,7 +3546,7 @@
3546id select_type table type possible_keys key key_len ref rows Extra3546id select_type table type possible_keys key key_len ref rows Extra
35471 PRIMARY t2 ALL NULL NULL NULL NULL 1 35471 PRIMARY t2 ALL NULL NULL NULL NULL 1
35481 PRIMARY t1 index NULL PRIMARY 16 NULL 11 Using where; Using index; Using join buffer35481 PRIMARY t1 index NULL PRIMARY 16 NULL 11 Using where; Using index; Using join buffer
35492 DEPENDENT SUBQUERY t1 ref PRIMARY PRIMARY 8 test.t2.i1,const 2 Using where; Using index; Using filesort35492 DEPENDENT SUBQUERY t1 ref PRIMARY PRIMARY 8 test.t2.i1,const 1 Using where; Using index; Using filesort
3550SELECT * FROM t1,t23550SELECT * FROM t1,t2
3551WHERE t1.t = (SELECT t1.t FROM t1 3551WHERE t1.t = (SELECT t1.t FROM t1
3552WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i13552WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1
@@ -4214,7 +4214,7 @@
4214EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);4214EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
4215id select_type table type possible_keys key key_len ref rows Extra4215id select_type table type possible_keys key key_len ref rows Extra
42161 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where42161 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
42172 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 2 Using index; Using where42172 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 1 Using index; Using where
4218SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);4218SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
4219a b4219a b
4220CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10));4220CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10));
@@ -4224,14 +4224,14 @@
4224EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);4224EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
4225id select_type table type possible_keys key key_len ref rows Extra4225id select_type table type possible_keys key key_len ref rows Extra
42261 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where42261 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
42272 DEPENDENT SUBQUERY t2 index_subquery I1 I1 4 func 2 Using index; Using where42272 DEPENDENT SUBQUERY t2 index_subquery I1 I1 4 func 1 Using index; Using where
4228SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);4228SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
4229a b4229a b
4230EXPLAIN4230EXPLAIN
4231SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);4231SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
4232id select_type table type possible_keys key key_len ref rows Extra4232id select_type table type possible_keys key key_len ref rows Extra
42331 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where42331 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
42342 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 2 Using index; Using where42342 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 1 Using index; Using where
4235SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);4235SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
4236a b4236a b
4237DROP TABLE t1,t2;4237DROP TABLE t1,t2;
42384238
=== modified file 'mysql-test/suite/pbxt/r/type_enum.result'
--- mysql-test/suite/pbxt/r/type_enum.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/type_enum.result 2009-08-17 15:57:58 +0000
@@ -1776,8 +1776,14 @@
1776 `russian_deviant` enum('E','F','EÿF','F,E') NOT NULL DEFAULT 'E'1776 `russian_deviant` enum('E','F','EÿF','F,E') NOT NULL DEFAULT 'E'
1777) ENGINE=PBXT DEFAULT CHARSET=latin11777) ENGINE=PBXT DEFAULT CHARSET=latin1
1778drop table t1;1778drop table t1;
1779select @@SESSION.sql_mode;
1780@@SESSION.sql_mode
1781
1782select @@GLOBAL.sql_mode;
1783@@GLOBAL.sql_mode
1784
1779create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ',' 1785create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
17801786
17811787
17821788
17831789
17841790
17851791
1786 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\€','zz�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'));1792 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\€','zz�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'));
1787ERROR HY000: Can't create table 'test.t1' (errno: -1)1793drop table t1;
1788End of 5.1 tests1794End of 5.1 tests
17891795
=== modified file 'mysql-test/suite/pbxt/r/type_ranges.result'
--- mysql-test/suite/pbxt/r/type_ranges.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/type_ranges.result 2009-08-17 15:57:58 +0000
@@ -70,19 +70,19 @@
70show keys from t1;70show keys from t1;
71Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment71Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
72t1 0 PRIMARY 1 auto A 0 NULL NULL BTREE 72t1 0 PRIMARY 1 auto A 0 NULL NULL BTREE
73t1 1 utiny 1 utiny A NULL NULL NULL BTREE 73t1 1 utiny 1 utiny A 0 NULL NULL BTREE
74t1 1 tiny 1 tiny A NULL NULL NULL BTREE 74t1 1 tiny 1 tiny A 0 NULL NULL BTREE
75t1 1 short 1 short A NULL NULL NULL BTREE 75t1 1 short 1 short A 0 NULL NULL BTREE
76t1 1 any_name 1 medium A NULL NULL NULL BTREE 76t1 1 any_name 1 medium A 0 NULL NULL BTREE
77t1 1 longlong 1 longlong A NULL NULL NULL BTREE 77t1 1 longlong 1 longlong A 0 NULL NULL BTREE
78t1 1 real_float 1 real_float A NULL NULL NULL BTREE 78t1 1 real_float 1 real_float A 0 NULL NULL BTREE
79t1 1 ushort 1 ushort A NULL NULL NULL BTREE 79t1 1 ushort 1 ushort A 0 NULL NULL BTREE
80t1 1 umedium 1 umedium A NULL NULL NULL BTREE 80t1 1 umedium 1 umedium A 0 NULL NULL BTREE
81t1 1 ulong 1 ulong A NULL NULL NULL BTREE 81t1 1 ulong 1 ulong A 0 NULL NULL BTREE
82t1 1 ulonglong 1 ulonglong A NULL NULL NULL BTREE 82t1 1 ulonglong 1 ulonglong A 0 NULL NULL BTREE
83t1 1 ulonglong 2 ulong A NULL NULL NULL BTREE 83t1 1 ulonglong 2 ulong A 0 NULL NULL BTREE
84t1 1 options 1 options A NULL NULL NULL BTREE 84t1 1 options 1 options A 0 NULL NULL BTREE
85t1 1 options 2 flags A NULL NULL NULL BTREE 85t1 1 options 2 flags A 0 NULL NULL BTREE
86CREATE UNIQUE INDEX test on t1 ( auto ) ;86CREATE UNIQUE INDEX test on t1 ( auto ) ;
87CREATE INDEX test2 on t1 ( ulonglong,ulong) ;87CREATE INDEX test2 on t1 ( ulonglong,ulong) ;
88CREATE INDEX test3 on t1 ( medium ) ;88CREATE INDEX test3 on t1 ( medium ) ;
8989
=== modified file 'mysql-test/suite/pbxt/r/type_timestamp.result'
--- mysql-test/suite/pbxt/r/type_timestamp.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/type_timestamp.result 2009-08-17 15:57:58 +0000
@@ -101,13 +101,13 @@
101t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),101t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
102t14 timestamp(14));102t14 timestamp(14));
103Warnings:103Warnings:
104Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead104Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
105Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead105Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
106Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead106Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
107Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead107Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
108Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead108Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
109Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead109Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
110Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead110Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
111insert t1 values (0,0,0,0,0,0,0),111insert t1 values (0,0,0,0,0,0,0),
112("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",112("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
113"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",113"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
114114
=== modified file 'mysql-test/suite/pbxt/r/union.result'
--- mysql-test/suite/pbxt/r/union.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/union.result 2009-08-17 15:57:58 +0000
@@ -1301,12 +1301,14 @@
1301 `left(a,100000000)` longtext1301 `left(a,100000000)` longtext
1302) ENGINE=PBXT DEFAULT CHARSET=latin11302) ENGINE=PBXT DEFAULT CHARSET=latin1
1303drop tables t1,t2,t3;1303drop tables t1,t2,t3;
1304SELECT @tmp_max:= @@global.max_allowed_packet;
1305@tmp_max:= @@global.max_allowed_packet
13061048576
1307SET @@global.max_allowed_packet=25000000;
1304CREATE TABLE t1 (a mediumtext);1308CREATE TABLE t1 (a mediumtext);
1305CREATE TABLE t2 (b varchar(20));1309CREATE TABLE t2 (b varchar(20));
1306INSERT INTO t1 VALUES ('a');1310INSERT INTO t1 VALUES ('a');
1307CREATE TABLE t3 SELECT REPEAT(a,20000000) AS a FROM t1 UNION SELECT b FROM t2;1311CREATE TABLE t3 SELECT REPEAT(a,20000000) AS a FROM t1 UNION SELECT b FROM t2;
1308Warnings:
1309Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
1310SHOW CREATE TABLE t3;1312SHOW CREATE TABLE t3;
1311Table Create Table1313Table Create Table
1312t3 CREATE TABLE `t3` (1314t3 CREATE TABLE `t3` (
@@ -1340,6 +1342,7 @@
1340 `a` varbinary(510) DEFAULT NULL1342 `a` varbinary(510) DEFAULT NULL
1341) ENGINE=PBXT DEFAULT CHARSET=latin11343) ENGINE=PBXT DEFAULT CHARSET=latin1
1342DROP TABLES t1,t2,t3;1344DROP TABLES t1,t2,t3;
1345SET @@global.max_allowed_packet:= @tmp_max;
1343create table t1 ( id int not null auto_increment, primary key (id), col1 int);1346create table t1 ( id int not null auto_increment, primary key (id), col1 int);
1344insert into t1 (col1) values (2),(3),(4),(5),(6);1347insert into t1 (col1) values (2),(3),(4),(5),(6);
1345select 99 union all select id from t1 order by 1;1348select 99 union all select id from t1 order by 1;
13461349
=== modified file 'mysql-test/suite/pbxt/r/view_grant.result'
--- mysql-test/suite/pbxt/r/view_grant.result 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/r/view_grant.result 2009-08-17 15:57:58 +0000
@@ -28,7 +28,7 @@
28ERROR 42000: ANY command denied to user 'mysqltest_1'@'localhost' for table 't2'28ERROR 42000: ANY command denied to user 'mysqltest_1'@'localhost' for table 't2'
29show create view v1;29show create view v1;
30View Create View character_set_client collation_connection30View Create View character_set_client collation_connection
31v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci31v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci
32grant create view,drop,select on test.* to mysqltest_1@localhost;32grant create view,drop,select on test.* to mysqltest_1@localhost;
33use test;33use test;
34alter view v1 as select * from mysqltest.t1;34alter view v1 as select * from mysqltest.t1;
@@ -309,7 +309,7 @@
309create view v1 as select * from mysqltest.t1;309create view v1 as select * from mysqltest.t1;
310show create view v1;310show create view v1;
311View Create View character_set_client collation_connection311View Create View character_set_client collation_connection
312v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci312v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci
313revoke select on mysqltest.t1 from mysqltest_1@localhost;313revoke select on mysqltest.t1 from mysqltest_1@localhost;
314select * from v1;314select * from v1;
315ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them315ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
316316
=== modified file 'mysql-test/suite/pbxt/t/auto_increment.test'
--- mysql-test/suite/pbxt/t/auto_increment.test 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/t/auto_increment.test 2009-08-17 15:57:58 +0000
@@ -150,7 +150,6 @@
150update t1 set a=0 where b=5;150update t1 set a=0 where b=5;
151select * from t1 order by b;151select * from t1 order by b;
152delete from t1 where a=0;152delete from t1 where a=0;
153--error 1048
154update t1 set a=NULL where b=6;153update t1 set a=NULL where b=6;
155update t1 set a=300 where b=7;154update t1 set a=300 where b=7;
156SET SQL_MODE='';155SET SQL_MODE='';
@@ -166,7 +165,6 @@
166update t1 set a=0 where b=12;165update t1 set a=0 where b=12;
167select * from t1 order by b;166select * from t1 order by b;
168delete from t1 where a=0;167delete from t1 where a=0;
169--error 1048
170update t1 set a=NULL where b=13;168update t1 set a=NULL where b=13;
171update t1 set a=500 where b=14;169update t1 set a=500 where b=14;
172select * from t1 order by b;170select * from t1 order by b;
173171
=== modified file 'mysql-test/suite/pbxt/t/delete.test'
--- mysql-test/suite/pbxt/t/delete.test 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/t/delete.test 2009-08-17 15:57:58 +0000
@@ -120,13 +120,16 @@
120delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);120delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
121select * from t11;121select * from t11;
122select * from t12;122select * from t12;
123--error 1242
123delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);124delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
124select * from t11;125select * from t11;
125select * from t12;126select * from t12;
127--error 1062
126insert into t11 values (2, 12);128insert into t11 values (2, 12);
127-- error 1242129-- error 1242
128delete from t11 where t11.b <> (select b from t2 where t11.a < t2.a);130delete from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
129select * from t11;131select * from t11;
132--error 1242
130delete ignore from t11 where t11.b <> (select b from t2 where t11.a < t2.a);133delete ignore from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
131select * from t11;134select * from t11;
132drop table t11, t12, t2;135drop table t11, t12, t2;
133136
=== modified file 'mysql-test/suite/pbxt/t/join_nested.test'
--- mysql-test/suite/pbxt/t/join_nested.test 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/t/join_nested.test 2009-08-17 15:57:58 +0000
@@ -546,6 +546,7 @@
546546
547CREATE INDEX idx_b ON t8(b);547CREATE INDEX idx_b ON t8(b);
548548
549--sorted_result
549EXPLAIN EXTENDED550EXPLAIN EXTENDED
550SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,551SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
551 t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b552 t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
@@ -585,6 +586,7 @@
585CREATE INDEX idx_b ON t1(b);586CREATE INDEX idx_b ON t1(b);
586CREATE INDEX idx_a ON t0(a);587CREATE INDEX idx_a ON t0(a);
587588
589--sorted_result
588EXPLAIN EXTENDED590EXPLAIN EXTENDED
589SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,591SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
590 t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b592 t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
@@ -621,6 +623,7 @@
621 (t8.b=t9.b OR t8.c IS NULL) AND623 (t8.b=t9.b OR t8.c IS NULL) AND
622 (t9.a=1); 624 (t9.a=1);
623625
626--sorted_result
624SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,627SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
625 t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b628 t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
626 FROM t0,t1629 FROM t0,t1
627630
=== modified file 'mysql-test/suite/pbxt/t/null.test'
--- mysql-test/suite/pbxt/t/null.test 2009-04-02 20:36:52 +0000
+++ mysql-test/suite/pbxt/t/null.test 2009-08-17 15:57:58 +0000
@@ -61,9 +61,7 @@
61#61#
62CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default 0, c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0);62CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default 0, c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0);
63INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";63INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
64--error 1048
65UPDATE t1 SET d=1/NULL;64UPDATE t1 SET d=1/NULL;
66--error 1048
67UPDATE t1 SET d=NULL;65UPDATE t1 SET d=NULL;
68--error 104866--error 1048
69INSERT INTO t1 (a) values (null);67INSERT INTO t1 (a) values (null);
7068
=== modified file 'mysql-test/suite/pbxt/t/pbxt_bugs.test'
--- mysql-test/suite/pbxt/t/pbxt_bugs.test 2009-04-02 20:36:52 +0000
+++ mysql-test/suite/pbxt/t/pbxt_bugs.test 2009-08-17 15:57:58 +0000
@@ -926,7 +926,59 @@
926SELECT * FROM t1 ORDER BY c1;926SELECT * FROM t1 ORDER BY c1;
927DROP TABLE t1;927DROP TABLE t1;
928928
929create table parent (id int primary key);
930create table child (id int PRIMARY KEY, FOREIGN KEY (id) REFERENCES parent(id));
931insert into parent values (2), (3), (4);
932insert into child values (3), (4);
933
934--error 1451
935delete ignore from parent;
936--sorted_result
937select * from parent;
938
939drop table child, parent;
940
941# bug 378222: Drop sakila causes error: Cannot delete or update a parent row: a foreign key constraint fails
942
943create schema test378222;
944use test378222;
945create table t1 (id int primary key);
946create table t2 (id int primary key);
947alter table t1 add constraint foreign key (id) references t2 (id);
948alter table t2 add constraint foreign key (id) references t1 (id);
949drop schema test378222;
950
951create schema test378222a;
952create schema test378222b;
953create table test378222a.t1 (id int primary key);
954create table test378222b.t2 (id int primary key);
955alter table test378222a.t1 add constraint foreign key (id) references test378222b.t2 (id);
956alter table test378222b.t2 add constraint foreign key (id) references test378222a.t1 (id);
957set foreign_key_checks = 1;
958--error 1217
959drop schema test378222a;
960--error 1217
961drop schema test378222b;
962set foreign_key_checks = 0;
963drop schema test378222a;
964drop schema test378222b;
965set foreign_key_checks = 1;
966use test;
967
968# bug 369086: Incosistent/Incorrect Truncate behavior
969CREATE TABLE t1(c1 TINYINT AUTO_INCREMENT NULL KEY ) AUTO_INCREMENT=10;
970SHOW CREATE TABLE t1;
971INSERT INTO t1 VALUES(null);
972INSERT INTO t1 VALUES(null);
973INSERT INTO t1 VALUES(null);
974SELECT * FROM t1;
975TRUNCATE TABLE t1;
976INSERT INTO t1 VALUES(null);
977SELECT * FROM t1;
978DROP TABLE t1;
979
929--disable_query_log980--disable_query_log
981
930DROP TABLE t2, t5;982DROP TABLE t2, t5;
931drop database pbxt;983drop database pbxt;
932--enable_query_log984--enable_query_log
933985
=== modified file 'mysql-test/suite/pbxt/t/rename.test'
--- mysql-test/suite/pbxt/t/rename.test 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/t/rename.test 2009-08-17 15:57:58 +0000
@@ -63,7 +63,28 @@
63# Wait for the the tables to be renamed63# Wait for the the tables to be renamed
64# i.e the query below succeds64# i.e the query below succeds
65let $query= select * from t2, t4;65let $query= select * from t2, t4;
66source include/wait_for_query_to_suceed.inc;66# source include/wait_for_query_to_suceed.inc;
67let $counter= 100;
68
69disable_abort_on_error;
70disable_query_log;
71disable_result_log;
72eval $query;
73while ($mysql_errno)
74{
75 eval $query;
76 sleep 0.1;
77 dec $counter;
78
79 if (!$counter)
80 {
81 die("Waited too long for query to suceed");
82 }
83}
84enable_abort_on_error;
85enable_query_log;
86enable_result_log;
87
6788
68show tables;89show tables;
6990
7091
=== modified file 'mysql-test/suite/pbxt/t/schema.test'
--- mysql-test/suite/pbxt/t/schema.test 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/t/schema.test 2009-08-17 15:57:58 +0000
@@ -10,5 +10,12 @@
1010
11create schema foo;11create schema foo;
12show create schema foo;12show create schema foo;
13# force PBXT schema to be created
14create table t1 (id int) engine=pbxt;
13show schemas;15show schemas;
14drop schema foo;16drop schema foo;
17
18--disable_query_log
19drop table if exists t1;
20drop database pbxt;
21--enable_query_log
1522
=== modified file 'mysql-test/suite/pbxt/t/type_enum.test'
--- mysql-test/suite/pbxt/t/type_enum.test 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/t/type_enum.test 2009-08-17 15:57:58 +0000
@@ -153,12 +153,19 @@
153show create table t1;153show create table t1;
154drop table t1;154drop table t1;
155155
156# ER_WRONG_FIELD_TERMINATORS156# the following create statement sometimes fails like it would if NO_BACKSLASH_ESCAPES sql mode was on,
157--error 1005157# we check sql mode here
158select @@SESSION.sql_mode;
159select @@GLOBAL.sql_mode;
160
161## ER_WRONG_FIELD_TERMINATORS
162#--error 1005
158create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ',' 163create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
159164
160165
161166
162167
163168
164169
165 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\€','zz�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'));170 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\€','zz�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'));
166171
172drop table t1;
173
167--disable_query_log174--disable_query_log
168drop database pbxt;175drop database pbxt;
169--enable_query_log176--enable_query_log
170177
=== modified file 'mysql-test/suite/pbxt/t/union.test'
--- mysql-test/suite/pbxt/t/union.test 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/t/union.test 2009-08-17 15:57:58 +0000
@@ -802,6 +802,10 @@
802# exceeds mediumtext maximum length802# exceeds mediumtext maximum length
803#803#
804804
805SELECT @tmp_max:= @@global.max_allowed_packet;
806SET @@global.max_allowed_packet=25000000;
807# switching connection to allow the new max_allowed_packet take effect
808--connect (newconn, localhost, root,,)
805CREATE TABLE t1 (a mediumtext);809CREATE TABLE t1 (a mediumtext);
806CREATE TABLE t2 (b varchar(20));810CREATE TABLE t2 (b varchar(20));
807INSERT INTO t1 VALUES ('a');811INSERT INTO t1 VALUES ('a');
@@ -823,6 +827,9 @@
823CREATE TABLE t3 SELECT REPEAT(a,2) AS a FROM t1 UNION SELECT b FROM t2;827CREATE TABLE t3 SELECT REPEAT(a,2) AS a FROM t1 UNION SELECT b FROM t2;
824SHOW CREATE TABLE t3;828SHOW CREATE TABLE t3;
825DROP TABLES t1,t2,t3;829DROP TABLES t1,t2,t3;
830--connection default
831SET @@global.max_allowed_packet:= @tmp_max;
832--disconnect newconn
826833
827#834#
828# Bug #10032 Bug in parsing UNION with ORDER BY when one node does not use FROM835# Bug #10032 Bug in parsing UNION with ORDER BY when one node does not use FROM
829836
=== modified file 'storage/pbxt/ChangeLog'
--- storage/pbxt/ChangeLog 2009-04-02 11:49:57 +0000
+++ storage/pbxt/ChangeLog 2009-08-18 07:46:53 +0000
@@ -1,7 +1,75 @@
1PBXT Release Notes1PBXT Release Notes
2==================2==================
33
4------- 1.0.08 RC - Not yet released4------- 1.0.08c RC2 - 2009-08-18
5
6RN266: Updated BLOB streaming glue, used with the PBMS engine. The glue code is now identical to the version of "1.0.08-rc-pbms" version of PBXT available from http://blobstreaming.org/download.
7
8RN265: Changes the sequential reading of data log files to skip gaps, instead of returning EOF. This ensures that extended data records are preserved even when something goes wrong with the way the file is written.
9
10RN264: Fixed a bug that cased an "Data log not found" error after an out of disk space error on a log file. This bug is similar to RN262 in that it allows "gaps" to appear in the data logs.
11
12RN263: Updated xtstat to compile on Windows/MS Visual C++.
13
14RN262: Merged changes for PBMS version 0.5.09.
15
16RN261: Concerning bug #377788: Cannot find index for FK. Fixed buffer overflow which occurred when the error was reported.
17
18RN260: Fixed bug #377788: Cannot find index for FK. PBXT now correctly uses prefix of an index to support FK references (e.g. if key = (c1, c2) then an index on (c1, c2, c3) will work). Also fixed buffer overflow, which occurred when reporting the error.
19
20RN259: Fixed bug #309424: xtstat doesn't use my.cnf. You can now add an [xtstat] section to my.cnf, for use with xtstat.
21
22RN258: updated xt_p_join implementation for Windows to check if a thread has already exited or has not yet started
23
24RN257: Removed false assertion that could fail during restore if a transaction log page was zero-filled
25
26RN256: Update datalog eof pointer only if write opearions were sucessful
27
28RN255: Added re-allocation of of filemap if allocating the of the new map failed. This often happens if there's not enough space on disk.
29
30RN254: When a table with a corrupted index is detected, PBXT creates a file called 'repair-pending' in the pbxt directory, with the name of the table in it. Each table in the file is listed on a line by itself (the last line has no trailing \n). When the table is repaired (using the REPAIR TABLE command), this entry is removed from the file.
31
32RN253: Use fcntl(F_FULLFSYNC) instead of fsync on platforms that support it. Improper fsync operation was presumably the reason of index corruption on Mac OS X.
33
34RN252: Fixed bug #368692: PBXT not reporting data size correctly in information_schema.
35
36------- 1.0.08 RC2 - 2009-06-30
37
38RN251: A Windows-specific test update, also removed false assertion that failed on Windows.
39
40RN250: Fixed a bug that caused recovery to fail when the transaction log ID exceeded 255. The problem was a checksum failed in the log record.
41
42RN249: Fixed bug #313176: Test case timeout. This happened because record cache pages where not properly freed and as soon as cache filled up the performacne degraded.
43
44RN248: PBXT now compiles and runs with MySQL 5.1.35. All tests pass.
45
46RN247: Fixed bug #369086: Incosistent/Incorrect Truncate behavior
47
48RN246: Fixed bug #378222: Drop sakila causes error: Cannot delete or update a parent row: a foreign key constraint fails
49
50RN245: Fixed bug #379315: Inconsistent behavior of DELETE IGNORE and FK constraint.
51
52RN244: Fixed a recovery problem: during the recovery of "record modified" action the table was updated before the old index entries were removed; then the xres_remove_index_entries was supplied the new record which lead to incorrect index update.
53
54RN243: Fixed a bug that caused a recovery failure if partitioned pbxt tables where present. This happended because the recovery used a MySQL function to open tables and the PBXT handler was not yet registered
55
56RN242: Fixed a bug that caused a deadlock if pbxt initialization failed. This happened because pbxt ceanup was done from pbxt_init() with PLUGIN_lock being held by MySQL which lead to a deadlock in the freeer thread
57
58RN241: Fixed a heap corruption bug (writing to a freed memory location). It happened only when memory mapped files were used leading to heap inconsistency and program crash or termination by heap checker. Likely to happen right after or during DROP TABLE but possible in other cases too.
59
60RN240: Load the record cache on read when no using memory mapped files.
61
62RN239: Added PBXT variable pbxt_max_threads. This is the maximum number of threads that can be created PBXT. By default this value is set to 0 which means the number of threads is derived from the MySQL variable max_connections. The value used is max_connections+7. Under Drizzle the default value is 500.
63
64RN238: Added an option to wait for the sweeper to clean up old transactions on a particular connection. This prevents the sweeper from getting too far behind.
65
66RN237: Added an option to lazy delete fixed length index entries. This means the index entries are just marked for deletion, instead of removing the items from the index page. This has the advantage that an exclusive lock is not always required for deletion.
67
68RN236: Fixed bug #349177: a bug in configure.in script.
69
70RN235: Fixed bug 349176: a compiler warning.
71
72RN234: Completed Drizzle integration. All Drizzle tests now run with PBXT.
573
6RN233: Fixed bugs which occur when PBXT is used together with PBMS (BLOB Streaming engine).74RN233: Fixed bugs which occur when PBXT is used together with PBMS (BLOB Streaming engine).
775
876
=== modified file 'storage/pbxt/src/cache_xt.cc'
--- storage/pbxt/src/cache_xt.cc 2009-03-26 12:18:01 +0000
+++ storage/pbxt/src/cache_xt.cc 2009-08-17 11:12:36 +0000
@@ -23,6 +23,10 @@
2323
24#include "xt_config.h"24#include "xt_config.h"
2525
26#ifdef DRIZZLED
27#include <bitset>
28#endif
29
26#ifndef XT_WIN30#ifndef XT_WIN
27#include <unistd.h>31#include <unistd.h>
28#endif32#endif
@@ -51,17 +55,22 @@
51#define IDX_CAC_SEGMENT_COUNT ((off_t) 1 << XT_INDEX_CACHE_SEGMENT_SHIFTS)55#define IDX_CAC_SEGMENT_COUNT ((off_t) 1 << XT_INDEX_CACHE_SEGMENT_SHIFTS)
52#define IDX_CAC_SEGMENT_MASK (IDX_CAC_SEGMENT_COUNT - 1)56#define IDX_CAC_SEGMENT_MASK (IDX_CAC_SEGMENT_COUNT - 1)
5357
54//#define IDX_USE_SPINRWLOCK58#ifdef XT_NO_ATOMICS
55#define IDX_USE_RWMUTEX59#define IDX_CAC_USE_PTHREAD_RW
60#else
61//#define IDX_CAC_USE_RWMUTEX
56//#define IDX_CAC_USE_PTHREAD_RW62//#define IDX_CAC_USE_PTHREAD_RW
63//#define IDX_USE_SPINXSLOCK
64#define IDX_CAC_USE_XSMUTEX
65#endif
5766
58#ifdef IDX_CAC_USE_FASTWRLOCK67#ifdef IDX_CAC_USE_XSMUTEX
59#define IDX_CAC_LOCK_TYPE XTFastRWLockRec68#define IDX_CAC_LOCK_TYPE XTXSMutexRec
60#define IDX_CAC_INIT_LOCK(s, i) xt_fastrwlock_init(s, &(i)->cs_lock)69#define IDX_CAC_INIT_LOCK(s, i) xt_xsmutex_init_with_autoname(s, &(i)->cs_lock)
61#define IDX_CAC_FREE_LOCK(s, i) xt_fastrwlock_free(s, &(i)->cs_lock) 70#define IDX_CAC_FREE_LOCK(s, i) xt_xsmutex_free(s, &(i)->cs_lock)
62#define IDX_CAC_READ_LOCK(i, o) xt_fastrwlock_slock(&(i)->cs_lock, (o))71#define IDX_CAC_READ_LOCK(i, o) xt_xsmutex_slock(&(i)->cs_lock, (o)->t_id)
63#define IDX_CAC_WRITE_LOCK(i, o) xt_fastrwlock_xlock(&(i)->cs_lock, (o))72#define IDX_CAC_WRITE_LOCK(i, o) xt_xsmutex_xlock(&(i)->cs_lock, (o)->t_id)
64#define IDX_CAC_UNLOCK(i, o) xt_fastrwlock_unlock(&(i)->cs_lock, (o))73#define IDX_CAC_UNLOCK(i, o) xt_xsmutex_unlock(&(i)->cs_lock, (o)->t_id)
65#elif defined(IDX_CAC_USE_PTHREAD_RW)74#elif defined(IDX_CAC_USE_PTHREAD_RW)
66#define IDX_CAC_LOCK_TYPE xt_rwlock_type75#define IDX_CAC_LOCK_TYPE xt_rwlock_type
67#define IDX_CAC_INIT_LOCK(s, i) xt_init_rwlock(s, &(i)->cs_lock)76#define IDX_CAC_INIT_LOCK(s, i) xt_init_rwlock(s, &(i)->cs_lock)
@@ -69,13 +78,20 @@
69#define IDX_CAC_READ_LOCK(i, o) xt_slock_rwlock_ns(&(i)->cs_lock)78#define IDX_CAC_READ_LOCK(i, o) xt_slock_rwlock_ns(&(i)->cs_lock)
70#define IDX_CAC_WRITE_LOCK(i, o) xt_xlock_rwlock_ns(&(i)->cs_lock)79#define IDX_CAC_WRITE_LOCK(i, o) xt_xlock_rwlock_ns(&(i)->cs_lock)
71#define IDX_CAC_UNLOCK(i, o) xt_unlock_rwlock_ns(&(i)->cs_lock)80#define IDX_CAC_UNLOCK(i, o) xt_unlock_rwlock_ns(&(i)->cs_lock)
72#elif defined(IDX_USE_RWMUTEX)81#elif defined(IDX_CAC_USE_RWMUTEX)
73#define IDX_CAC_LOCK_TYPE XTRWMutexRec82#define IDX_CAC_LOCK_TYPE XTRWMutexRec
74#define IDX_CAC_INIT_LOCK(s, i) xt_rwmutex_init_with_autoname(s, &(i)->cs_lock)83#define IDX_CAC_INIT_LOCK(s, i) xt_rwmutex_init_with_autoname(s, &(i)->cs_lock)
75#define IDX_CAC_FREE_LOCK(s, i) xt_rwmutex_free(s, &(i)->cs_lock) 84#define IDX_CAC_FREE_LOCK(s, i) xt_rwmutex_free(s, &(i)->cs_lock)
76#define IDX_CAC_READ_LOCK(i, o) xt_rwmutex_slock(&(i)->cs_lock, (o)->t_id)85#define IDX_CAC_READ_LOCK(i, o) xt_rwmutex_slock(&(i)->cs_lock, (o)->t_id)
77#define IDX_CAC_WRITE_LOCK(i, o) xt_rwmutex_xlock(&(i)->cs_lock, (o)->t_id)86#define IDX_CAC_WRITE_LOCK(i, o) xt_rwmutex_xlock(&(i)->cs_lock, (o)->t_id)
78#define IDX_CAC_UNLOCK(i, o) xt_rwmutex_unlock(&(i)->cs_lock, (o)->t_id)87#define IDX_CAC_UNLOCK(i, o) xt_rwmutex_unlock(&(i)->cs_lock, (o)->t_id)
88#elif defined(IDX_CAC_USE_SPINXSLOCK)
89#define IDX_CAC_LOCK_TYPE XTSpinXSLockRec
90#define IDX_CAC_INIT_LOCK(s, i) xt_spinxslock_init_with_autoname(s, &(i)->cs_lock)
91#define IDX_CAC_FREE_LOCK(s, i) xt_spinxslock_free(s, &(i)->cs_lock)
92#define IDX_CAC_READ_LOCK(i, s) xt_spinxslock_slock(&(i)->cs_lock, (s)->t_id)
93#define IDX_CAC_WRITE_LOCK(i, s) xt_spinxslock_xlock(&(i)->cs_lock, (s)->t_id)
94#define IDX_CAC_UNLOCK(i, s) xt_spinxslock_unlock(&(i)->cs_lock, (s)->t_id)
79#endif95#endif
8096
81#define ID_HANDLE_USE_SPINLOCK97#define ID_HANDLE_USE_SPINLOCK
@@ -308,7 +324,8 @@
308324
309 hs = &ind_cac_globals.cg_handle_slot[iref->ir_block->cb_address % XT_HANDLE_SLOTS];325 hs = &ind_cac_globals.cg_handle_slot[iref->ir_block->cb_address % XT_HANDLE_SLOTS];
310326
311 ASSERT_NS(iref->ir_ulock == XT_UNLOCK_READ);327 ASSERT_NS(iref->ir_xlock == FALSE);
328 ASSERT_NS(iref->ir_updated == FALSE);
312 ID_HANDLE_LOCK(&hs->hs_handles_lock);329 ID_HANDLE_LOCK(&hs->hs_handles_lock);
313#ifdef CHECK_HANDLE_STRUCTS330#ifdef CHECK_HANDLE_STRUCTS
314 ic_check_handle_structs();331 ic_check_handle_structs();
@@ -337,10 +354,10 @@
337 * at least an Slock on the index.354 * at least an Slock on the index.
338 * So this excludes anyone who is reading 355 * So this excludes anyone who is reading
339 * cb_handle_count in the index.356 * cb_handle_count in the index.
340 * (all cache block writers, and a freeer).357 * (all cache block writers, and the freeer).
341 *358 *
342 * The increment is safe because I have the list359 * The increment is safe because I have the list
343 * lock, which is required by anyone else360 * lock (hs_handles_lock), which is required by anyone else
344 * who increments or decrements this value.361 * who increments or decrements this value.
345 */362 */
346 iref->ir_block->cb_handle_count++;363 iref->ir_block->cb_handle_count++;
@@ -396,8 +413,11 @@
396 xblock = seg->cs_hash_table[hash_idx];413 xblock = seg->cs_hash_table[hash_idx];
397 while (xblock) {414 while (xblock) {
398 if (block == xblock) {415 if (block == xblock) {
399 /* Found the block... */416 /* Found the block...
400 xt_atomicrwlock_xlock(&block->cb_lock, thread->t_id);417 * {HANDLE-COUNT-SLOCK}
418 * 04.05.2009, changed to slock.
419 */
420 XT_IPAGE_READ_LOCK(&block->cb_lock);
401 goto block_found;421 goto block_found;
402 }422 }
403 xblock = xblock->cb_next;423 xblock = xblock->cb_next;
@@ -431,7 +451,18 @@
431 /* {HANDLE-COUNT-USAGE}451 /* {HANDLE-COUNT-USAGE}
432 * This is safe here because I have excluded452 * This is safe here because I have excluded
433 * all readers by taking an Xlock on the453 * all readers by taking an Xlock on the
434 * cache block.454 * cache block (CHANGED - see below).
455 *
456 * {HANDLE-COUNT-SLOCK}
457 * 04.05.2009, changed to slock.
458 * Should be OK, because:
459 * A have a lock on the list lock (hs_handles_lock),
460 * which prevents concurrent updates to cb_handle_count.
461 *
462 * I have also have a read lock on the cache block
463 * but not a lock on the index. As a result, we cannot
464 * excluded all index writers (and readers of
465 * cb_handle_count.
435 */466 */
436 block->cb_handle_count--;467 block->cb_handle_count--;
437 }468 }
@@ -466,7 +497,7 @@
466 ID_HANDLE_UNLOCK(&hs->hs_handles_lock);497 ID_HANDLE_UNLOCK(&hs->hs_handles_lock);
467498
468 if (block)499 if (block)
469 xt_atomicrwlock_unlock(&block->cb_lock, TRUE);500 XT_IPAGE_UNLOCK(&block->cb_lock, FALSE);
470}501}
471502
472/* Call this function before a referenced cache block is modified!503/* Call this function before a referenced cache block is modified!
@@ -482,17 +513,28 @@
482513
483 hs = &ind_cac_globals.cg_handle_slot[iref->ir_block->cb_address % XT_HANDLE_SLOTS];514 hs = &ind_cac_globals.cg_handle_slot[iref->ir_block->cb_address % XT_HANDLE_SLOTS];
484515
516 ID_HANDLE_LOCK(&hs->hs_handles_lock);
517
485 /* {HANDLE-COUNT-USAGE}518 /* {HANDLE-COUNT-USAGE}
486 * This is only called by updaters of this index block, or519 * This is only called by updaters of this index block, or
487 * the free which holds an Xlock on the index block.520 * the free which holds an Xlock on the index block.
488 *
489 * These are all mutually exclusive for the index block.521 * These are all mutually exclusive for the index block.
522 *
523 * {HANDLE-COUNT-SLOCK}
524 * Do this check again, after we have the list lock (hs_handles_lock).
525 * There is a small chance that the count has changed, since we last
526 * checked because xt_ind_release_handle() only holds
527 * an slock on the index page.
528 *
529 * An updater can sometimes have a XLOCK on the index and an slock
530 * on the cache block. In this case xt_ind_release_handle()
531 * could have run through.
490 */532 */
491 ASSERT_NS(iref->ir_block->cb_handle_count);533 if (!iref->ir_block->cb_handle_count) {
492 if (!iref->ir_block->cb_handle_count)534 ID_HANDLE_UNLOCK(&hs->hs_handles_lock);
493 return OK;535 return OK;
536 }
494537
495 ID_HANDLE_LOCK(&hs->hs_handles_lock);
496#ifdef CHECK_HANDLE_STRUCTS538#ifdef CHECK_HANDLE_STRUCTS
497 ic_check_handle_structs();539 ic_check_handle_structs();
498#endif540#endif
@@ -609,7 +651,7 @@
609#endif651#endif
610652
611 for (u_int i=0; i<ind_cac_globals.cg_block_count; i++) {653 for (u_int i=0; i<ind_cac_globals.cg_block_count; i++) {
612 xt_atomicrwlock_init_with_autoname(self, &block->cb_lock);654 XT_IPAGE_INIT_LOCK(self, &block->cb_lock);
613 block->cb_state = IDX_CAC_BLOCK_FREE;655 block->cb_state = IDX_CAC_BLOCK_FREE;
614 block->cb_next = ind_cac_globals.cg_free_list;656 block->cb_next = ind_cac_globals.cg_free_list;
615#ifdef XT_USE_DIRECT_IO_ON_INDEX657#ifdef XT_USE_DIRECT_IO_ON_INDEX
@@ -836,10 +878,10 @@
836 while (xblock) {878 while (xblock) {
837 if (block == xblock) {879 if (block == xblock) {
838 /* Found the block... */880 /* Found the block... */
839 xt_atomicrwlock_xlock(&block->cb_lock, ot->ot_thread->t_id);881 XT_IPAGE_WRITE_LOCK(&block->cb_lock, ot->ot_thread->t_id);
840 if (block->cb_state != IDX_CAC_BLOCK_CLEAN) {882 if (block->cb_state != IDX_CAC_BLOCK_CLEAN) {
841 /* This block cannot be freeed: */883 /* This block cannot be freeed: */
842 xt_atomicrwlock_unlock(&block->cb_lock, TRUE);884 XT_IPAGE_UNLOCK(&block->cb_lock, TRUE);
843 IDX_CAC_UNLOCK(seg, ot->ot_thread);885 IDX_CAC_UNLOCK(seg, ot->ot_thread);
844#ifdef DEBUG_CHECK_IND_CACHE886#ifdef DEBUG_CHECK_IND_CACHE
845 xt_ind_check_cache(NULL);887 xt_ind_check_cache(NULL);
@@ -878,11 +920,12 @@
878 if (block->cb_handle_count) {920 if (block->cb_handle_count) {
879 XTIndReferenceRec iref;921 XTIndReferenceRec iref;
880 922
881 iref.ir_ulock = XT_UNLOCK_WRITE;923 iref.ir_xlock = TRUE;
924 iref.ir_updated = FALSE;
882 iref.ir_block = block;925 iref.ir_block = block;
883 iref.ir_branch = (XTIdxBranchDPtr) block->cb_data;926 iref.ir_branch = (XTIdxBranchDPtr) block->cb_data;
884 if (!xt_ind_copy_on_write(&iref)) {927 if (!xt_ind_copy_on_write(&iref)) {
885 xt_atomicrwlock_unlock(&block->cb_lock, TRUE);928 XT_IPAGE_UNLOCK(&block->cb_lock, TRUE);
886 return FALSE;929 return FALSE;
887 }930 }
888 }931 }
@@ -918,7 +961,7 @@
918 IDX_TRACE("%d- f%x\n", (int) XT_NODE_ID(address), (int) XT_GET_DISK_2(block->cb_data));961 IDX_TRACE("%d- f%x\n", (int) XT_NODE_ID(address), (int) XT_GET_DISK_2(block->cb_data));
919962
920 /* Unlock BEFORE the block is reused! */963 /* Unlock BEFORE the block is reused! */
921 xt_atomicrwlock_unlock(&block->cb_lock, TRUE);964 XT_IPAGE_UNLOCK(&block->cb_lock, TRUE);
922965
923 xt_unlock_mutex_ns(&ind_cac_globals.cg_lock);966 xt_unlock_mutex_ns(&ind_cac_globals.cg_lock);
924967
@@ -1001,7 +1044,7 @@
1001 * Fetch the block. Note, if we are about to write the block1044 * Fetch the block. Note, if we are about to write the block
1002 * then there is no need to read it from disk!1045 * then there is no need to read it from disk!
1003 */1046 */
1004static XTIndBlockPtr ind_cac_fetch(XTOpenTablePtr ot, xtIndexNodeID address, DcSegmentPtr *ret_seg, xtBool read_data)1047static XTIndBlockPtr ind_cac_fetch(XTOpenTablePtr ot, XTIndexPtr ind, xtIndexNodeID address, DcSegmentPtr *ret_seg, xtBool read_data)
1005{1048{
1006 register XTOpenFilePtr file = ot->ot_ind_file;1049 register XTOpenFilePtr file = ot->ot_ind_file;
1007 register XTIndBlockPtr block, new_block;1050 register XTIndBlockPtr block, new_block;
@@ -1110,6 +1153,7 @@
1110 new_block->cb_state = IDX_CAC_BLOCK_CLEAN;1153 new_block->cb_state = IDX_CAC_BLOCK_CLEAN;
1111 new_block->cb_handle_count = 0;1154 new_block->cb_handle_count = 0;
1112 new_block->cp_flush_seq = 0;1155 new_block->cp_flush_seq = 0;
1156 new_block->cp_del_count = 0;
1113 new_block->cb_dirty_next = NULL;1157 new_block->cb_dirty_next = NULL;
1114 new_block->cb_dirty_prev = NULL;1158 new_block->cb_dirty_prev = NULL;
11151159
@@ -1172,6 +1216,13 @@
1172#endif1216#endif
1173 xt_unlock_mutex_ns(&dcg->cg_lock);1217 xt_unlock_mutex_ns(&dcg->cg_lock);
11741218
1219 /* {LAZY-DEL-INDEX-ITEMS}
1220 * Conditionally count the number of deleted entries in the index:
1221 * We do this before other threads can read the block.
1222 */
1223 if (ind->mi_lazy_delete && read_data)
1224 xt_ind_count_deleted_items(ot->ot_table, ind, block);
1225
1175 /* Add to the hash table: */1226 /* Add to the hash table: */
1176 block->cb_next = seg->cs_hash_table[hash_idx];1227 block->cb_next = seg->cs_hash_table[hash_idx];
1177 seg->cs_hash_table[hash_idx] = block;1228 seg->cs_hash_table[hash_idx] = block;
@@ -1221,10 +1272,10 @@
1221 XTIndBlockPtr block;1272 XTIndBlockPtr block;
1222 DcSegmentPtr seg;1273 DcSegmentPtr seg;
12231274
1224 if (!(block = ind_cac_fetch(ot, address, &seg, FALSE)))1275 if (!(block = ind_cac_fetch(ot, ind, address, &seg, FALSE)))
1225 return FAILED;1276 return FAILED;
12261277
1227 xt_atomicrwlock_xlock(&block->cb_lock, ot->ot_thread->t_id);1278 XT_IPAGE_WRITE_LOCK(&block->cb_lock, ot->ot_thread->t_id);
1228 ASSERT_NS(block->cb_state == IDX_CAC_BLOCK_CLEAN || block->cb_state == IDX_CAC_BLOCK_DIRTY);1279 ASSERT_NS(block->cb_state == IDX_CAC_BLOCK_CLEAN || block->cb_state == IDX_CAC_BLOCK_DIRTY);
1229 memcpy(block->cb_data, data, size);1280 memcpy(block->cb_data, data, size);
1230 block->cp_flush_seq = ot->ot_table->tab_ind_flush_seq;1281 block->cp_flush_seq = ot->ot_table->tab_ind_flush_seq;
@@ -1239,7 +1290,7 @@
1239 xt_spinlock_unlock(&ind->mi_dirty_lock);1290 xt_spinlock_unlock(&ind->mi_dirty_lock);
1240 block->cb_state = IDX_CAC_BLOCK_DIRTY;1291 block->cb_state = IDX_CAC_BLOCK_DIRTY;
1241 }1292 }
1242 xt_atomicrwlock_unlock(&block->cb_lock, TRUE);1293 XT_IPAGE_UNLOCK(&block->cb_lock, TRUE);
1243 IDX_CAC_UNLOCK(seg, ot->ot_thread);1294 IDX_CAC_UNLOCK(seg, ot->ot_thread);
1244#ifdef XT_TRACK_INDEX_UPDATES1295#ifdef XT_TRACK_INDEX_UPDATES
1245 ot->ot_ind_changed++;1296 ot->ot_ind_changed++;
@@ -1259,10 +1310,10 @@
1259 return FAILED;1310 return FAILED;
12601311
1261 if (block) {1312 if (block) {
1262 xt_atomicrwlock_xlock(&block->cb_lock, ot->ot_thread->t_id);1313 XT_IPAGE_WRITE_LOCK(&block->cb_lock, ot->ot_thread->t_id);
1263 ASSERT_NS(block->cb_state == IDX_CAC_BLOCK_CLEAN || block->cb_state == IDX_CAC_BLOCK_DIRTY);1314 ASSERT_NS(block->cb_state == IDX_CAC_BLOCK_CLEAN || block->cb_state == IDX_CAC_BLOCK_DIRTY);
1264 memcpy(block->cb_data, data, size);1315 memcpy(block->cb_data, data, size);
1265 xt_atomicrwlock_unlock(&block->cb_lock, TRUE);1316 XT_IPAGE_UNLOCK(&block->cb_lock, TRUE);
1266 IDX_CAC_UNLOCK(seg, ot->ot_thread);1317 IDX_CAC_UNLOCK(seg, ot->ot_thread);
1267 }1318 }
12681319
@@ -1277,7 +1328,7 @@
1277 if (!ind_cac_get(ot, address, &seg, &block))1328 if (!ind_cac_get(ot, address, &seg, &block))
1278 return FAILED;1329 return FAILED;
1279 if (block) {1330 if (block) {
1280 xt_atomicrwlock_xlock(&block->cb_lock, ot->ot_thread->t_id);1331 XT_IPAGE_WRITE_LOCK(&block->cb_lock, ot->ot_thread->t_id);
1281 ASSERT_NS(block->cb_state == IDX_CAC_BLOCK_CLEAN || block->cb_state == IDX_CAC_BLOCK_DIRTY);1332 ASSERT_NS(block->cb_state == IDX_CAC_BLOCK_CLEAN || block->cb_state == IDX_CAC_BLOCK_DIRTY);
12821333
1283 if (block->cb_state == IDX_CAC_BLOCK_DIRTY) {1334 if (block->cb_state == IDX_CAC_BLOCK_DIRTY) {
@@ -1293,7 +1344,7 @@
1293 xt_spinlock_unlock(&ind->mi_dirty_lock);1344 xt_spinlock_unlock(&ind->mi_dirty_lock);
1294 block->cb_state = IDX_CAC_BLOCK_CLEAN;1345 block->cb_state = IDX_CAC_BLOCK_CLEAN;
1295 }1346 }
1296 xt_atomicrwlock_unlock(&block->cb_lock, TRUE);1347 XT_IPAGE_UNLOCK(&block->cb_lock, TRUE);
12971348
1298 IDX_CAC_UNLOCK(seg, ot->ot_thread);1349 IDX_CAC_UNLOCK(seg, ot->ot_thread);
1299 }1350 }
@@ -1301,29 +1352,33 @@
1301 return OK;1352 return OK;
1302}1353}
13031354
1304xtPublic xtBool xt_ind_read_bytes(XTOpenTablePtr ot, xtIndexNodeID address, size_t size, xtWord1 *data)1355xtPublic xtBool xt_ind_read_bytes(XTOpenTablePtr ot, XTIndexPtr ind, xtIndexNodeID address, size_t size, xtWord1 *data)
1305{1356{
1306 XTIndBlockPtr block;1357 XTIndBlockPtr block;
1307 DcSegmentPtr seg;1358 DcSegmentPtr seg;
13081359
1309 if (!(block = ind_cac_fetch(ot, address, &seg, TRUE)))1360 if (!(block = ind_cac_fetch(ot, ind, address, &seg, TRUE)))
1310 return FAILED;1361 return FAILED;
13111362
1312 xt_atomicrwlock_slock(&block->cb_lock);1363 XT_IPAGE_READ_LOCK(&block->cb_lock);
1313 memcpy(data, block->cb_data, size);1364 memcpy(data, block->cb_data, size);
1314 xt_atomicrwlock_unlock(&block->cb_lock, FALSE);1365 XT_IPAGE_UNLOCK(&block->cb_lock, FALSE);
1315 IDX_CAC_UNLOCK(seg, ot->ot_thread);1366 IDX_CAC_UNLOCK(seg, ot->ot_thread);
1316 return OK;1367 return OK;
1317}1368}
13181369
1319xtPublic xtBool xt_ind_fetch(XTOpenTablePtr ot, xtIndexNodeID address, XTPageLockType ltype, XTIndReferencePtr iref)1370xtPublic xtBool xt_ind_fetch(XTOpenTablePtr ot, XTIndexPtr ind, xtIndexNodeID address, XTPageLockType ltype, XTIndReferencePtr iref)
1320{1371{
1321 register XTIndBlockPtr block;1372 register XTIndBlockPtr block;
1322 DcSegmentPtr seg;1373 DcSegmentPtr seg;
1323 xtWord2 branch_size;1374 xtWord2 branch_size;
1375 xtBool xlock = FALSE;
13241376
1325 ASSERT_NS(iref->ir_ulock == XT_UNLOCK_NONE);1377#ifdef DEBUG
1326 if (!(block = ind_cac_fetch(ot, address, &seg, TRUE)))1378 ASSERT_NS(iref->ir_xlock == 2);
1379 ASSERT_NS(iref->ir_xlock == 2);
1380#endif
1381 if (!(block = ind_cac_fetch(ot, ind, address, &seg, TRUE)))
1327 return NULL;1382 return NULL;
13281383
1329 branch_size = XT_GET_DISK_2(((XTIdxBranchDPtr) block->cb_data)->tb_size_2);1384 branch_size = XT_GET_DISK_2(((XTIdxBranchDPtr) block->cb_data)->tb_size_2);
@@ -1333,21 +1388,50 @@
1333 return FAILED;1388 return FAILED;
1334 }1389 }
13351390
1336 if (ltype == XT_XLOCK_LEAF) {1391 switch (ltype) {
1337 if (XT_IS_NODE(branch_size))1392 case XT_LOCK_READ:
1338 ltype = XT_LOCK_READ;1393 break;
1339 else1394 case XT_LOCK_WRITE:
1340 ltype = XT_LOCK_WRITE;1395 xlock = TRUE;
1396 break;
1397 case XT_XLOCK_LEAF:
1398 if (!XT_IS_NODE(branch_size))
1399 xlock = TRUE;
1400 break;
1401 case XT_XLOCK_DEL_LEAF:
1402 if (!XT_IS_NODE(branch_size)) {
1403 if (ot->ot_table->tab_dic.dic_no_lazy_delete)
1404 xlock = TRUE;
1405 else {
1406 /*
1407 * {LAZY-DEL-INDEX-ITEMS}
1408 *
1409 * We are fetch a page for delete purpose.
1410 * we decide here if we plan to do a lazy delete,
1411 * Or if we plan to compact the node.
1412 *
1413 * A lazy delete just requires a shared lock.
1414 *
1415 */
1416 if (ind->mi_lazy_delete) {
1417 /* If the number of deleted items is greater than
1418 * half of the number of times that can fit in the
1419 * page, then we will compact the node.
1420 */
1421 if (!xt_idx_lazy_delete_on_leaf(ind, block, XT_GET_INDEX_BLOCK_LEN(branch_size)))
1422 xlock = TRUE;
1423 }
1424 else
1425 xlock = TRUE;
1426 }
1427 }
1428 break;
1341 }1429 }
13421430
1343 if (ltype == XT_LOCK_WRITE) {1431 if ((iref->ir_xlock = xlock))
1344 xt_atomicrwlock_xlock(&block->cb_lock, ot->ot_thread->t_id);1432 XT_IPAGE_WRITE_LOCK(&block->cb_lock, ot->ot_thread->t_id);
1345 iref->ir_ulock = XT_UNLOCK_WRITE;1433 else
1346 }1434 XT_IPAGE_READ_LOCK(&block->cb_lock);
1347 else {
1348 xt_atomicrwlock_slock(&block->cb_lock);
1349 iref->ir_ulock = XT_UNLOCK_READ;
1350 }
13511435
1352 IDX_CAC_UNLOCK(seg, ot->ot_thread);1436 IDX_CAC_UNLOCK(seg, ot->ot_thread);
13531437
@@ -1358,18 +1442,31 @@
1358 * As a result, we need to pass a pointer to both the1442 * As a result, we need to pass a pointer to both the
1359 * cache block and the cache block data:1443 * cache block and the cache block data:
1360 */1444 */
1445 iref->ir_updated = FALSE;
1361 iref->ir_block = block;1446 iref->ir_block = block;
1362 iref->ir_branch = (XTIdxBranchDPtr) block->cb_data;1447 iref->ir_branch = (XTIdxBranchDPtr) block->cb_data;
1363 return OK;1448 return OK;
1364}1449}
13651450
1366xtPublic xtBool xt_ind_release(XTOpenTablePtr ot, XTIndexPtr ind, XTPageUnlockType XT_UNUSED(utype), XTIndReferencePtr iref)1451xtPublic xtBool xt_ind_release(XTOpenTablePtr ot, XTIndexPtr ind, XTPageUnlockType XT_NDEBUG_UNUSED(utype), XTIndReferencePtr iref)
1367{1452{
1368 register XTIndBlockPtr block;1453 register XTIndBlockPtr block;
13691454
1370 block = iref->ir_block;1455 block = iref->ir_block;
13711456
1372 if (utype == XT_UNLOCK_R_UPDATE || utype == XT_UNLOCK_W_UPDATE) {1457#ifdef DEBUG
1458 ASSERT_NS(iref->ir_xlock != 2);
1459 ASSERT_NS(iref->ir_updated != 2);
1460 if (iref->ir_updated)
1461 ASSERT_NS(utype == XT_UNLOCK_R_UPDATE || utype == XT_UNLOCK_W_UPDATE);
1462 else
1463 ASSERT_NS(utype == XT_UNLOCK_READ || utype == XT_UNLOCK_WRITE);
1464 if (iref->ir_xlock)
1465 ASSERT_NS(utype == XT_UNLOCK_WRITE || utype == XT_UNLOCK_W_UPDATE);
1466 else
1467 ASSERT_NS(utype == XT_UNLOCK_READ || utype == XT_UNLOCK_R_UPDATE);
1468#endif
1469 if (iref->ir_updated) {
1373 /* The page was update: */1470 /* The page was update: */
1374 ASSERT_NS(block->cb_state == IDX_CAC_BLOCK_CLEAN || block->cb_state == IDX_CAC_BLOCK_DIRTY);1471 ASSERT_NS(block->cb_state == IDX_CAC_BLOCK_CLEAN || block->cb_state == IDX_CAC_BLOCK_DIRTY);
1375 block->cp_flush_seq = ot->ot_table->tab_ind_flush_seq;1472 block->cp_flush_seq = ot->ot_table->tab_ind_flush_seq;
@@ -1386,16 +1483,10 @@
1386 }1483 }
1387 }1484 }
13881485
1389#ifdef DEBUG1486 XT_IPAGE_UNLOCK(&block->cb_lock, iref->ir_xlock);
1390 if (utype == XT_UNLOCK_W_UPDATE)1487#ifdef DEBUG
1391 utype = XT_UNLOCK_WRITE;1488 iref->ir_xlock = 2;
1392 else if (utype == XT_UNLOCK_R_UPDATE)1489 iref->ir_updated = 2;
1393 utype = XT_UNLOCK_READ;
1394 ASSERT_NS(iref->ir_ulock == utype);
1395#endif
1396 xt_atomicrwlock_unlock(&block->cb_lock, iref->ir_ulock == XT_UNLOCK_WRITE ? TRUE : FALSE);
1397#ifdef DEBUG
1398 iref->ir_ulock = XT_UNLOCK_NONE;
1399#endif1490#endif
1400 return OK;1491 return OK;
1401}1492}
@@ -1484,24 +1575,3 @@
1484 xt_ind_free_reserved(ot);1575 xt_ind_free_reserved(ot);
1485}1576}
14861577
1487xtPublic void xt_load_indices(XTThreadPtr self, XTOpenTablePtr ot)
1488{
1489 register XTTableHPtr tab = ot->ot_table;
1490 register XTIndBlockPtr block;
1491 DcSegmentPtr seg;
1492 xtIndexNodeID id;
1493
1494 xt_lock_mutex_ns(&tab->tab_ind_flush_lock);
1495
1496 for (id=1; id < XT_NODE_ID(tab->tab_ind_eof); id++) {
1497 if (!(block = ind_cac_fetch(ot, id, &seg, TRUE))) {
1498 xt_unlock_mutex_ns(&tab->tab_ind_flush_lock);
1499 xt_throw(self);
1500 }
1501 IDX_CAC_UNLOCK(seg, ot->ot_thread);
1502 }
1503
1504 xt_unlock_mutex_ns(&tab->tab_ind_flush_lock);
1505}
1506
1507
15081578
=== modified file 'storage/pbxt/src/cache_xt.h'
--- storage/pbxt/src/cache_xt.h 2009-03-26 12:18:01 +0000
+++ storage/pbxt/src/cache_xt.h 2009-08-17 11:12:36 +0000
@@ -45,8 +45,46 @@
45#define IDX_CAC_BLOCK_CLEAN 145#define IDX_CAC_BLOCK_CLEAN 1
46#define IDX_CAC_BLOCK_DIRTY 246#define IDX_CAC_BLOCK_DIRTY 2
4747
48typedef enum XTPageLockType { XT_LOCK_READ, XT_LOCK_WRITE, XT_XLOCK_LEAF };48#ifdef XT_NO_ATOMICS
49typedef enum XTPageUnlockType { XT_UNLOCK_NONE, XT_UNLOCK_READ, XT_UNLOCK_WRITE, XT_UNLOCK_R_UPDATE, XT_UNLOCK_W_UPDATE };49#define XT_IPAGE_USE_PTHREAD_RW
50#else
51//#define XT_IPAGE_USE_ATOMIC_RW
52#define XT_IPAGE_USE_SPINXSLOCK
53//#define XT_IPAGE_USE_SKEW_RW
54#endif
55
56#ifdef XT_IPAGE_USE_ATOMIC_RW
57#define XT_IPAGE_LOCK_TYPE XTAtomicRWLockRec
58#define XT_IPAGE_INIT_LOCK(s, i) xt_atomicrwlock_init_with_autoname(s, i)
59#define XT_IPAGE_FREE_LOCK(s, i) xt_atomicrwlock_free(s, i)
60#define XT_IPAGE_READ_LOCK(i) xt_atomicrwlock_slock(i)
61#define XT_IPAGE_WRITE_LOCK(i, o) xt_atomicrwlock_xlock(i, o)
62#define XT_IPAGE_UNLOCK(i, x) xt_atomicrwlock_unlock(i, x)
63#elif defined(XT_IPAGE_USE_PTHREAD_RW)
64#define XT_IPAGE_LOCK_TYPE xt_rwlock_type
65#define XT_IPAGE_INIT_LOCK(s, i) xt_init_rwlock(s, i)
66#define XT_IPAGE_FREE_LOCK(s, i) xt_free_rwlock(i)
67#define XT_IPAGE_READ_LOCK(i) xt_slock_rwlock_ns(i)
68#define XT_IPAGE_WRITE_LOCK(i, s) xt_xlock_rwlock_ns(i)
69#define XT_IPAGE_UNLOCK(i, x) xt_unlock_rwlock_ns(i)
70#elif defined(XT_IPAGE_USE_SPINXSLOCK)
71#define XT_IPAGE_LOCK_TYPE XTSpinXSLockRec
72#define XT_IPAGE_INIT_LOCK(s, i) xt_spinxslock_init_with_autoname(s, i)
73#define XT_IPAGE_FREE_LOCK(s, i) xt_spinxslock_free(s, i)
74#define XT_IPAGE_READ_LOCK(i) xt_spinxslock_slock(i)
75#define XT_IPAGE_WRITE_LOCK(i, o) xt_spinxslock_xlock(i, o)
76#define XT_IPAGE_UNLOCK(i, x) xt_spinxslock_unlock(i, x)
77#else // XT_IPAGE_USE_SKEW_RW
78#define XT_IPAGE_LOCK_TYPE XTSkewRWLockRec
79#define XT_IPAGE_INIT_LOCK(s, i) xt_skewrwlock_init_with_autoname(s, i)
80#define XT_IPAGE_FREE_LOCK(s, i) xt_skewrwlock_free(s, i)
81#define XT_IPAGE_READ_LOCK(i) xt_skewrwlock_slock(i)
82#define XT_IPAGE_WRITE_LOCK(i, o) xt_skewrwlock_xlock(i, o)
83#define XT_IPAGE_UNLOCK(i, x) xt_skewrwlock_unlock(i, x)
84#endif
85
86enum XTPageLockType { XT_LOCK_READ, XT_LOCK_WRITE, XT_XLOCK_LEAF, XT_XLOCK_DEL_LEAF };
87enum XTPageUnlockType { XT_UNLOCK_NONE, XT_UNLOCK_READ, XT_UNLOCK_WRITE, XT_UNLOCK_R_UPDATE, XT_UNLOCK_W_UPDATE };
5088
51/* A block is X locked if it is being changed or freed.89/* A block is X locked if it is being changed or freed.
52 * A block is S locked if it is being read.90 * A block is S locked if it is being read.
@@ -64,10 +102,11 @@
64 struct XTIndBlock *cb_mr_used; /* More recently used blocks. */102 struct XTIndBlock *cb_mr_used; /* More recently used blocks. */
65 struct XTIndBlock *cb_lr_used; /* Less recently used blocks. */103 struct XTIndBlock *cb_lr_used; /* Less recently used blocks. */
66 /* Protected by cb_lock: */104 /* Protected by cb_lock: */
67 XTAtomicRWLockRec cb_lock;105 XT_IPAGE_LOCK_TYPE cb_lock;
68 xtWord1 cb_state; /* Block status. */106 xtWord1 cb_state; /* Block status. */
69 xtWord2 cb_handle_count; /* TRUE if this page is referenced by a handle. */107 xtWord2 cb_handle_count; /* TRUE if this page is referenced by a handle. */
70 xtWord2 cp_flush_seq;108 xtWord2 cp_flush_seq;
109 xtWord2 cp_del_count; /* Number of deleted entries. */
71#ifdef XT_USE_DIRECT_IO_ON_INDEX110#ifdef XT_USE_DIRECT_IO_ON_INDEX
72 xtWord1 *cb_data;111 xtWord1 *cb_data;
73#else112#else
@@ -76,16 +115,18 @@
76} XTIndBlockRec, *XTIndBlockPtr;115} XTIndBlockRec, *XTIndBlockPtr;
77116
78typedef struct XTIndReference {117typedef struct XTIndReference {
79 XTPageUnlockType ir_ulock;118 xtBool ir_xlock; /* Set to TRUE if the cache block is X locked. */
119 xtBool ir_updated; /* Set to TRUE if the cache block is updated. */
80 XTIndBlockPtr ir_block;120 XTIndBlockPtr ir_block;
81 XTIdxBranchDPtr ir_branch;121 XTIdxBranchDPtr ir_branch;
82} XTIndReferenceRec, *XTIndReferencePtr;122} XTIndReferenceRec, *XTIndReferencePtr;
83123
84typedef struct XTIndFreeBlock {124typedef struct XTIndFreeBlock {
125 XTDiskValue1 if_zero1_1; /* Must be set to zero. */
126 XTDiskValue1 if_zero2_1; /* Must be set to zero. */
85 XTDiskValue1 if_status_1;127 XTDiskValue1 if_status_1;
86 XTDiskValue1 if_unused1_1;128 XTDiskValue1 if_unused1_1;
87 XTDiskValue2 if_unused2_2;129 XTDiskValue4 if_unused2_4;
88 XTDiskValue4 if_unused3_4;
89 XTDiskValue8 if_next_block_8;130 XTDiskValue8 if_next_block_8;
90} XTIndFreeBlockRec, *XTIndFreeBlockPtr;131} XTIndFreeBlockRec, *XTIndFreeBlockPtr;
91132
@@ -116,14 +157,13 @@
116xtBool xt_ind_write(struct XTOpenTable *ot, XTIndexPtr ind, xtIndexNodeID offset, size_t size, xtWord1 *data);157xtBool xt_ind_write(struct XTOpenTable *ot, XTIndexPtr ind, xtIndexNodeID offset, size_t size, xtWord1 *data);
117xtBool xt_ind_write_cache(struct XTOpenTable *ot, xtIndexNodeID offset, size_t size, xtWord1 *data);158xtBool xt_ind_write_cache(struct XTOpenTable *ot, xtIndexNodeID offset, size_t size, xtWord1 *data);
118xtBool xt_ind_clean(struct XTOpenTable *ot, XTIndexPtr ind, xtIndexNodeID offset);159xtBool xt_ind_clean(struct XTOpenTable *ot, XTIndexPtr ind, xtIndexNodeID offset);
119xtBool xt_ind_read_bytes(struct XTOpenTable *ot, xtIndexNodeID offset, size_t size, xtWord1 *data);160xtBool xt_ind_read_bytes(struct XTOpenTable *ot, XTIndexPtr ind, xtIndexNodeID offset, size_t size, xtWord1 *data);
120void xt_ind_check_cache(XTIndexPtr ind);161void xt_ind_check_cache(XTIndexPtr ind);
121xtBool xt_ind_reserve(struct XTOpenTable *ot, u_int count, XTIdxBranchDPtr not_this);162xtBool xt_ind_reserve(struct XTOpenTable *ot, u_int count, XTIdxBranchDPtr not_this);
122void xt_ind_free_reserved(struct XTOpenTable *ot);163void xt_ind_free_reserved(struct XTOpenTable *ot);
123void xt_ind_unreserve(struct XTOpenTable *ot);164void xt_ind_unreserve(struct XTOpenTable *ot);
124void xt_load_indices(XTThreadPtr self, struct XTOpenTable *ot);
125165
126xtBool xt_ind_fetch(struct XTOpenTable *ot, xtIndexNodeID node, XTPageLockType ltype, XTIndReferencePtr iref);166xtBool xt_ind_fetch(struct XTOpenTable *ot, XTIndexPtr ind, xtIndexNodeID node, XTPageLockType ltype, XTIndReferencePtr iref);
127xtBool xt_ind_release(struct XTOpenTable *ot, XTIndexPtr ind, XTPageUnlockType utype, XTIndReferencePtr iref);167xtBool xt_ind_release(struct XTOpenTable *ot, XTIndexPtr ind, XTPageUnlockType utype, XTIndReferencePtr iref);
128168
129void xt_ind_lock_handle(XTIndHandlePtr handle);169void xt_ind_lock_handle(XTIndHandlePtr handle);
130170
=== modified file 'storage/pbxt/src/ccutils_xt.cc'
--- storage/pbxt/src/ccutils_xt.cc 2009-03-26 12:18:01 +0000
+++ storage/pbxt/src/ccutils_xt.cc 2009-08-17 11:12:36 +0000
@@ -29,7 +29,7 @@
29#include "ccutils_xt.h"29#include "ccutils_xt.h"
30#include "bsearch_xt.h"30#include "bsearch_xt.h"
3131
32static int ccu_compare_object(XTThreadPtr XT_UNUSED(self), register const void XT_UNUSED(*thunk), register const void *a, register const void *b)32static int ccu_compare_object(XTThreadPtr XT_UNUSED(self), register const void *XT_UNUSED(thunk), register const void *a, register const void *b)
33{33{
34 XTObject *obj_ptr = (XTObject *) b;34 XTObject *obj_ptr = (XTObject *) b;
3535
3636
=== modified file 'storage/pbxt/src/database_xt.cc'
--- storage/pbxt/src/database_xt.cc 2009-04-02 10:03:14 +0000
+++ storage/pbxt/src/database_xt.cc 2009-08-17 11:12:36 +0000
@@ -23,6 +23,10 @@
2323
24#include "xt_config.h"24#include "xt_config.h"
2525
26#ifdef DRIZZLED
27#include <bitset>
28#endif
29
26#include <string.h>30#include <string.h>
27#include <stdio.h>31#include <stdio.h>
2832
@@ -240,7 +244,7 @@
240 xt_heap_release(self, (XTDatabaseHPtr) data);244 xt_heap_release(self, (XTDatabaseHPtr) data);
241}245}
242246
243static int db_cmp_db_id(struct XTThread XT_UNUSED(*self), register const void XT_UNUSED(*thunk), register const void *a, register const void *b)247static int db_cmp_db_id(struct XTThread *XT_UNUSED(self), register const void *XT_UNUSED(thunk), register const void *a, register const void *b)
244{248{
245 xtDatabaseID db_id = *((xtDatabaseID *) a);249 xtDatabaseID db_id = *((xtDatabaseID *) a);
246 XTDatabaseHPtr *db_ptr = (XTDatabaseHPtr *) b;250 XTDatabaseHPtr *db_ptr = (XTDatabaseHPtr *) b;
@@ -346,7 +350,7 @@
346 }350 }
347}351}
348352
349static void db_onrelease(XTThreadPtr self, void XT_UNUSED(*x))353static void db_onrelease(XTThreadPtr self, void *XT_UNUSED(x))
350{354{
351 /* Signal threads waiting for exclusive use of the database: */355 /* Signal threads waiting for exclusive use of the database: */
352 if (xt_db_open_databases) // The database may already be closed.356 if (xt_db_open_databases) // The database may already be closed.
@@ -612,7 +616,7 @@
612xtPublic void xt_open_database(XTThreadPtr self, char *path, xtBool multi_path)616xtPublic void xt_open_database(XTThreadPtr self, char *path, xtBool multi_path)
613{617{
614 XTDatabaseHPtr db;618 XTDatabaseHPtr db;
615 619
616 /* We cannot get a database, without unusing the current620 /* We cannot get a database, without unusing the current
617 * first. The reason is that the restart process will621 * first. The reason is that the restart process will
618 * partially set the current database!622 * partially set the current database!
@@ -621,7 +625,7 @@
621 db = xt_get_database(self, path, multi_path);625 db = xt_get_database(self, path, multi_path);
622 pushr_(xt_heap_release, db);626 pushr_(xt_heap_release, db);
623 xt_use_database(self, db, XT_FOR_USER);627 xt_use_database(self, db, XT_FOR_USER);
624 freer_(); // xt_heap_release(self, db); 628 freer_(); // xt_heap_release(self, db);
625}629}
626630
627/* This function can only be called if you do not already have a database in631/* This function can only be called if you do not already have a database in
@@ -638,6 +642,12 @@
638642
639 xt_heap_reference(self, db);643 xt_heap_reference(self, db);
640 self->st_database = db;644 self->st_database = db;
645#ifdef XT_WAIT_FOR_CLEANUP
646 self->st_last_xact = 0;
647 for (int i=0; i<XT_MAX_XACT_BEHIND; i++) {
648 self->st_prev_xact[i] = db->db_xn_curr_id;
649 }
650#endif
641 xt_xn_init_thread(self, what_for);651 xt_xn_init_thread(self, what_for);
642}652}
643653
@@ -1117,15 +1127,18 @@
1117 XTDatabaseHPtr db = ot->ot_table->tab_db;1127 XTDatabaseHPtr db = ot->ot_table->tab_db;
1118 xtBool flush_table = TRUE;1128 xtBool flush_table = TRUE;
11191129
1130 /* No open table returned to the pool should still
1131 * have a cache handle!
1132 */
1133 ASSERT_NS(!ot->ot_ind_rhandle);
1120 xt_lock_mutex_ns(&db->db_ot_pool.opt_lock);1134 xt_lock_mutex_ns(&db->db_ot_pool.opt_lock);
11211135
1122 if (!(table_pool = db_get_open_table_pool(db, ot->ot_table->tab_id)))1136 if (!(table_pool = db_get_open_table_pool(db, ot->ot_table->tab_id)))
1123 goto failed;1137 goto failed;
11241138
1125 if (table_pool->opt_locked && !table_pool->opt_flushing) {1139 if (table_pool->opt_locked && !table_pool->opt_flushing) {
1126 table_pool->opt_total_open--;
1127 /* Table will be closed below: */1140 /* Table will be closed below: */
1128 if (table_pool->opt_total_open > 0)1141 if (table_pool->opt_total_open > 1)
1129 flush_table = FALSE;1142 flush_table = FALSE;
1130 }1143 }
1131 else {1144 else {
@@ -1151,14 +1164,21 @@
1151 ot = NULL;1164 ot = NULL;
1152 }1165 }
11531166
1167 if (ot) {
1168 xt_unlock_mutex_ns(&db->db_ot_pool.opt_lock);
1169 xt_close_table(ot, flush_table, FALSE);
1170
1171 /* assume that table_pool cannot be invalidated in between as we have table_pool->opt_total_open > 0 */
1172 xt_lock_mutex_ns(&db->db_ot_pool.opt_lock);
1173 table_pool->opt_total_open--;
1174 }
1175
1154 db_free_open_table_pool(NULL, table_pool);1176 db_free_open_table_pool(NULL, table_pool);
11551177
1156 if (!xt_broadcast_cond_ns(&db->db_ot_pool.opt_cond))1178 if (!xt_broadcast_cond_ns(&db->db_ot_pool.opt_cond))
1157 goto failed;1179 goto failed;
1158 xt_unlock_mutex_ns(&db->db_ot_pool.opt_lock);1180 xt_unlock_mutex_ns(&db->db_ot_pool.opt_lock);
1159 if (ot)1181
1160 xt_close_table(ot, flush_table, FALSE);
1161
1162 return;1182 return;
11631183
1164 failed:1184 failed:
11651185
=== modified file 'storage/pbxt/src/datadic_xt.cc'
--- storage/pbxt/src/datadic_xt.cc 2009-03-26 12:18:01 +0000
+++ storage/pbxt/src/datadic_xt.cc 2009-08-18 07:46:53 +0000
@@ -26,6 +26,10 @@
2626
27#include "xt_config.h"27#include "xt_config.h"
2828
29#ifdef DRIZZLED
30#include <bitset>
31#endif
32
29#include <ctype.h>33#include <ctype.h>
30#include <errno.h>34#include <errno.h>
3135
@@ -433,7 +437,7 @@
433 XTToken *nextToken(XTThreadPtr self, c_char *keyword, XTToken *tk);437 XTToken *nextToken(XTThreadPtr self, c_char *keyword, XTToken *tk);
434};438};
435439
436void ri_free_token(XTThreadPtr self __attribute__((unused)), XTToken *tk)440void ri_free_token(XTThreadPtr XT_UNUSED(self), XTToken *tk)
437{441{
438 delete tk;442 delete tk;
439}443}
@@ -524,6 +528,13 @@
524 break;528 break;
525 tkn_curr_pos++;529 tkn_curr_pos++;
526 }530 }
531 /* TODO: Unless sql_mode == 'NO_BACKSLASH_ESCAPES'!!! */
532 if (*tkn_curr_pos == '\\') {
533 if (*(tkn_curr_pos+1) == quote) {
534 if (quote == '"' || quote == '\'')
535 tkn_curr_pos++;
536 }
537 }
527 tkn_curr_pos++;538 tkn_curr_pos++;
528 }539 }
529 540
@@ -639,7 +650,7 @@
639 int parseKeyAction(XTThreadPtr self); 650 int parseKeyAction(XTThreadPtr self);
640 void parseCreateTable(XTThreadPtr self);651 void parseCreateTable(XTThreadPtr self);
641 void parseAddTableItem(XTThreadPtr self);652 void parseAddTableItem(XTThreadPtr self);
642 void parseQualifiedName(XTThreadPtr self, char *name);653 void parseQualifiedName(XTThreadPtr self, char *parent_name, char *name);
643 void parseTableName(XTThreadPtr self, bool alterTable);654 void parseTableName(XTThreadPtr self, bool alterTable);
644 void parseExpression(XTThreadPtr self, bool allow_reserved);655 void parseExpression(XTThreadPtr self, bool allow_reserved);
645 void parseBrackets(XTThreadPtr self);656 void parseBrackets(XTThreadPtr self);
@@ -667,53 +678,53 @@
667 memset(&pt_sbuffer, 0, sizeof(XTStringBufferRec));678 memset(&pt_sbuffer, 0, sizeof(XTStringBufferRec));
668 }679 }
669680
670 virtual void finalize(XTThreadPtr self __attribute__((unused))) {681 virtual void finalize(XTThreadPtr XT_UNUSED(self)) {
671 if (pt_tokenizer)682 if (pt_tokenizer)
672 delete pt_tokenizer;683 delete pt_tokenizer;
673 xt_sb_set_size(NULL, &pt_sbuffer, 0);684 xt_sb_set_size(NULL, &pt_sbuffer, 0);
674 }685 }
675686
676 // Hooks to receive output from the parser:687 // Hooks to receive output from the parser:
677 virtual void setTableName(XTThreadPtr self __attribute__((unused)), char *name __attribute__((unused)), bool alterTable __attribute__((unused))) {688 virtual void setTableName(XTThreadPtr XT_UNUSED(self), char *XT_UNUSED(name), bool XT_UNUSED(alterTable)) {
678 }689 }
679 virtual void addColumn(XTThreadPtr self __attribute__((unused)), char *col_name __attribute__((unused)), char *old_col_name __attribute__((unused))) {690 virtual void addColumn(XTThreadPtr XT_UNUSED(self), char *XT_UNUSED(col_name), char *XT_UNUSED(old_col_name)) {
680 }691 }
681 virtual void setDataType(XTThreadPtr self, char *cstring) {692 virtual void setDataType(XTThreadPtr self, char *cstring) {
682 if (cstring) 693 if (cstring)
683 xt_free(self, cstring);694 xt_free(self, cstring);
684 }695 }
685 virtual void setNull(XTThreadPtr self __attribute__((unused)), bool nullOK __attribute__((unused))) {696 virtual void setNull(XTThreadPtr XT_UNUSED(self), bool XT_UNUSED(nullOK)) {
686 }697 }
687 virtual void setAutoInc(XTThreadPtr self __attribute__((unused)), bool autoInc __attribute__((unused))) {698 virtual void setAutoInc(XTThreadPtr XT_UNUSED(self), bool XT_UNUSED(autoInc)) {
688 }699 }
689 700
690 /* Add a contraint. If lastColumn is TRUE then add the contraint 701 /* Add a contraint. If lastColumn is TRUE then add the contraint
691 * to the last column. If not, expect addListedColumn() to be called.702 * to the last column. If not, expect addListedColumn() to be called.
692 */703 */
693 virtual void addConstraint(XTThreadPtr self __attribute__((unused)), char *name __attribute__((unused)), u_int type __attribute__((unused)), bool lastColumn __attribute__((unused))) {704 virtual void addConstraint(XTThreadPtr XT_UNUSED(self), char *XT_UNUSED(name), u_int XT_UNUSED(type), bool XT_UNUSED(lastColumn)) {
694 }705 }
695 706
696 /* Move the last column created. If symbol is NULL then move the column to the707 /* Move the last column created. If symbol is NULL then move the column to the
697 * first position, else move it to the position just after the given column.708 * first position, else move it to the position just after the given column.
698 */709 */
699 virtual void moveColumn(XTThreadPtr self __attribute__((unused)), char *col_name __attribute__((unused))) {710 virtual void moveColumn(XTThreadPtr XT_UNUSED(self), char *XT_UNUSED(col_name)) {
700 }711 }
701712
702 virtual void dropColumn(XTThreadPtr self __attribute__((unused)), char *col_name __attribute__((unused))) {713 virtual void dropColumn(XTThreadPtr XT_UNUSED(self), char *XT_UNUSED(col_name)) {
703 }714 }
704715
705 virtual void dropConstraint(XTThreadPtr self __attribute__((unused)), char *name __attribute__((unused)), u_int type __attribute__((unused))) {716 virtual void dropConstraint(XTThreadPtr XT_UNUSED(self), char *XT_UNUSED(name), u_int XT_UNUSED(type)) {
706 }717 }
707718
708 virtual void setIndexName(XTThreadPtr self __attribute__((unused)), char *name __attribute__((unused))) {719 virtual void setIndexName(XTThreadPtr XT_UNUSED(self), char *XT_UNUSED(name)) {
709 }720 }
710 virtual void addListedColumn(XTThreadPtr self __attribute__((unused)), char *index_col_name __attribute__((unused))) {721 virtual void addListedColumn(XTThreadPtr XT_UNUSED(self), char *XT_UNUSED(index_col_name)) {
711 }722 }
712 virtual void setReferencedTable(XTThreadPtr self __attribute__((unused)), char *ref_table __attribute__((unused))) {723 virtual void setReferencedTable(XTThreadPtr XT_UNUSED(self), char *XT_UNUSED(ref_schema), char *XT_UNUSED(ref_table)) {
713 }724 }
714 virtual void addReferencedColumn(XTThreadPtr self __attribute__((unused)), char *index_col_name __attribute__((unused))) {725 virtual void addReferencedColumn(XTThreadPtr XT_UNUSED(self), char *XT_UNUSED(index_col_name)) {
715 }726 }
716 virtual void setActions(XTThreadPtr self __attribute__((unused)), int on_delete __attribute__((unused)), int on_update __attribute__((unused))) {727 virtual void setActions(XTThreadPtr XT_UNUSED(self), int XT_UNUSED(on_delete), int XT_UNUSED(on_update)) {
717 }728 }
718729
719 virtual void parseTable(XTThreadPtr self, bool convert, char *sql); 730 virtual void parseTable(XTThreadPtr self, bool convert, char *sql);
@@ -859,7 +870,7 @@
859 if (pt_current->isKeyWord("CONSTRAINT")) {870 if (pt_current->isKeyWord("CONSTRAINT")) {
860 pt_current = pt_tokenizer->nextToken(self);871 pt_current = pt_tokenizer->nextToken(self);
861 if (pt_current->isIdentifier())872 if (pt_current->isIdentifier())
862 parseQualifiedName(self, name);873 parseQualifiedName(self, NULL, name);
863 }874 }
864875
865 if (pt_current->isReservedWord(XT_TK_PRIMARY)) {876 if (pt_current->isReservedWord(XT_TK_PRIMARY)) {
@@ -974,13 +985,15 @@
974 char name[XT_IDENTIFIER_NAME_SIZE];985 char name[XT_IDENTIFIER_NAME_SIZE];
975986
976 pt_current = pt_tokenizer->nextToken(self);987 pt_current = pt_tokenizer->nextToken(self);
977 parseQualifiedName(self, name);988 parseQualifiedName(self, NULL, name);
978 moveColumn(self, name);989 moveColumn(self, name);
979 }990 }
980}991}
981992
982void XTParseTable::parseQualifiedName(XTThreadPtr self, char *name)993void XTParseTable::parseQualifiedName(XTThreadPtr self, char *parent_name, char *name)
983{994{
995 if (parent_name)
996 parent_name[0] = '\0';
984 /* Should be an identifier by I have this example:997 /* Should be an identifier by I have this example:
985 * CREATE TABLE t1 ( comment CHAR(32) ASCII NOT NULL, koi8_ru_f CHAR(32) CHARACTER SET koi8r NOT NULL default '' ) CHARSET=latin5;998 * CREATE TABLE t1 ( comment CHAR(32) ASCII NOT NULL, koi8_ru_f CHAR(32) CHARACTER SET koi8r NOT NULL default '' ) CHARSET=latin5;
986 *999 *
@@ -990,6 +1003,8 @@
990 raiseError(self, pt_current, XT_ERR_ID_TOO_LONG);1003 raiseError(self, pt_current, XT_ERR_ID_TOO_LONG);
991 pt_current = pt_tokenizer->nextToken(self);1004 pt_current = pt_tokenizer->nextToken(self);
992 while (pt_current->isKeyWord(".")) {1005 while (pt_current->isKeyWord(".")) {
1006 if (parent_name)
1007 xt_strcpy(XT_IDENTIFIER_NAME_SIZE,parent_name, name);
993 pt_current = pt_tokenizer->nextToken(self);1008 pt_current = pt_tokenizer->nextToken(self);
994 /* Accept anything after the DOT! */1009 /* Accept anything after the DOT! */
995 if (pt_current->getString(name, XT_IDENTIFIER_NAME_SIZE) >= XT_IDENTIFIER_NAME_SIZE)1010 if (pt_current->getString(name, XT_IDENTIFIER_NAME_SIZE) >= XT_IDENTIFIER_NAME_SIZE)
@@ -1002,7 +1017,7 @@
1002{1017{
1003 char name[XT_IDENTIFIER_NAME_SIZE];1018 char name[XT_IDENTIFIER_NAME_SIZE];
10041019
1005 parseQualifiedName(self, name);1020 parseQualifiedName(self, NULL, name);
1006 setTableName(self, name, alterTable);1021 setTableName(self, name, alterTable);
1007}1022}
10081023
@@ -1011,7 +1026,7 @@
1011 char col_name[XT_IDENTIFIER_NAME_SIZE];1026 char col_name[XT_IDENTIFIER_NAME_SIZE];
10121027
1013 // column_definition1028 // column_definition
1014 parseQualifiedName(self, col_name);1029 parseQualifiedName(self, NULL, col_name);
1015 addColumn(self, col_name, old_col_name);1030 addColumn(self, col_name, old_col_name);
1016 parseDataType(self);1031 parseDataType(self);
10171032
@@ -1111,7 +1126,7 @@
1111 pt_current->expectKeyWord(self, "(");1126 pt_current->expectKeyWord(self, "(");
1112 do {1127 do {
1113 pt_current = pt_tokenizer->nextToken(self);1128 pt_current = pt_tokenizer->nextToken(self);
1114 parseQualifiedName(self, name);1129 parseQualifiedName(self, NULL, name);
1115 addListedColumn(self, name);1130 addListedColumn(self, name);
1116 cols++;1131 cols++;
1117 if (index_cols) {1132 if (index_cols) {
@@ -1135,19 +1150,20 @@
1135 int on_delete = XT_KEY_ACTION_DEFAULT;1150 int on_delete = XT_KEY_ACTION_DEFAULT;
1136 int on_update = XT_KEY_ACTION_DEFAULT;1151 int on_update = XT_KEY_ACTION_DEFAULT;
1137 char name[XT_IDENTIFIER_NAME_SIZE];1152 char name[XT_IDENTIFIER_NAME_SIZE];
1153 char parent_name[XT_IDENTIFIER_NAME_SIZE];
1138 u_int cols = 0;1154 u_int cols = 0;
11391155
1140 // REFERENCES tbl_name1156 // REFERENCES tbl_name
1141 pt_current = pt_tokenizer->nextToken(self, "REFERENCES", pt_current);1157 pt_current = pt_tokenizer->nextToken(self, "REFERENCES", pt_current);
1142 parseQualifiedName(self, name);1158 parseQualifiedName(self, parent_name, name);
1143 setReferencedTable(self, name);1159 setReferencedTable(self, parent_name[0] ? parent_name : NULL, name);
11441160
1145 // [ (index_col_name,...) ]1161 // [ (index_col_name,...) ]
1146 if (pt_current->isKeyWord("(")) {1162 if (pt_current->isKeyWord("(")) {
1147 pt_current->expectKeyWord(self, "(");1163 pt_current->expectKeyWord(self, "(");
1148 do {1164 do {
1149 pt_current = pt_tokenizer->nextToken(self);1165 pt_current = pt_tokenizer->nextToken(self);
1150 parseQualifiedName(self, name);1166 parseQualifiedName(self, NULL, name);
1151 addReferencedColumn(self, name);1167 addReferencedColumn(self, name);
1152 cols++;1168 cols++;
1153 if (cols > req_cols)1169 if (cols > req_cols)
@@ -1219,7 +1235,7 @@
1219 if (pt_current->isReservedWord(XT_TK_COLUMN))1235 if (pt_current->isReservedWord(XT_TK_COLUMN))
1220 pt_current = pt_tokenizer->nextToken(self);1236 pt_current = pt_tokenizer->nextToken(self);
12211237
1222 parseQualifiedName(self, old_col_name);1238 parseQualifiedName(self, NULL, old_col_name);
1223 parseColumnDefinition(self, old_col_name);1239 parseColumnDefinition(self, old_col_name);
1224 parseMoveColumn(self);1240 parseMoveColumn(self);
1225 }1241 }
@@ -1251,7 +1267,7 @@
1251 else {1267 else {
1252 if (pt_current->isReservedWord(XT_TK_COLUMN))1268 if (pt_current->isReservedWord(XT_TK_COLUMN))
1253 pt_current = pt_tokenizer->nextToken(self);1269 pt_current = pt_tokenizer->nextToken(self);
1254 parseQualifiedName(self, name);1270 parseQualifiedName(self, NULL, name);
1255 dropColumn(self, name);1271 dropColumn(self, name);
1256 }1272 }
1257 }1273 }
@@ -1259,7 +1275,7 @@
1259 pt_current = pt_tokenizer->nextToken(self);1275 pt_current = pt_tokenizer->nextToken(self);
1260 if (pt_current->isKeyWord("TO"))1276 if (pt_current->isKeyWord("TO"))
1261 pt_current = pt_tokenizer->nextToken(self);1277 pt_current = pt_tokenizer->nextToken(self);
1262 parseQualifiedName(self, name);1278 parseQualifiedName(self, NULL, name);
1263 }1279 }
1264 else1280 else
1265 /* Just ignore the syntax until the next , */1281 /* Just ignore the syntax until the next , */
@@ -1284,7 +1300,7 @@
1284 else if (pt_current->isKeyWord("SPACIAL"))1300 else if (pt_current->isKeyWord("SPACIAL"))
1285 pt_current = pt_tokenizer->nextToken(self);1301 pt_current = pt_tokenizer->nextToken(self);
1286 pt_current = pt_tokenizer->nextToken(self, "INDEX", pt_current);1302 pt_current = pt_tokenizer->nextToken(self, "INDEX", pt_current);
1287 parseQualifiedName(self, name);1303 parseQualifiedName(self, NULL, name);
1288 optionalIndexType(self);1304 optionalIndexType(self);
1289 pt_current = pt_tokenizer->nextToken(self, "ON", pt_current);1305 pt_current = pt_tokenizer->nextToken(self, "ON", pt_current);
1290 parseTableName(self, true);1306 parseTableName(self, true);
@@ -1299,7 +1315,7 @@
12991315
1300 pt_current = pt_tokenizer->nextToken(self, "DROP", pt_current);1316 pt_current = pt_tokenizer->nextToken(self, "DROP", pt_current);
1301 pt_current = pt_tokenizer->nextToken(self, "INDEX", pt_current);1317 pt_current = pt_tokenizer->nextToken(self, "INDEX", pt_current);
1302 parseQualifiedName(self, name);1318 parseQualifiedName(self, NULL, name);
1303 pt_current = pt_tokenizer->nextToken(self, "ON", pt_current);1319 pt_current = pt_tokenizer->nextToken(self, "ON", pt_current);
1304 parseTableName(self, true);1320 parseTableName(self, true);
1305 dropConstraint(self, name, XT_DD_INDEX);1321 dropConstraint(self, name, XT_DD_INDEX);
@@ -1340,7 +1356,7 @@
1340 virtual void addConstraint(XTThreadPtr self, char *name, u_int type, bool lastColumn);1356 virtual void addConstraint(XTThreadPtr self, char *name, u_int type, bool lastColumn);
1341 virtual void dropConstraint(XTThreadPtr self, char *name, u_int type);1357 virtual void dropConstraint(XTThreadPtr self, char *name, u_int type);
1342 virtual void addListedColumn(XTThreadPtr self, char *index_col_name);1358 virtual void addListedColumn(XTThreadPtr self, char *index_col_name);
1343 virtual void setReferencedTable(XTThreadPtr self, char *ref_table);1359 virtual void setReferencedTable(XTThreadPtr self, char *ref_schema, char *ref_table);
1344 virtual void addReferencedColumn(XTThreadPtr self, char *index_col_name);1360 virtual void addReferencedColumn(XTThreadPtr self, char *index_col_name);
1345 virtual void setActions(XTThreadPtr self, int on_delete, int on_update);1361 virtual void setActions(XTThreadPtr self, int on_delete, int on_update);
13461362
@@ -1535,23 +1551,31 @@
1535 }1551 }
1536}1552}
15371553
1538void XTCreateTable::setReferencedTable(XTThreadPtr self, char *ref_table)1554void XTCreateTable::setReferencedTable(XTThreadPtr self, char *ref_schema, char *ref_table)
1539{1555{
1540 XTDDForeignKey *fk = (XTDDForeignKey *) ct_curr_constraint;1556 XTDDForeignKey *fk = (XTDDForeignKey *) ct_curr_constraint;
1541 char path[PATH_MAX];1557 char path[PATH_MAX];
15421558
1543 xt_strcpy(PATH_MAX, path, ct_tab_path->ps_path);1559 if (ref_schema) {
1544 xt_remove_last_name_of_path(path);1560 xt_strcpy(PATH_MAX,path, ".");
1545 if (ct_convert) {1561 xt_add_dir_char(PATH_MAX, path);
1546 char buffer[XT_IDENTIFIER_NAME_SIZE];1562 xt_strcat(PATH_MAX, path, ref_schema);
1547 size_t len;1563 xt_add_dir_char(PATH_MAX, path);
1548
1549 myxt_static_convert_identifier(self, ct_charset, ref_table, buffer, XT_IDENTIFIER_NAME_SIZE);
1550 len = strlen(path);
1551 myxt_static_convert_table_name(self, buffer, &path[len], PATH_MAX - len);
1552 }
1553 else
1554 xt_strcat(PATH_MAX, path, ref_table);1564 xt_strcat(PATH_MAX, path, ref_table);
1565 } else {
1566 xt_strcpy(PATH_MAX, path, ct_tab_path->ps_path);
1567 xt_remove_last_name_of_path(path);
1568 if (ct_convert) {
1569 char buffer[XT_IDENTIFIER_NAME_SIZE];
1570 size_t len;
1571
1572 myxt_static_convert_identifier(self, ct_charset, ref_table, buffer, XT_IDENTIFIER_NAME_SIZE);
1573 len = strlen(path);
1574 myxt_static_convert_table_name(self, buffer, &path[len], PATH_MAX - len);
1575 }
1576 else
1577 xt_strcat(PATH_MAX, path, ref_table);
1578 }
15551579
1556 fk->fk_ref_tab_name = (XTPathStrPtr) xt_dup_string(self, path);1580 fk->fk_ref_tab_name = (XTPathStrPtr) xt_dup_string(self, path);
1557}1581}
@@ -1578,7 +1602,7 @@
1578 fk->fk_ref_cols.clone(self, &fk->co_cols);1602 fk->fk_ref_cols.clone(self, &fk->co_cols);
1579}1603}
15801604
1581void XTCreateTable::setActions(XTThreadPtr self __attribute__((unused)), int on_delete, int on_update)1605void XTCreateTable::setActions(XTThreadPtr XT_UNUSED(self), int on_delete, int on_update)
1582{1606{
1583 XTDDForeignKey *fk = (XTDDForeignKey *) ct_curr_constraint;1607 XTDDForeignKey *fk = (XTDDForeignKey *) ct_curr_constraint;
15841608
@@ -1711,8 +1735,8 @@
1711void XTDDConstraint::getColumnList(char *buffer, size_t size)1735void XTDDConstraint::getColumnList(char *buffer, size_t size)
1712{1736{
1713 if (co_table->dt_table) {1737 if (co_table->dt_table) {
1714 xt_strcat(size, buffer, "`");1738 xt_strcpy(size, buffer, "`");
1715 xt_strcpy(size, buffer, co_table->dt_table->tab_name->ps_path);1739 xt_strcat(size, buffer, co_table->dt_table->tab_name->ps_path);
1716 xt_strcat(size, buffer, "` (`");1740 xt_strcat(size, buffer, "` (`");
1717 }1741 }
1718 else1742 else
@@ -1739,6 +1763,20 @@
1739 return OK;1763 return OK;
1740}1764}
17411765
1766bool XTDDConstraint::samePrefixColumns(XTDDConstraint *co)
1767{
1768 u_int i = 0;
1769
1770 if (co_cols.size() > co->co_cols.size())
1771 return false;
1772 while (i<co_cols.size()) {
1773 if (myxt_strcasecmp(co_cols.itemAt(i)->cr_col_name, co->co_cols.itemAt(i)->cr_col_name) != 0)
1774 return false;
1775 i++;
1776 }
1777 return OK;
1778}
1779
1742bool XTDDConstraint::attachColumns()1780bool XTDDConstraint::attachColumns()
1743{1781{
1744 XTDDColumn *col;1782 XTDDColumn *col;
@@ -1773,6 +1811,7 @@
1773 XTIdxSearchKeyRec search_key;1811 XTIdxSearchKeyRec search_key;
1774 xtXactID xn_id;1812 xtXactID xn_id;
1775 XTXactWaitRec xw;1813 XTXactWaitRec xw;
1814 bool ok = false;
17761815
1777 if (!(loc_ind = tr_fkey->getReferenceIndexPtr()))1816 if (!(loc_ind = tr_fkey->getReferenceIndexPtr()))
1778 return false;1817 return false;
@@ -1792,40 +1831,42 @@
17921831
1793 /* Search for the key in the child (referencing) table: */1832 /* Search for the key in the child (referencing) table: */
1794 if (!(ot = xt_db_open_table_using_tab(tr_fkey->co_table->dt_table, thread)))1833 if (!(ot = xt_db_open_table_using_tab(tr_fkey->co_table->dt_table, thread)))
1795 goto failed;1834 return false;
17961835
1797 retry:1836 retry:
1798 if (!xt_idx_search(ot, ind, &search_key))1837 if (!xt_idx_search(ot, ind, &search_key))
1799 goto failed;1838 goto done;
1800 1839
1801 while (ot->ot_curr_rec_id && search_key.sk_on_key) {1840 while (ot->ot_curr_rec_id && search_key.sk_on_key) {
1802 switch (xt_tab_maybe_committed(ot, ot->ot_curr_rec_id, &xn_id, &ot->ot_curr_row_id, &ot->ot_curr_updated)) {1841 switch (xt_tab_maybe_committed(ot, ot->ot_curr_rec_id, &xn_id, &ot->ot_curr_row_id, &ot->ot_curr_updated)) {
1803 case XT_MAYBE: 1842 case XT_MAYBE:
1804 xw.xw_xn_id = xn_id;1843 xw.xw_xn_id = xn_id;
1805 if (!xt_xn_wait_for_xact(thread, &xw, NULL))1844 if (!xt_xn_wait_for_xact(thread, &xw, NULL))
1806 goto failed;1845 goto done;
1807 goto retry;1846 goto retry;
1808 case XT_ERR:1847 case XT_ERR:
1809 goto failed;1848 goto done;
1810 case TRUE:1849 case TRUE:
1811 /* We found a matching child: */1850 /* We found a matching child: */
1812 xt_register_ixterr(XT_REG_CONTEXT, XT_ERR_ROW_IS_REFERENCED, tr_fkey->co_name);1851 xt_register_ixterr(XT_REG_CONTEXT, XT_ERR_ROW_IS_REFERENCED, tr_fkey->co_name);
1813 goto failed;1852 goto done;
1814 break;
1815 case FALSE:1853 case FALSE:
1816 if (!xt_idx_next(ot, ind, &search_key))1854 if (!xt_idx_next(ot, ind, &search_key))
1817 goto failed;1855 goto done;
1818 break;1856 break;
1819 }1857 }
1820 }1858 }
18211859
1822 /* No matching children, all OK: */1860 /* No matching children, all OK: */
1823 xt_db_return_table_to_pool_ns(ot);1861 ok = true;
1824 return true;
18251862
1826 failed:1863 done:
1864 if (ot->ot_ind_rhandle) {
1865 xt_ind_release_handle(ot->ot_ind_rhandle, FALSE, thread);
1866 ot->ot_ind_rhandle = NULL;
1867 }
1827 xt_db_return_table_to_pool_ns(ot);1868 xt_db_return_table_to_pool_ns(ot);
1828 return false;1869 return ok;
1829}1870}
18301871
1831/*1872/*
@@ -1962,6 +2003,10 @@
1962 }2003 }
19632004
1964 /* No matching children, all OK: */2005 /* No matching children, all OK: */
2006 if (ot->ot_ind_rhandle) {
2007 xt_ind_release_handle(ot->ot_ind_rhandle, FALSE, thread);
2008 ot->ot_ind_rhandle = NULL;
2009 }
1965 xt_db_return_table_to_pool_ns(ot);2010 xt_db_return_table_to_pool_ns(ot);
19662011
1967 success:2012 success:
@@ -1971,6 +2016,10 @@
1971 return true;2016 return true;
19722017
1973 failed_2:2018 failed_2:
2019 if (ot->ot_ind_rhandle) {
2020 xt_ind_release_handle(ot->ot_ind_rhandle, FALSE, thread);
2021 ot->ot_ind_rhandle = NULL;
2022 }
1974 xt_db_return_table_to_pool_ns(ot);2023 xt_db_return_table_to_pool_ns(ot);
19752024
1976 failed:2025 failed:
@@ -2055,8 +2104,13 @@
20552104
2056void XTDDForeignKey::loadString(XTThreadPtr self, XTStringBufferPtr sb)2105void XTDDForeignKey::loadString(XTThreadPtr self, XTStringBufferPtr sb)
2057{2106{
2107 char schema_name[XT_IDENTIFIER_NAME_SIZE];
2108
2058 XTDDConstraint::loadString(self, sb);2109 XTDDConstraint::loadString(self, sb);
2059 xt_sb_concat(self, sb, " REFERENCES `");2110 xt_sb_concat(self, sb, " REFERENCES `");
2111 xt_2nd_last_name_of_path(XT_IDENTIFIER_NAME_SIZE, schema_name, fk_ref_tab_name->ps_path);
2112 xt_sb_concat(self, sb, schema_name);
2113 xt_sb_concat(self, sb, "`.`");
2060 xt_sb_concat(self, sb, xt_last_name_of_path(fk_ref_tab_name->ps_path));2114 xt_sb_concat(self, sb, xt_last_name_of_path(fk_ref_tab_name->ps_path));
2061 xt_sb_concat(self, sb, "` ");2115 xt_sb_concat(self, sb, "` ");
20622116
@@ -2136,6 +2190,20 @@
2136 return OK;2190 return OK;
2137}2191}
21382192
2193bool XTDDForeignKey::samePrefixReferenceColumns(XTDDConstraint *co)
2194{
2195 u_int i = 0;
2196
2197 if (fk_ref_cols.size() > co->co_cols.size())
2198 return false;
2199 while (i<fk_ref_cols.size()) {
2200 if (myxt_strcasecmp(fk_ref_cols.itemAt(i)->cr_col_name, co->co_cols.itemAt(i)->cr_col_name) != 0)
2201 return false;
2202 i++;
2203 }
2204 return OK;
2205}
2206
2139bool XTDDForeignKey::checkReferencedTypes(XTDDTable *dt)2207bool XTDDForeignKey::checkReferencedTypes(XTDDTable *dt)
2140{2208{
2141 XTDDColumn *col, *ref_col;2209 XTDDColumn *col, *ref_col;
@@ -2288,6 +2356,10 @@
2288 goto failed_2;2356 goto failed_2;
2289 case TRUE:2357 case TRUE:
2290 /* We found a matching parent: */2358 /* We found a matching parent: */
2359 if (ot->ot_ind_rhandle) {
2360 xt_ind_release_handle(ot->ot_ind_rhandle, FALSE, thread);
2361 ot->ot_ind_rhandle = NULL;
2362 }
2291 xt_db_return_table_to_pool_ns(ot);2363 xt_db_return_table_to_pool_ns(ot);
2292 goto success;2364 goto success;
2293 case FALSE:2365 case FALSE:
@@ -2300,6 +2372,10 @@
2300 xt_register_ixterr(XT_REG_CONTEXT, XT_ERR_NO_REFERENCED_ROW, co_name);2372 xt_register_ixterr(XT_REG_CONTEXT, XT_ERR_NO_REFERENCED_ROW, co_name);
23012373
2302 failed_2:2374 failed_2:
2375 if (ot->ot_ind_rhandle) {
2376 xt_ind_release_handle(ot->ot_ind_rhandle, FALSE, thread);
2377 ot->ot_ind_rhandle = NULL;
2378 }
2303 xt_db_return_table_to_pool_ns(ot);2379 xt_db_return_table_to_pool_ns(ot);
23042380
2305 failed:2381 failed:
@@ -2672,16 +2748,24 @@
26722748
2673XTDDIndex *XTDDTable::findIndex(XTDDConstraint *co)2749XTDDIndex *XTDDTable::findIndex(XTDDConstraint *co)
2674{2750{
2675 XTDDIndex *ind;2751 XTDDIndex *ind = NULL;
2752 XTDDIndex *cur_ind;
2753 u_int index_size = UINT_MAX;
26762754
2677 for (u_int i=0; i<dt_indexes.size(); i++) {2755 for (u_int i=0; i<dt_indexes.size(); i++) {
2678 ind = dt_indexes.itemAt(i);2756 cur_ind = dt_indexes.itemAt(i);
2679 if (co->sameColumns(ind))2757 u_int sz = cur_ind->getIndexPtr()->mi_key_size;
2680 return ind;2758 if (sz < index_size && co->samePrefixColumns(cur_ind)) {
2759 ind = cur_ind;
2760 index_size = sz;
2761 }
2681 }2762 }
2763
2764 if (ind)
2765 return ind;
2766
2682 {2767 {
2683 char buffer[XT_ERR_MSG_SIZE - 200];2768 char buffer[XT_ERR_MSG_SIZE - 200];
2684
2685 co->getColumnList(buffer, XT_ERR_MSG_SIZE - 200);2769 co->getColumnList(buffer, XT_ERR_MSG_SIZE - 200);
2686 xt_register_ixterr(XT_REG_CONTEXT, XT_ERR_NO_MATCHING_INDEX, buffer);2770 xt_register_ixterr(XT_REG_CONTEXT, XT_ERR_NO_MATCHING_INDEX, buffer);
2687 }2771 }
@@ -2690,16 +2774,24 @@
26902774
2691XTDDIndex *XTDDTable::findReferenceIndex(XTDDForeignKey *fk)2775XTDDIndex *XTDDTable::findReferenceIndex(XTDDForeignKey *fk)
2692{2776{
2693 XTDDIndex *ind;2777 XTDDIndex *ind = NULL;
2778 XTDDIndex *cur_ind;
2694 XTDDColumnRef *cr;2779 XTDDColumnRef *cr;
2695 u_int i;2780 u_int i;
2781 u_int index_size = UINT_MAX;
26962782
2697 for (i=0; i<dt_indexes.size(); i++) {2783 for (i=0; i<dt_indexes.size(); i++) {
2698 ind = dt_indexes.itemAt(i);2784 cur_ind = dt_indexes.itemAt(i);
2699 if (fk->sameReferenceColumns(ind))2785 u_int sz = cur_ind->getIndexPtr()->mi_key_size;
2700 return ind;2786 if (sz < index_size && fk->samePrefixReferenceColumns(cur_ind)) {
2787 ind = cur_ind;
2788 index_size = sz;
2789 }
2701 }2790 }
27022791
2792 if (ind)
2793 return ind;
2794
2703 /* If the index does not exist, maybe the columns do not exist?! */2795 /* If the index does not exist, maybe the columns do not exist?! */
2704 for (i=0; i<fk->fk_ref_cols.size(); i++) {2796 for (i=0; i<fk->fk_ref_cols.size(); i++) {
2705 cr = fk->fk_ref_cols.itemAt(i);2797 cr = fk->fk_ref_cols.itemAt(i);
@@ -2867,9 +2959,33 @@
2867 return ok;2959 return ok;
2868}2960}
28692961
2870xtBool XTDDTable::checkCanDrop()2962/*
2963 * drop_db parameter is TRUE if we are dropping the schema of this table. In this case
2964 * we return TRUE if the table has only refs to the tables from its own schema
2965 */
2966xtBool XTDDTable::checkCanDrop(xtBool drop_db)
2871{2967{
2872 /* no refs or references only itself */2968 /* no refs or references only itself */
2873 return (dt_trefs == NULL) || 2969 if ((dt_trefs == NULL) || ((dt_trefs->tr_next == NULL) && (dt_trefs->tr_fkey->co_table == this)))
2874 (dt_trefs->tr_next == NULL) && (dt_trefs->tr_fkey->co_table == this);2970 return TRUE;
2971
2972 if (!drop_db)
2973 return FALSE;
2974
2975 const char *this_schema = xt_last_2_names_of_path(dt_table->tab_name->ps_path);
2976 size_t this_schema_sz = xt_last_name_of_path(dt_table->tab_name->ps_path) - this_schema;
2977 XTDDTableRef *tr = dt_trefs;
2978
2979 while (tr) {
2980 const char *tab_path = tr->tr_fkey->co_table->dt_table->tab_name->ps_path;
2981 const char *tab_schema = xt_last_2_names_of_path(tab_path);
2982 size_t tab_schema_sz = xt_last_name_of_path(tab_path) - tab_schema;
2983
2984 if (this_schema_sz != tab_schema_sz || strncmp(this_schema, tab_schema, tab_schema_sz))
2985 return FALSE;
2986
2987 tr = tr->tr_next;
2988 }
2989
2990 return TRUE;
2875}2991}
28762992
=== modified file 'storage/pbxt/src/datadic_xt.h'
--- storage/pbxt/src/datadic_xt.h 2009-03-26 12:18:01 +0000
+++ storage/pbxt/src/datadic_xt.h 2009-08-18 07:46:53 +0000
@@ -137,6 +137,7 @@
137 return new_obj;137 return new_obj;
138 }138 }
139139
140 virtual void init(XTThreadPtr self) { XTObject::init(self); }
140 virtual void init(XTThreadPtr self, XTObject *obj);141 virtual void init(XTThreadPtr self, XTObject *obj);
141 virtual void finalize(XTThreadPtr self);142 virtual void finalize(XTThreadPtr self);
142};143};
@@ -156,6 +157,7 @@
156 co_ind_name(NULL) {157 co_ind_name(NULL) {
157 }158 }
158159
160 virtual void init(XTThreadPtr self) { XTObject::init(self); }
159 virtual void init(XTThreadPtr self, XTObject *obj);161 virtual void init(XTThreadPtr self, XTObject *obj);
160 virtual void finalize(XTThreadPtr self) {162 virtual void finalize(XTThreadPtr self) {
161 if (co_name)163 if (co_name)
@@ -169,6 +171,7 @@
169 virtual void alterColumnName(XTThreadPtr self, char *from_name, char *to_name);171 virtual void alterColumnName(XTThreadPtr self, char *from_name, char *to_name);
170 void getColumnList(char *buffer, size_t size);172 void getColumnList(char *buffer, size_t size);
171 bool sameColumns(XTDDConstraint *co);173 bool sameColumns(XTDDConstraint *co);
174 bool samePrefixColumns(XTDDConstraint *co);
172 bool attachColumns();175 bool attachColumns();
173};176};
174177
@@ -198,6 +201,7 @@
198 return new_obj;201 return new_obj;
199 }202 }
200203
204 virtual void init(XTThreadPtr self) { XTDDConstraint::init(self); };
201 virtual void init(XTThreadPtr self, XTObject *obj);205 virtual void init(XTThreadPtr self, XTObject *obj);
202 struct XTIndex *getIndexPtr();206 struct XTIndex *getIndexPtr();
203};207};
@@ -230,12 +234,14 @@
230 return new_obj;234 return new_obj;
231 }235 }
232236
237 virtual void init(XTThreadPtr self) { XTDDIndex::init(self); }
233 virtual void init(XTThreadPtr self, XTObject *obj);238 virtual void init(XTThreadPtr self, XTObject *obj);
234 virtual void finalize(XTThreadPtr self);239 virtual void finalize(XTThreadPtr self);
235 virtual void loadString(XTThreadPtr self, XTStringBufferPtr sb);240 virtual void loadString(XTThreadPtr self, XTStringBufferPtr sb);
236 void getReferenceList(char *buffer, size_t size);241 void getReferenceList(char *buffer, size_t size);
237 struct XTIndex *getReferenceIndexPtr();242 struct XTIndex *getReferenceIndexPtr();
238 bool sameReferenceColumns(XTDDConstraint *co);243 bool sameReferenceColumns(XTDDConstraint *co);
244 bool samePrefixReferenceColumns(XTDDConstraint *co);
239 bool checkReferencedTypes(XTDDTable *dt);245 bool checkReferencedTypes(XTDDTable *dt);
240 void removeReference(XTThreadPtr self);246 void removeReference(XTThreadPtr self);
241 bool insertRow(xtWord1 *before, xtWord1 *after, XTThreadPtr thread);247 bool insertRow(xtWord1 *before, xtWord1 *after, XTThreadPtr thread);
@@ -284,7 +290,7 @@
284 XTDDIndex *findReferenceIndex(XTDDForeignKey *fk);290 XTDDIndex *findReferenceIndex(XTDDForeignKey *fk);
285 bool insertRow(struct XTOpenTable *rec_ot, xtWord1 *buffer);291 bool insertRow(struct XTOpenTable *rec_ot, xtWord1 *buffer);
286 bool checkNoAction(struct XTOpenTable *ot, xtRecordID rec_id);292 bool checkNoAction(struct XTOpenTable *ot, xtRecordID rec_id);
287 xtBool checkCanDrop();293 xtBool checkCanDrop(xtBool drop_db);
288 bool deleteRow(struct XTOpenTable *rec_ot, xtWord1 *buffer);294 bool deleteRow(struct XTOpenTable *rec_ot, xtWord1 *buffer);
289 void deleteAllRows(XTThreadPtr self);295 void deleteAllRows(XTThreadPtr self);
290 bool updateRow(struct XTOpenTable *rec_ot, xtWord1 *before, xtWord1 *after);296 bool updateRow(struct XTOpenTable *rec_ot, xtWord1 *before, xtWord1 *after);
291297
=== modified file 'storage/pbxt/src/datalog_xt.cc'
--- storage/pbxt/src/datalog_xt.cc 2009-03-26 12:18:01 +0000
+++ storage/pbxt/src/datalog_xt.cc 2009-08-18 07:46:53 +0000
@@ -69,6 +69,7 @@
69 sl_rec_log_id = 0;69 sl_rec_log_id = 0;
70 sl_rec_log_offset = 0;70 sl_rec_log_offset = 0;
71 sl_record_len = 0;71 sl_record_len = 0;
72 sl_extra_garbage = 0;
7273
73 return sl_buffer != NULL;74 return sl_buffer != NULL;
74}75}
@@ -130,8 +131,25 @@
130/*131/*
131 * Unlike the transaction log sequential reader, this function only returns132 * Unlike the transaction log sequential reader, this function only returns
132 * the header of a record.133 * the header of a record.
134 *
135 * {SKIP-GAPS}
136 * This function now skips gaps. This should not be required, because in normal
137 * operation, no gaps should be created.
138 *
139 * However, if his happens there is a danger that a valid record after the
140 * gap will be lost.
141 *
142 * So, if we find an invalid record, we scan through the log to find the next
143 * valid record. Note, that there is still a danger that will will find
144 * data that looks like a valid record, but is not.
145 *
146 * In this case, this "pseudo record" may cause the function to actually skip
147 * valid records.
148 *
149 * Note, any such malfunction will eventually cause the record to be lost forever
150 * after the garbage collector has run.
133 */151 */
134xtBool XTDataSeqRead::sl_seq_next(XTXactLogBufferDPtr *ret_entry, xtBool verify, struct XTThread *thread)152xtBool XTDataSeqRead::sl_seq_next(XTXactLogBufferDPtr *ret_entry, struct XTThread *thread)
135{153{
136 XTXactLogBufferDPtr record;154 XTXactLogBufferDPtr record;
137 size_t tfer;155 size_t tfer;
@@ -140,10 +158,12 @@
140 size_t max_rec_len;158 size_t max_rec_len;
141 xtBool reread_from_buffer;159 xtBool reread_from_buffer;
142 xtWord4 size;160 xtWord4 size;
161 xtLogOffset gap_start = 0;
143162
144 /* Go to the next record (xseq_record_len must be initialized163 /* Go to the next record (xseq_record_len must be initialized
145 * to 0 for this to work.164 * to 0 for this to work.
146 */165 */
166 retry:
147 sl_rec_log_offset += sl_record_len;167 sl_rec_log_offset += sl_record_len;
148 sl_record_len = 0;168 sl_record_len = 0;
149169
@@ -174,6 +194,8 @@
174 record = (XTXactLogBufferDPtr) (sl_buffer + rec_offset);194 record = (XTXactLogBufferDPtr) (sl_buffer + rec_offset);
175 switch (record->xl.xl_status_1) {195 switch (record->xl.xl_status_1) {
176 case XT_LOG_ENT_HEADER:196 case XT_LOG_ENT_HEADER:
197 if (sl_rec_log_offset != 0)
198 goto scan_to_next_record;
177 if (offsetof(XTXactLogHeaderDRec, xh_size_4) + 4 > max_rec_len) {199 if (offsetof(XTXactLogHeaderDRec, xh_size_4) + 4 > max_rec_len) {
178 reread_from_buffer = TRUE;200 reread_from_buffer = TRUE;
179 goto read_more;201 goto read_more;
@@ -183,33 +205,42 @@
183 reread_from_buffer = TRUE;205 reread_from_buffer = TRUE;
184 goto read_more;206 goto read_more;
185 }207 }
186 if (verify) {208
187 if (record->xh.xh_checksum_1 != XT_CHECKSUM_1(sl_rec_log_id))209 if (record->xh.xh_checksum_1 != XT_CHECKSUM_1(sl_rec_log_id))
188 goto return_empty;210 goto return_empty;
189 if (XT_LOG_HEAD_MAGIC(record, len) != XT_LOG_FILE_MAGIC)211 if (XT_LOG_HEAD_MAGIC(record, len) != X