From: Tor Didriksen Date: December 20 2011 9:51am Subject: bzr push into mysql-trunk branch (tor.didriksen:3502 to 3503) WL#5825 List-Archive: http://lists.mysql.com/commits/142187 Message-Id: <201112200951.pBK9papZ007389@acsmt356.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3503 Tor Didriksen 2011-12-20 WL#5825 Using C++ Standard Library with MySQL code Post-push cleanup: the min/max macros are gone, so don't comment about them. It is still a good idea to include "my_config.h" before anything else. @ unittest/gunit/opt_trace-t.cc my_error_handler() should have C linkage. modified: unittest/gunit/bounded_queue-t.cc unittest/gunit/bounds_checked_array-t.cc unittest/gunit/cost_estimate-t.cc unittest/gunit/dbug-t.cc unittest/gunit/dynarray-t.cc unittest/gunit/field-t.cc unittest/gunit/filesort_buffer-t.cc unittest/gunit/get_diagnostics-t.cc unittest/gunit/gunit_test_main.cc unittest/gunit/item-t.cc unittest/gunit/mdl-t.cc unittest/gunit/mdl_mytap-t.cc unittest/gunit/my_regex-t.cc unittest/gunit/opt_range-t.cc unittest/gunit/opt_trace-t.cc unittest/gunit/sql_list-t.cc unittest/gunit/sql_plist-t.cc unittest/gunit/stdcxx-t.cc unittest/gunit/tap_event_listener.cc unittest/gunit/test_utils.cc unittest/gunit/thread_utils-t.cc unittest/gunit/thread_utils.cc 3502 Tor Didriksen 2011-12-16 Bug#12577230 RERUN OF STORED FUNCTION CAUSES SEGFAULT IN MAKE_JOIN_SELECT Post-push cleanup: add accessors, and rename on_expr to join_cond() modified: sql/opt_sum.cc sql/sql_base.cc sql/sql_executor.cc sql/sql_lex.cc sql/sql_optimizer.cc sql/sql_parse.cc sql/sql_planner.cc sql/table.cc sql/table.h === modified file 'unittest/gunit/bounded_queue-t.cc' --- a/unittest/gunit/bounded_queue-t.cc 2010-12-23 11:03:09 +0000 +++ b/unittest/gunit/bounded_queue-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include #include === modified file 'unittest/gunit/bounds_checked_array-t.cc' --- a/unittest/gunit/bounds_checked_array-t.cc 2011-08-26 08:16:16 +0000 +++ b/unittest/gunit/bounds_checked_array-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/cost_estimate-t.cc' --- a/unittest/gunit/cost_estimate-t.cc 2011-11-08 11:37:54 +0000 +++ b/unittest/gunit/cost_estimate-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/dbug-t.cc' --- a/unittest/gunit/dbug-t.cc 2010-10-18 11:31:18 +0000 +++ b/unittest/gunit/dbug-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/dynarray-t.cc' --- a/unittest/gunit/dynarray-t.cc 2011-05-18 08:29:46 +0000 +++ b/unittest/gunit/dynarray-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/field-t.cc' --- a/unittest/gunit/field-t.cc 2011-11-18 11:49:13 +0000 +++ b/unittest/gunit/field-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/filesort_buffer-t.cc' --- a/unittest/gunit/filesort_buffer-t.cc 2011-11-07 15:32:36 +0000 +++ b/unittest/gunit/filesort_buffer-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/get_diagnostics-t.cc' --- a/unittest/gunit/get_diagnostics-t.cc 2011-11-23 09:14:10 +0000 +++ b/unittest/gunit/get_diagnostics-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/gunit_test_main.cc' --- a/unittest/gunit/gunit_test_main.cc 2011-10-11 04:27:52 +0000 +++ b/unittest/gunit/gunit_test_main.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/item-t.cc' --- a/unittest/gunit/item-t.cc 2011-11-17 13:41:28 +0000 +++ b/unittest/gunit/item-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/mdl-t.cc' --- a/unittest/gunit/mdl-t.cc 2011-05-19 09:47:59 +0000 +++ b/unittest/gunit/mdl-t.cc 2011-12-20 09:51:05 +0000 @@ -22,8 +22,7 @@ The code below should hopefully be (mostly) self-explanatory. */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/mdl_mytap-t.cc' --- a/unittest/gunit/mdl_mytap-t.cc 2011-05-19 09:47:59 +0000 +++ b/unittest/gunit/mdl_mytap-t.cc 2011-12-20 09:51:05 +0000 @@ -21,8 +21,7 @@ numbers in case of failures. */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include #include === modified file 'unittest/gunit/my_regex-t.cc' --- a/unittest/gunit/my_regex-t.cc 2010-12-23 11:03:09 +0000 +++ b/unittest/gunit/my_regex-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/opt_range-t.cc' --- a/unittest/gunit/opt_range-t.cc 2011-05-13 09:36:13 +0000 +++ b/unittest/gunit/opt_range-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/opt_trace-t.cc' --- a/unittest/gunit/opt_trace-t.cc 2011-10-05 13:16:38 +0000 +++ b/unittest/gunit/opt_trace-t.cc 2011-12-20 09:51:05 +0000 @@ -18,6 +18,7 @@ Unit test of the Optimizer trace API (WL#5257) */ +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include @@ -80,10 +81,15 @@ void do_check_json_compliance(const char #endif } +extern "C" +void my_error_handler(uint error, const char *str, myf MyFlags); + + class TraceContentTest : public ::testing::Test { public: Opt_trace_context trace; + static bool oom; ///< whether we got an OOM error from opt trace protected: static void SetUpTestCase() { @@ -96,18 +102,20 @@ protected: // Setting debug flags triggers enter/exit trace, so redirect to /dev/null DBUG_SET("o," IF_WIN("NUL", "/dev/null")); } - static bool oom; ///< whether we got an OOM error from opt trace - static void my_error_handler(uint error, const char *str, myf MyFlags) - { - const uint EE= static_cast(EE_OUTOFMEMORY); - EXPECT_EQ(EE, error); - if (error == EE) - oom= true; - } + }; +bool TraceContentTest::oom; + + +void my_error_handler(uint error, const char *str, myf MyFlags) +{ + const uint EE= static_cast(EE_OUTOFMEMORY); + EXPECT_EQ(EE, error); + if (error == EE) + TraceContentTest::oom= true; +} -bool TraceContentTest::oom; TEST_F(TraceContentTest, ConstructAndDestruct) { === modified file 'unittest/gunit/sql_list-t.cc' --- a/unittest/gunit/sql_list-t.cc 2011-10-06 11:06:34 +0000 +++ b/unittest/gunit/sql_list-t.cc 2011-12-20 09:51:05 +0000 @@ -20,8 +20,7 @@ http://code.google.com/p/googletest/wiki/GoogleTestPrimer */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/sql_plist-t.cc' --- a/unittest/gunit/sql_plist-t.cc 2011-04-13 11:31:44 +0000 +++ b/unittest/gunit/sql_plist-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/stdcxx-t.cc' --- a/unittest/gunit/stdcxx-t.cc 2011-11-23 09:14:10 +0000 +++ b/unittest/gunit/stdcxx-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/tap_event_listener.cc' --- a/unittest/gunit/tap_event_listener.cc 2011-06-30 15:50:45 +0000 +++ b/unittest/gunit/tap_event_listener.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/test_utils.cc' --- a/unittest/gunit/test_utils.cc 2011-07-28 10:54:44 +0000 +++ b/unittest/gunit/test_utils.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/thread_utils-t.cc' --- a/unittest/gunit/thread_utils-t.cc 2011-06-30 15:50:45 +0000 +++ b/unittest/gunit/thread_utils-t.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include === modified file 'unittest/gunit/thread_utils.cc' --- a/unittest/gunit/thread_utils.cc 2011-06-30 15:50:45 +0000 +++ b/unittest/gunit/thread_utils.cc 2011-12-20 09:51:05 +0000 @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -// First include (the generated) my_config.h, to get correct platform defines, -// then gtest.h (before any other MySQL headers), to avoid min() macros etc ... +// First include (the generated) my_config.h, to get correct platform defines. #include "my_config.h" #include No bundle (reason: useless for push emails).