At 13:39 15/02/2002 +0100, Roger Baklund wrote:

Hi Roger,

If I am not wrong after the release 3.23.40 was removed from
config-win.h the line below:

#define FN_LOWER_CASE TRUE /* Files are represented in lower case */

The above meant that MySQL independently of the OS, always wrote the
tables with lower case.

However some user wanted the option for to change this set for to
FALSE. Then today, you find for default:

mysql> show variables like "lower_case_table_names";
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| lower_case_table_names | 0     |
+------------------------+-------+
1 row in set (0.06 sec)

The above means, that the MySQL server on Windows doesn't force to
write the table on lower case, however the result depend in the OS
you are working and some environment factors affects the OS, like
I try to show you below:

1- On Win9x always the write/read is case insensitive.

Microsoft(R) Windows 95
(C)Copyright Microsoft Corp 1981-1996.

C:\WINDOWS>c:\mysql\bin\mysql test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 3.23.48-max

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table XXXX (id int);
Query OK, 0 rows affected (0.17 sec)

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| xxxx           |
+----------------+
1 row in set (0.38 sec)

2- On some NT boxes and in general on Win2k boxes, the write is case
    sensitive and the read always is insensitive:

Microsoft Windows 2000 [Versão 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

c:\mysql\bin>mysql test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 3.23.48-max-nt-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table XXXy (id int);
Query OK, 0 rows affected (0.42 sec)

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| XXXy           |
+----------------+
1 row in set (0.05 sec)

3- Now I did the sample you sent on Win2K Server:

Microsoft Windows 2000 [Versão 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

c:\mysql\bin>mysql test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 3.23.48-max-nt-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table U1 (id int);
Query OK, 0 rows affected (0.03 sec)

mysql>
mysql> insert into U1 values (1);
Query OK, 1 row affected (0.03 sec)

mysql> rename table U1 to U2;
Query OK, 0 rows affected (0.03 sec)

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| U2             |
+----------------+
1 row in set (0.01 sec)

A different behavior you got.

How you can see we don't have a constant behavior of the Windows OS
in the handle of lower/upper case names.

The user should know if his application will works on NT/Win2K should
expects error messages with write operation using different syntax
with the lower/upper case.

Regards,
Miguel

>Hi,
>
>this has to be a bug. It seems on windows "RENAME TABLE <old> TO <new>" only
>works for uppercase table names _after_ an "ALTER TABLE <old> RENAME AS
><new>" _or_ if you first rename the table using lower case letters:
>
>mysql> create table U1 (id int);
>Query OK, 0 rows affected (0.04 sec)
>
>mysql> insert into U1 values (1);
>Query OK, 1 row affected (0.01 sec)
>
>mysql> rename table U1 to U2;
>ERROR 7: Error on rename of '.\test\u1.MYI' to '.\test\u2.MYI' (Errcode: 13)
>mysql> alter table U1 rename as U2;
>Query OK, 0 rows affected (0.01 sec)
>
>mysql> rename table U2 to U1;
>Query OK, 0 rows affected (0.00 sec)
>
>mysql> rename table U1 to U2;
>Query OK, 0 rows affected (0.01 sec)
>
>I think there is some confusion within the mysql server because windows has
>case insensitive file names. The table is created with lowercase letters on
>the OS level:
>
>mysql> create table W1 (id int);
>Query OK, 0 rows affected (0.05 sec)
>
>mysql> insert into W1 values (1);
>Query OK, 1 row affected (0.00 sec)
>
>mysql> show tables like "W%";
>Empty set (0.01 sec)
>
>mysql> show tables like "w%";
>+---------------------+
>| Tables_in_test (w%) |
>+---------------------+
>| w1                  |
>+---------------------+
>1 rows in set (0.00 sec)
>
>C:\mysql\data\test>dir w1*
>  Volume in drive C has no label.
>  Volume Serial Number is 28E6-EF3E
>
>  Directory of C:\mysql\data\test
>
>15.02.2002  13:02                8 550 w1.frm
>15.02.2002  13:03                    5 w1.MYD
>15.02.2002  13:02                1 024 w1.MYI
>                3 File(s)          9 579 bytes
>                0 Dir(s)     573 779 968 bytes free
>
>mysql> rename table W1 to W2;
>ERROR 7: Error on rename of '.\test\w1.MYI' to '.\test\w2.MYI' (Errcode: 13)
>mysql> rename table w1 to W2;
>Query OK, 0 rows affected (0.01 sec)
>
>mysql> rename table W2 to W1;
>Query OK, 0 rows affected (0.00 sec)
>
>mysql> rename table W1 to W2;
>Query OK, 0 rows affected (0.01 sec)
>
>Note that the error message has the table name in lower case, so it seems
>mysql 'knows' about the OS case insensitivity, but for some reason it fails
>on the rename if the user used upper case letters on the RENAME _and_ on the
>CREATE, _and_ this is done within the same session. Creating the table,
>exiting the mysql console, re-entering the console and then do the rename
>works just fine.
>
>--
>Roger
>query
>
>
>---------------------------------------------------------------------
>Before posting, please check:
>    http://www.mysql.com/manual.php (the manual)
>    http://lists.mysql.com/         (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail <[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-- 
For technical support contracts, goto https://order.mysql.com/
    __  ___     ___ ____  __
   /  |/  /_ __/ __/ __ \/ /    Miguel A. Solórzano <[EMAIL PROTECTED]>
  / /|_/ / // /\ \/ /_/ / /__   MySQL AB, FullTime Developer
/_/  /_/\_, /___/\___\_\___/   Mogi das Cruzes - São Paulo, Brazil
        <___/   www.mysql.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to