At 15:59 +0200 2/23/04, Victoria Reznichenko wrote:Hassan Shaikh <[EMAIL PROTECTED]> wrote:
I am running MySQL in ANSI standard mode. However the following statement is giving unexpected result. Am I missing something?
mysql> select 'This is a' || ' test string'; +-------------------------------+ | 'This is a' || ' test string' | +-------------------------------+ | 0 | +-------------------------------+ 1 row in set (0.00 sec)
Here's a part of my my.ini, indicating that I am in ANSI mode.
# The MySQL server [mysqld] port=3306 #socket=MySQL skip-locking set-variable = sql-mode=ansi
This should work, but when I try it, it doesn't work. (The sql_mode variable is set to 4, which is the numeric equivalent of the ANSI_QUOTES option. I believe what's happening is that there is an attempt to match prefixes of option names that is done incorrectly.)
I'll file a bug report. In the meantime, you can use this instead:
[mysqld] ansi
Oops, sql-mod=ansi not working isn't a bug after all, at least not if you're using MySQL 4.x. The ansi shortcut was added in 4.1.1:
http://www.mysql.com/doc/en/Server_SQL_mode.html
That should produce the desired effect.
> set-variable = key_buffer=32Mset-variable = max_allowed_packet=1M set-variable = table_cache=32 set-variable = net_buffer_length=8K set-variable = sort_buffer=1M set-variable = record_buffer=512K set-variable = myisam_sort_buffer_size=4M set-variable = thread_cache=8 # Try number of CPU's*2 for thread_concurrency set-variable = thread_concurrency=8 log-bin server-id = 1
What version of MySQL do you use? If you use version < 4.1 , you should put in the my.cnf
[mysqld] ansi ...
or
[musqld] sql-mode=REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ONLY_FULL_GROUP_BY transaction-isolation=SERIALIZABLE ..
-- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com
MySQL Users Conference: April 14-16, 2004 http://www.mysql.com/uc2004/
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com
MySQL Users Conference: April 14-16, 2004 http://www.mysql.com/uc2004/
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]