3

关于mysql不区分大小写

 1 year ago
source link: https://qidizi.github.io/mysql-case-insensitive/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

注意本前提是在区分大小写的系统做的测试,像centos 7

不区分场景

  1. sql关键字不区分,如sElEct 1;
  2. 字段,若字段field_a',使用select field_A from …`不会出错;

区分的场景

  1. 库名,如有库db_a若使用select * from db_A.table_a limit 1;就会出错;
  2. 表名,如有表table_a,若使用select * from db_A.table_A limit 1;就会出错;
  3. replace函数,若字段field_a'有值a,使用replace(field_a, ‘A’,’1’)`就会返回0个影响行;

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK