Tuesday, 3 April 2012

Is MYSQL CASE INSENSITIVE



Is MYSQL CASE INSENSITIVE  ?????

Hello Friends,
                        Today I want to ask a question to all of you, "Is mysql case insensitive ?".

and, Most of the answer is "YES". Mysql is a case insensitive.
  Ok, One More Question : 
If I created a database or Table with name "TESTDATA", now when i use 
>show databases; 
it will show :         testdata
why i cant see database name in the original letter case, which i have given.


Well friends, thats not enough to know. Mysql gives you functionality to change its case sensitivity.

I will tell you some interesting facts about mysql :

1) Case sensitivity of mysql is dependent of Operating System. Key factor is how the database and tables are stored on the disk.

  " MySql is case sensitive for variety of unix system. But case Insensitive for Windows."

One notable exception is Mac OS X, which is Unix-based but uses a default file system type (HFS+) that is not case sensitive. However, Mac OS X also supports UFS volumes, which are case sensitive just as on any Unix.
 But Trigger names are always case sensitive, which differs from standard SQL. 

Now I will tell you how you can change case sensitivity ?
How table and database names are stored on disk and used in MySQL is affected by the system variable, which you can set when starting  "mysqld".
 System Variable lower_case_table_names can take the values shown in the following table. On Unix, the default value of is 0. On Windows the default value is 1. On Mac OS X, the default value is 2. 

Value Meaning
0 Table and database names are stored on disk using the lettercase specified in the CREATE TABLE or CREATE DATABASE statement. Name comparisons are case sensitive. You should not set this variable to 0 if you are running MySQL on a system that has case-insensitive file names (such as Windows or Mac OS X). If you force this variable to 0 with --lower-case-table-names=0 on a case-insensitive file system and access MyISAM tablenames using different lettercases, index corruption may result.
1 Table names are stored in lowercase on disk and name comparisons are not case sensitive. MySQL converts all table names to lowercase on storage and lookup. This behavior also applies to database names and table aliases.
2 Table and database names are stored on disk using the lettercase specified in the CREATE TABLE or CREATE DATABASE statement, but MySQL converts them to lowercase on lookup. Name comparisons are not case sensitive. This works only on file systems that are not case sensitive! InnoDB table names are stored in lowercase, as for lower_case_table_names=1.


If you want to change the case sensitivity for my sql , you only need to change the value of this system variable "lower_case_table_names".  you can change this system variables in the configuration file also (.cnf) file. 



Monday, 2 April 2012

Thread in Evaluating state while debugging

Thread in Evaluating state in Eclipse Debugging

Hello Friends,
                       after so many days i am posting something. now-a-days while debugging a simple core java code in eclipse, i face a problem again and again.
My debug break point is  on a simple variable which value is assigned by a calling function.
 In the debugging prespective my thread status changes to "Evaluating" and the whole code is hanged. Eventually when I tried to step, it would say "stepping" forever, and never complete the step - I had to terminate the process..
Although the thread appears suspended, the resume button is not enabled. Only i could do is to terminate the debugging and start it again, but the same problem appears again.  

So friends, this type of problem may be caused by a exception thrown by the calling method.
Some tricks to avoid this situation is :

1) change your breakpoints. disable breakpoint from the statement where  variable is defined. Enable the breakpoint inside the definition of the function which is called. 
Now it will show you the proper exception.

2) In the variable defining statement, select the expression, right click and click on watch. In the expression perspective you can see the exception name properly.

That is only i know about this condition. If you have any other idea please feel free to comment.
 

Search This Blog

Total Pageviews