Using case insensitive identifiers in MySQL at the session level

I inherited a web application that uses MySQL as a database. Previous owners ran MySQL on Windows, which is case insensitive for table / column / alias.

Our most powerful cloud MySQL server is Linux and we are not going to buy new virtual hardware. Linux MySQL is case sensitive.

One of the requests uses a different ID, exactly AND d.D11 IS NOT NULL and D.D11 <>''

.

Changing the request (s) is not an option

Spoiler below for the curious, but please don't discuss: the direct question is in the next section. This "spoiler" is to avoid comments like "Can't you just change your request?"

Why can't we change requests:
Requests are stored __encrypted__ in the database table. They are loaded and run as needed. These inquiries were developed and certified in cooperation with a law firm. They are a valuable asset, and while I can debug the code and catch the exact request, I cannot change it. Even if the app has a screen where I can manually edit the text of 180 requests (having a superuser account), when this page loads the request itself, it quits for some reason (being the editor's screen, the request only needs to load from its table). so the application crashes. Finally: I currently don't know __how many__ queries are affected by this issue

Change lower_case_table_names

on production server is not yet an option

However, changing something at the database level is a great option (via ALTER SCHEMA

/ ALTER DATABASE

).

For now, my question is, can I tell the connection string to be temporarily enabled lower_case_table_names

? If not, can I use a different character set (current is latin1

) to make MySQL case insensitive to case insensitive data?

+3


source to share





All Articles