Bug #33305 Test case in 'skip_grants' file need dynamic loading to be compiled in
Submitted: 18 Dec 2007 0:05 Modified: 11 Jan 2008 15:47
Reporter: Kent Boortz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.0.54 OS:Linux
Assigned to: Alexey Kopytov CPU Architecture:Any

[18 Dec 2007 0:05] Kent Boortz
Description:
There is a test for Bug#32020 in test file "skip_grants.test"
that test UDF and grants. This test will fail if UDF support
(dynamic loading) is no compiled into the binary.

There are several solutions

  - A check "--source include/have_udf.inc" could be added
    to the test file, but that will disable all other tests
    in that file when UDF is not compiled in.

  - The test Bug#32020 could be moved to the file "udf.test",
    to group it with other tests that require UDF support to
    be in the binary.

  - This could be a bug, that dynamic loading should not
    even be tried unless the right grant is given. I.e. the
    test could stay in "skip_grants.test but this bug has
    to be corrected.

This is the test failure output

  mysqltest: At line 126: query 'CREATE FUNCTION a RETURNS STRING
  SONAME ''' failed with wrong errno 1126: 'Can't open shared library
  '' (errno: 0 feature disabled)', instead of 1123...

  The result from queries just before the failure was:
  < snip >
  DROP PROCEDURE p1;
  DROP PROCEDURE p2;
  DROP PROCEDURE p3;
  DROP FUNCTION f1;
  DROP FUNCTION f2;
  DROP FUNCTION f3;
  select count(*) from information_schema.COLUMN_PRIVILEGES;
  count(*)
  0
  select count(*) from information_schema.SCHEMA_PRIVILEGES;
  count(*)
  0
  select count(*) from information_schema.TABLE_PRIVILEGES;
  count(*)
  0
  select count(*) from information_schema.USER_PRIVILEGES;
  count(*)
  0
  CREATE FUNCTION a RETURNS STRING SONAME '';
  ERROR HY000: Can't open shared library '' (errno: 0 feature disabled)

How to repeat:
Configure with

  --with-mysqld-ldflags=-all-static
  --with-client-ldflags=-all-static

to create a fully static binary. No dynamic loading
should be enabled. There might be other ways to disable
the UDF support, but this was how the failing binary
was compiled.
[24 Dec 2007 14:42] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/40389

ChangeSet@1.2594, 2007-12-24 17:42:13+03:00, kaa@polly.(none) +5 -0
  Fix for bug #33305: Test case in 'skip_grants' file need dynamic loading
                      to be compiled in
  
  The problem was that on a statically built server an attempt to create
  a UDF resulted in a different, but reasonable error ("Can't open shared
  library" instead of "UDFs are unavailable with the --skip-grant-tables
  option"), which caused a failure for the test case for bug #32020.
  
  Fixed by moving the test case for bug #32020 from skip_grants.test to a
  separate test to ensure that it is only run when the server is built
  with support for dynamically loaded libraries.
[11 Jan 2008 12:17] Bugs System
Pushed into 6.0.5-alpha
[11 Jan 2008 12:20] Bugs System
Pushed into 5.1.23-rc
[11 Jan 2008 12:22] Bugs System
Pushed into 5.0.56
[11 Jan 2008 15:47] Paul DuBois
Change to test case. No changelog entry needed.