Skip to main content

MY.L6.LOWER_CASE_TABLE_NAMES_RISK — the development-against-production split you cannot switch off

  • Category: safety
  • Level: 6
  • Confidence: deterministic
  • Downtime class: none
  • Stability: stable
  • Suites: audit
  • Applies to: MySQL 8.4
  • Not transferable to MariaDB: this page describes MySQL 8.4 behavior. MariaDB answers the same driver and does not share these semantics, so SQLens refuses it outright rather than reasoning about it — see drivers/unsupported.

A macOS install initializes with 2. A Linux server usually has 0.

So a migration using mixed-case table names passes on one and fails on the other — and nothing in the migration says which server it was written for.

SQLens has no opinion about the right value

There isn't one. 0 is right on Linux, 2 is what macOS gives you, and which a project wants depends on where it deploys. So this rule never asserts a value of its own. It judges against two things it can stand behind.

1. What the project stated

// config/sqlens.php
'audit' => [
'expect' => [
'lower_case_table_names' => 0,
],
],

Unset — the shipped default — this trigger says nothing at all. That is the right amount of noise for a project that has never cared.

2. What the catalog already holds

On 0 the server is case-sensitive. A schema that already holds a table named Orders is one where a query writing orders will not find it — while on a server initialized with 1 or 2 it would. That is objectively provable without anybody stating a preference, so it fires either way.

Flagged

CREATE TABLE Orders (id BIGINT PRIMARY KEY);
-- on a server initialized with lower_case_table_names = 0

Preferred

CREATE TABLE orders (id BIGINT PRIMARY KEY);

The remediation is naming, not a switch

The value is fixed when the server is initialized and cannot be changed afterwards. Moving it means a new server and a dump/reload.

A rule proposing SET GLOBAL here would be proposing something MySQL refuses — so the finding proposes consistent lower-case naming, which is the thing a project can do this afternoon.

What is not reported

A catalog that could not be read is reported as undetermined, not as clean: on a case-sensitive server, "we could not list the tables" and "no table depends on its case" are different sentences.

Sources