Case sensitiveness of tables

mnabialek's profile image mnabialek posted 8 years ago in General Permalink

I have tables with uppercase. When I run SHOW tables I get all of them in uppercase. When I go to table TABLE1 and choose data, I can edit them without a problem. However if I run query:

SELECT * FROM TABLE1

in results I have data but above I have table name in lowercase displayed and now in case I try to edit any record in this table, I'm getting error that this table or view does not exist.

It seems that HeidiSQL doesn't use table names in case sensitive manner when displaying results of query and that's why there's a problem with updating record.

BTW. I'm using Docker and Windows and cannot change lower_case_table_names setting.

ansgar's profile image ansgar posted 8 years ago Permalink

Can you please add a screenshot here?

And what is Docker?

mnabialek's profile image mnabialek posted 8 years ago Permalink

Docker is virtualization system ( https://www.docker.com/ ).

In attachment you can see that in select I use table name uppercase but in results it's in lowercase

1 attachment(s):
  • select-table
ansgar's profile image ansgar posted 8 years ago Permalink

Ah, understand. That lowercasing is done by the server, not HeidiSQL. HeidiSQL uses the MySQL API method mysql_fetch_field_direct to get that table name from a result set.

mnabialek's profile image mnabialek posted 8 years ago Permalink

Hi, maybe I'm wrong but does mysql_fetch_field_direct function is not related to column and not tables? And in this case table name is lower case and not column.

ansgar's profile image ansgar posted 8 years ago Permalink

mysql_fetch_field_direct returns an array with detailed information about a column, e.g. org_table - the table name from where the column comes. Similar to mysqli_fetch_field_direct in PHP. That is how HeidiSQL determines the table name of a user fired query, and that org_table is probably lowercased by the server.

Please login to leave a reply, or register at first.