Comments - Identifier Case-sensitivity

3 years, 9 months ago Hiran Chaudhuri

I am developing an application on Windows, later in production it is meant to run on Linux. So case sensitivity is an issue for me.

During development with MariaDB on Windows version 10.4.8 I perceive my application receives an exception on insert into column 'Owner_Details' when only 'Owner_details' is in the database. My application is smart enough to care about this by adding the column on the fly. However on 'alter table ... add column Owner_Details' I get a 'duplicate column name' error.

So does the column exist or not? If the windows version were consistent in not caring about the case the error upon insert should not happen in first place.

 
1 month, 4 weeks ago Johannes Kingma

In order to have case sensitivety on NTFS you will have to enable it on the filesystem before setting the parameter

Exec this ps script as administrator to enable case sensitivety on the mariadb data folder:

Get-ChildItem -Directory -recurse |Foreach {fsutil file setcasesensitiveinfo $_.fullname}

You might want to make a backup of all databases first and do this on a fresh data folder and import the backup.

Btw tables and schemas names are case sensitive but column names are not!

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.