Bug #51456 rqg_info_schema fails when SHOW PROCEDURE|FUNCTION CODE feature is disabled
Submitted: 24 Feb 2010 12:26 Modified: 8 Mar 2010 8:31
Reporter: Olav Sandstå Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.5.99-m3, 6.0.14 OS:Any (Unix)
Assigned to: Vladislav Vaintroub CPU Architecture:Any
Tags: pb2, rqg_pb2, test failure

[24 Feb 2010 12:26] Olav Sandstå
Description:
The RQG test "rqg_info_schema" fails with the following error in the log file:

Query: SHOW FUNCTION CODE i failed: 1289 The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you need MySQL built with '--with-debug' to have it working

The server is assumed to be compiled with "--with-debug". The following line is used for configuring it:

./configure --enable-thread-safe-client --enable-local-infile --with-pic --with-client-ldflags=-static --with-mysqld-ldflags=-static --with-zlib-dir=bundled --without-ndb-debug --with-big-tables --with-ssl --with-readline --with-embedded-server --with-archive-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-example-storage-engine --with-federated-storage-engine --with-partition --with-extra-charsets=all --with-innodb --with-ndbcluster --with-debug --with-libevent

which again is invoking cmake with the following command:

configure.pl : calling cmake /export/home/pb2/build/sb_0-1451544-1266997926.37/mysql-6.0.14-alpha  -DENABLE_THREAD_SAFE_CLIENT=1 -DENABLE_LOCAL_INFILE=1 -DWITH_PIC=1 -DWITH_CLIENT_LDFLAGS=_STATIC=1 -DWITH_MYSQLD_LDFLAGS=_STATIC=1 -DWITH_ZLIB=bundled -DWITHOUT_NDB_DEBUG=1 -DWITH_BIG_TABLES=1 -DWITH_SSL=yes -DWITH_READLINE=1 -DWITH_EMBEDDED_SERVER=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_CSV_STORAGE_ENGINE=1 -DWITH_EXAMPLE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_PARTITION=1 -DWITH_EXTRA_CHARSETS=all -DWITH_INNODB=1 -DWITH_NDBCLUSTER=1 -DWITH_DEBUG=1 -DWITH_LIBEVENT=1

How to repeat:
See above
[24 Feb 2010 16:16] John Embretsen
I believe this is a bug in the MySQL build process, i.e. what is supposed to be a debug build is not. But I am not 100% sure without investigating.

I think wlad and olav discussed it already, but I will dig deeper and perhaps provide proof tomorrow, if needed.
[25 Feb 2010 12:32] John Embretsen
This is not a RQG test issue, it is a MySQL build issue, on both Linux and Solaris.

The test rqg_info_schema executes certain queries which require debug functionality to work. Such queries include SHOW PROCEDURE CODE and SHOW FUNCTION CODE.
See http://dev.mysql.com/doc/refman/5.5/en/show-procedure-code.html

On 2010-02-22 this test started failing like this following the push/merge of WL#5161 ("CMake-based unified build system") into the main development branches.

Prior to this, the test failed for a different reason (server crash, Bug#50381).

This can be verified by looking at MTR test logs from Pushbuild platforms (Unix-based) that are supposed to use debug binaries. We see that, for example, the test main.myisam_debug runs against the push before the WL#5161 merge, where as it is skipped after that:

main.myisam_debug                        [ pass ]   1032
vs
main.myisam_debug                        [ skipped ]  Test needs debug binaries

It is also possible to verify by trying to build debug binaries from affected source branches (or download from Pushbuild) and check manually, e.g. by doing 
SELECT version();
which should say explicitly if it is a debug build.

This is most likely caused by the newly introduced cmake build system (used by Pushbuild) not building debug builds even if told to, in certain situations.
[25 Feb 2010 12:36] John Embretsen
Yesterday, Vladislav Vaintroub committed what is a probably a fix for this issue:

http://lists.mysql.com/commits/101358
"CMake: WITH_DEBUG does not work if  environment variable CFLAGS is set."

    modified:
      CMakeLists.txt
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt	2010-02-23 09:53:48 +0000
+++ b/CMakeLists.txt	2010-02-24 17:29:44 +0000
@@ -38,22 +38,21 @@ ENDIF()
 
 OPTION(WITH_DEBUG "Use dbug" OFF)
 OPTION(WITH_DEBUG_FULL "Use dbug and safemalloc/safemutex. Slow" OFF)
-
-IF(NOT HAVE_CMAKE_BUILD_TYPE)
-   IF(BUILD_CONFIG OR NOT CUSTOM_C_FLAGS)
-     IF(WITH_DEBUG)
-       SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Debug build" FORCE)
-     ELSE()
-       SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING 
-        "RelWithDebInfo build" FORCE)
-     ENDIF()
-   ENDIF()
+IF(WITH_DEBUG_FULL)
+  SET(WITH_DEBUG ON CACHE BOOL "Use DBUG" FORCE)
 ENDIF()
 
-IF(WITH_DEBUG_FULL)
-  SET(WITH_DEBUG ON CACHE BOOL "Use DBUG")
+IF(WITH_DEBUG)
+  SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Debug build" FORCE)
+ELSEIF(NOT HAVE_CMAKE_BUILD_TYPE)
+  IF(BUILD_CONFIG OR NOT CUSTOM_C_FLAGS)
+    SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING 
+       "RelWithDebInfo build" FORCE)
+  ENDIF()
 ENDIF()
 
+
+
 IF(BUILD_CONFIG)
   SET(CMAKE_USER_MAKE_RULES_OVERRIDE 
     ${CMAKE_SOURCE_DIR}/cmake/build_configurations/${BUILD_CONFIG}.cmake)

Waiting for push to main branches via backup (?).
[3 Mar 2010 10:47] John Embretsen
Patch pushed by Vladislav on 2010-03-02:

mysql-next-mr-bugfixing:
vvaintroub@mysql.com-20100302005315-nd2andxozpy7xxup

mysql-6.0-codebase-bugfixing:
vvaintroub@mysql.com-20100302014251-dl7iscatvpnhpuka (merged)

It does not seem like the patch has been merged to "main" mysql-next-mr and mysql-6.0-codebase branches yet.

Commit message:

  Fix WITH_DEBUG problems in CMake build, so people who use configure
  wrappers do not suffer. The problem was that when custom C flags 
  were defined with in environment variable CFLAGS, WITH_DEBUG did 
  not have any effect. Also, switch from WITH_DEBUG=ON to 
  WITH_DEBUG=OFF   was not handled correctly .Expected is switch to
  with RelwithDebInfo or when custom compiler flags  are defined, to 
  None.
[8 Mar 2010 8:31] John Embretsen
Pushed into mysql-next-mr (revid:alik@sun.com-20100306103956-kkn9oblqqpcpgvy4).

Pushed into 5.5.3-m3 / Celosia (mysql-trunk) (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3). 
Version source revid:vvaintroub@mysql.com-20100302005315-nd2andxozpy7xxup.

Issue only affecting internal testing between two milestone releases. No changelog entry needed.