Bug #50377 Backup tests that use PI() fail on Mac OS X
Submitted: 15 Jan 2010 17:03 Modified: 29 Jan 2010 23:03
Reporter: Chuck Bell Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:mysql-6.0-backup OS:Mac OS X (10.6.2)
Assigned to: CPU Architecture:Any
Tags: regression

[15 Jan 2010 17:03] Chuck Bell
Description:
Tests that use the pi() function fail on Mac OS X for a syntax error.

main.view                                [ fail ]
        Test ended at 2010-01-15 12:02:36

CURRENT_TEST: main.view
mysqltest: At line 587: query 'CREATE VIEW v1 (f1,f2,f3,f4) AS SELECT connection_id(), pi(), current_user(), version()' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), current_user(), version()' at line 1

-or- 

backup.backup_xpfm_compat_backup_lctn1   [ fail ]
        Test ended at 2010-01-15 11:40:41

CURRENT_TEST: backup.backup_xpfm_compat_backup_lctn1
mysqltest: In included file "./suite/backup/include/backup_xpfm_compat_backup.inc": At line 589: query 'CREATE VIEW BUP_XPFM_COMPAT_DB2.view1 (c1, c2, c3, c4) AS
SELECT CONNECTION_ID(), PI(), CURRENT_USER(), RPAD(VERSION(), 40, ' ')' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), CURRENT_USER(), RPAD(VERSION(), 40, ' ')' at line 2

But if one starts mysql, we find this is now true:

mysql> select pi();
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
mysql> select pi(0);
+-------+
| pi(0) |
+-------+
|     0 |
+-------+
1 row in set (0.00 sec)

Eeek, gads! Where did the pi() function go?

But on other OSes (like Linux), we see this:

mysql> select pi();
+----------+
| pi()     |
+----------+
| 3.141593 |
+----------+
1 row in set (0.00 sec)

How to repeat:
./mysql-test-run.pl view
[15 Jan 2010 17:55] Valeriy Kravchuk
I can not repeat this on Mac OS X with recent 6.0.14 from mysql-6.0-codebase tree:

77-52-1-11:mysql-test openxs$ ./mysql-test-run.pl viewLogging: ./mysql-test-run.pl  view
100115 19:51:39 [Warning] Setting lower_case_table_names=2 because file system for /var/folders/dX/dXCzvuSlHX4Op1g-o1jIWk+++TI/-Tmp-/Hlw6RiJJoE/ is case insensitive
100115 19:51:39 [Note] Buffered information: Performance schema disabled (reason: start parameters).

100115 19:51:39 [Note] Plugin 'FEDERATED' is disabled.
100115 19:51:39 [Note] Plugin 'ndbcluster' is disabled.
MySQL Version 6.0.14
Checking supported features...
 - using ndbcluster when necessary, mysqld supports it
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
vardir: /Users/openxs/dbs/6.0-codebase/mysql-test/var
Checking leftover processes...
mysql-test-run: WARNING: Found non pid file 'backup_xpfm_compat_lctn1.bak' in '/Users/openxs/dbs/6.0-codebase/mysql-test/var/run'
Removing old var directory...
 - WARNING: Using the 'mysql-test/var' symlink
Creating var directory '/Users/openxs/dbs/6.0-codebase/mysql-test/var'...
Installing system database...
Using server port 55646

==============================================================================

TEST                                      RESULT   TIME (ms)
------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
main.view                                [ pass ]   1883
------------------------------------------------------------
The servers were restarted 0 times
Spent 1.883 of 9 seconds executing testcases

All 1 tests were successful.

77-52-1-11:mysql-test openxs$ ./mysql-test-run.pl backup_xpfm_compat_backup_lctn1
Logging: ./mysql-test-run.pl  backup_xpfm_compat_backup_lctn1
100115 19:51:54 [Warning] Setting lower_case_table_names=2 because file system for /var/folders/dX/dXCzvuSlHX4Op1g-o1jIWk+++TI/-Tmp-/cUbN4B0jdK/ is case insensitive
100115 19:51:54 [Note] Buffered information: Performance schema disabled (reason: start parameters).

100115 19:51:54 [Note] Plugin 'FEDERATED' is disabled.
100115 19:51:54 [Note] Plugin 'ndbcluster' is disabled.
MySQL Version 6.0.14
Checking supported features...
 - using ndbcluster when necessary, mysqld supports it
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
vardir: /Users/openxs/dbs/6.0-codebase/mysql-test/var
Checking leftover processes...
Removing old var directory...
 - WARNING: Using the 'mysql-test/var' symlink
Creating var directory '/Users/openxs/dbs/6.0-codebase/mysql-test/var'...
Installing system database...
Using server port 55660

==============================================================================

TEST                                      RESULT   TIME (ms)
------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
backup.backup_xpfm_compat_backup_lctn1   [ pass ]   1534
------------------------------------------------------------
The servers were restarted 0 times
Spent 1.534 of 12 seconds executing testcases

All 1 tests were successful.

77-52-1-11:mysql-test openxs$ uname -a
Darwin 77-52-58-147.dialup.umc.net.ua 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386

...

77-52-1-11:6.0-codebase openxs$ bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 6.0.14-alpha-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select pi();
+----------+
| pi()     |
+----------+
| 3.141593 |
+----------+
1 row in set (0.00 sec)

mysql> select pi(0);
ERROR 1582 (42000): Incorrect parameter count in the call to native function 'pi'

What am I missing?
[15 Jan 2010 19:18] Chuck Bell
This occurs in the mysql-6.0-backup tree.
[15 Jan 2010 20:23] Chuck Bell
Confirmed it does not show up in mysql-6.0-codebase but does in mysql-6.0-backup.

Using Mac OS X 10.6.2
[17 Jan 2010 10:12] Sveta Smirnova
Not repeatable on Tiger
[29 Jan 2010 23:03] Chuck Bell
Problem is gone with latest pull from parent tree.