热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Issueswithuppercasetableanddatabasenames

StepstoreproduceSet


Steps to reproduce

Set

1
lower_case_table_names = 1

in

1
my.ini

Option 1:


  1. Create a database
    1
    UPPERCASE


  2. Create a new table
    1
    test

    in the database


  3. PHPMyAdmin tries to load database
    1
    UPPERCASE

    instead of

    1
    uppercase

    (

    1
    lower_case_table_names = 1

    ); you are 'redirected' to something like

    1
    db_structure.php?server=1&db=UPPERCASE&table=test

    . This does not happen when using the navigation panel afterwards (which displays lowercase names)


  4. The following error messages appear:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Warning in .\libraries\controllers\table\TableStructureController.php#1299

 Illegal string offset 'Data_length'



Backtrace



.\libraries\controllers\table\TableStructureController.php#1255: PMA\libraries\controllers\table\TableStructureController->getTableStats()

.\libraries\controllers\table\TableStructureController.php#353: PMA\libraries\controllers\table\TableStructureController->displayStructure(

array,

array,

array,

boolean false,

array,

array,

)

.\tbl_structure.php#47: PMA\libraries\controllers\table\TableStructureController->indexAction()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Warning in .\libraries\controllers\table\TableStructureController.php#1302

 Illegal string offset 'Index_length'



Backtrace



.\libraries\controllers\table\TableStructureController.php#1255: PMA\libraries\controllers\table\TableStructureController->getTableStats()

.\libraries\controllers\table\TableStructureController.php#353: PMA\libraries\controllers\table\TableStructureController->displayStructure(

array,

array,

array,

boolean false,

array,

array,

)

.\tbl_structure.php#47: PMA\libraries\controllers\table\TableStructureController->indexAction()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Warning in .\libraries\controllers\table\TableStructureController.php#1314

 Illegal string offset 'Data_length'



Backtrace



.\libraries\controllers\table\TableStructureController.php#1255: PMA\libraries\controllers\table\TableStructureController->getTableStats()

.\libraries\controllers\table\TableStructureController.php#353: PMA\libraries\controllers\table\TableStructureController->displayStructure(

array,

array,

array,

boolean false,

array,

array,

)

.\tbl_structure.php#47: PMA\libraries\controllers\table\TableStructureController->indexAction()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Warning in .\libraries\controllers\table\TableStructureController.php#1318

 Illegal string offset 'Index_length'



Backtrace



.\libraries\controllers\table\TableStructureController.php#1255: PMA\libraries\controllers\table\TableStructureController->getTableStats()

.\libraries\controllers\table\TableStructureController.php#353: PMA\libraries\controllers\table\TableStructureController->displayStructure(

array,

array,

array,

boolean false,

array,

array,

)

.\tbl_structure.php#47: PMA\libraries\controllers\table\TableStructureController->indexAction()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Warning in .\libraries\controllers\table\TableStructureController.php#1336

 Illegal string offset 'Data_length'



Backtrace



.\libraries\controllers\table\TableStructureController.php#1255: PMA\libraries\controllers\table\TableStructureController->getTableStats()

.\libraries\controllers\table\TableStructureController.php#353: PMA\libraries\controllers\table\TableStructureController->displayStructure(

array,

array,

array,

boolean false,

array,

array,

)

.\tbl_structure.php#47: PMA\libraries\controllers\table\TableStructureController->indexAction()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Warning in .\libraries\controllers\table\TableStructureController.php#1337

 Illegal string offset 'Index_length'



Backtrace



.\libraries\controllers\table\TableStructureController.php#1255: PMA\libraries\controllers\table\TableStructureController->getTableStats()

.\libraries\controllers\table\TableStructureController.php#353: PMA\libraries\controllers\table\TableStructureController->displayStructure(

array,

array,

array,

boolean false,

array,

array,

)

.\tbl_structure.php#47: PMA\libraries\controllers\table\TableStructureController->indexAction()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Warning in .\libraries\controllers\table\TableStructureController.php#1342

 Illegal string offset 'Data_length'



Backtrace



.\libraries\controllers\table\TableStructureController.php#1255: PMA\libraries\controllers\table\TableStructureController->getTableStats()

.\libraries\controllers\table\TableStructureController.php#353: PMA\libraries\controllers\table\TableStructureController->displayStructure(

array,

array,

array,

boolean false,

array,

array,

)

.\tbl_structure.php#47: PMA\libraries\controllers\table\TableStructureController->indexAction()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Warning in .\libraries\controllers\table\TableStructureController.php#1342

 Illegal string offset 'Index_length'



Backtrace



.\libraries\controllers\table\TableStructureController.php#1255: PMA\libraries\controllers\table\TableStructureController->getTableStats()

.\libraries\controllers\table\TableStructureController.php#353: PMA\libraries\controllers\table\TableStructureController->displayStructure(

array,

array,

array,

boolean false,

array,

array,

)

.\tbl_structure.php#47: PMA\libraries\controllers\table\TableStructureController->indexAction()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Warning in .\templates\table\structure\display_table_stats.phtml#4

 Illegal string offset 'TABLE_COMMENT'



Backtrace



.\libraries\Template.php#152: include(.\templates\table\structure\display_table_stats.phtml)

.\libraries\controllers\table\TableStructureController.php#1379: PMA\libraries\Template->render(array)

.\libraries\controllers\table\TableStructureController.php#1255: PMA\libraries\controllers\table\TableStructureController->getTableStats()

.\libraries\controllers\table\TableStructureController.php#353: PMA\libraries\controllers\table\TableStructureController->displayStructure(

array,

array,

array,

boolean false,

array,

array,

)

.\tbl_structure.php#47: PMA\libraries\controllers\table\TableStructureController->indexAction()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Warning in .\templates\table\structure\display_table_stats.phtml#6

 Illegal string offset 'TABLE_COMMENT'



Backtrace



.\libraries\Template.php#152: include(.\templates\table\structure\display_table_stats.phtml)

.\libraries\controllers\table\TableStructureController.php#1379: PMA\libraries\Template->render(array)

.\libraries\controllers\table\TableStructureController.php#1255: PMA\libraries\controllers\table\TableStructureController->getTableStats()

.\libraries\controllers\table\TableStructureController.php#353: PMA\libraries\controllers\table\TableStructureController->displayStructure(

array,

array,

array,

boolean false,

array,

array,

)

.\tbl_structure.php#47: PMA\libraries\controllers\table\TableStructureController->indexAction()


Option 2:


  1. Create a database
    1
    lowercase


  2. Create a table
    1
    TEST


  3. PHPMyAdmin again tries to load
    1
    TEST

    instead of

    1
    test


  4. The same error messages appear

Additional info

PHPMyAdmin also throws an error when loading the structure of a table in an uppercase database or the structure of an uppercase table in an uppercase/lowercase database which was created with

1
lower_case_table_names = 2

(so the table/database has an actual uppercase name).

E.g. there is a database called

1
UPPERCASE

with a table

1
test

, then

1
tbl_structure.php?db=UPPERCASE&table=test

throws an error.

This only and always happens when loading up the table with

1
lower_case_table_names = 1

However,

1
INFORMATION_SCHEMA

does not seem to be affected by this.

This also happens when trying to load table

1
test

while it's actually called

1
TEST

if

1
lower_case_table_names = 1

.

I couldn't test with

1
lower_case_table_names = 0

, because MariaDB does not support this on Windows.

Expected behavior


  1. PHPMyAdmin should use a lowercase name when loading a table after creating, because
    1
    lower_case_table_names = 1


  2. No error messages should appear anyway, even when the URL contains an uppercase name (I use collation
    1
    utf8mb4_general_ci

    ). Especially not if the name actually contains uppercase characters.


Actual behavior


  1. Names are not corrected

  2. Error messages appear when loading uppercase tables/databases (table structure) with
    1
    lower_case_table_names = 1

    set


Summary of error messages:


  1. Set
    1
    lower_case_table_names = 2


  2. Create an uppercase table
    1
    TEST

    in database

    1
    lowercase


1
lower_case_table_names

-->|

1
1

|

1
2

---|---|---

1
tbl_structure.php?db=lowercase&table=test

|Error in Microsoft Edge (redirects to

1
TEST

), Works in Firefox|Error!

1
tbl_structure.php?db=lowercase&table=TEST

|Error!|Works

Server configuration

Operating system: Windows 10 x64

Web server: Apache 2.4.25 x86

Database: MariaDB 10.2.5 RC x64

PHP version: 7.1.1 x86

phpMyAdmin version: 4.7.0

Client configuration

Browser: Microsoft Edge 14, Mozilla Firefox 52.0.2

Operating system: Windows 10 x64

该提问来源于开源项目:phpmyadmin/phpmyadmin

Fixed by ca3f027f7e714df46865d8e8393d94ff535a957d :tada:


推荐阅读
  • 解决VS写C#项目导入MySQL数据源报错“You have a usable connection already”问题的正确方法
    本文介绍了在VS写C#项目导入MySQL数据源时出现报错“You have a usable connection already”的问题,并给出了正确的解决方法。详细描述了问题的出现情况和报错信息,并提供了解决该问题的步骤和注意事项。 ... [详细]
  • 本文介绍了通过ABAP开发往外网发邮件的需求,并提供了配置和代码整理的资料。其中包括了配置SAP邮件服务器的步骤和ABAP写发送邮件代码的过程。通过RZ10配置参数和icm/server_port_1的设定,可以实现向Sap User和外部邮件发送邮件的功能。希望对需要的开发人员有帮助。摘要长度:184字。 ... [详细]
  • Nginx使用(server参数配置)
    本文介绍了Nginx的使用,重点讲解了server参数配置,包括端口号、主机名、根目录等内容。同时,还介绍了Nginx的反向代理功能。 ... [详细]
  • 本文讨论了Alink回归预测的不完善问题,指出目前主要针对Python做案例,对其他语言支持不足。同时介绍了pom.xml文件的基本结构和使用方法,以及Maven的相关知识。最后,对Alink回归预测的未来发展提出了期待。 ... [详细]
  • 如何使用Java获取服务器硬件信息和磁盘负载率
    本文介绍了使用Java编程语言获取服务器硬件信息和磁盘负载率的方法。首先在远程服务器上搭建一个支持服务端语言的HTTP服务,并获取服务器的磁盘信息,并将结果输出。然后在本地使用JS编写一个AJAX脚本,远程请求服务端的程序,得到结果并展示给用户。其中还介绍了如何提取硬盘序列号的方法。 ... [详细]
  • 本文讨论了如何优化解决hdu 1003 java题目的动态规划方法,通过分析加法规则和最大和的性质,提出了一种优化的思路。具体方法是,当从1加到n为负时,即sum(1,n)sum(n,s),可以继续加法计算。同时,还考虑了两种特殊情况:都是负数的情况和有0的情况。最后,通过使用Scanner类来获取输入数据。 ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • ZSI.generate.Wsdl2PythonError: unsupported local simpleType restriction ... [详细]
  • 本文介绍了在Mac上搭建php环境后无法使用localhost连接mysql的问题,并通过将localhost替换为127.0.0.1或本机IP解决了该问题。文章解释了localhost和127.0.0.1的区别,指出了使用socket方式连接导致连接失败的原因。此外,还提供了相关链接供读者深入了解。 ... [详细]
  • 本文介绍了计算机网络的定义和通信流程,包括客户端编译文件、二进制转换、三层路由设备等。同时,还介绍了计算机网络中常用的关键词,如MAC地址和IP地址。 ... [详细]
  • 本文详细介绍了MySQL表分区的创建、增加和删除方法,包括查看分区数据量和全库数据量的方法。欢迎大家阅读并给予点评。 ... [详细]
  • CentOS 6.5安装VMware Tools及共享文件夹显示问题解决方法
    本文介绍了在CentOS 6.5上安装VMware Tools及解决共享文件夹显示问题的方法。包括清空CD/DVD使用的ISO镜像文件、创建挂载目录、改变光驱设备的读写权限等步骤。最后给出了拷贝解压VMware Tools的操作。 ... [详细]
  • 本文详细介绍了如何使用MySQL来显示SQL语句的执行时间,并通过MySQL Query Profiler获取CPU和内存使用量以及系统锁和表锁的时间。同时介绍了效能分析的三种方法:瓶颈分析、工作负载分析和基于比率的分析。 ... [详细]
  • PDO MySQL
    PDOMySQL如果文章有成千上万篇,该怎样保存?数据保存有多种方式,比如单机文件、单机数据库(SQLite)、网络数据库(MySQL、MariaDB)等等。根据项目来选择,做We ... [详细]
  • 本文主要复习了数据库的一些知识点,包括环境变量设置、表之间的引用关系等。同时介绍了一些常用的数据库命令及其使用方法,如创建数据库、查看已存在的数据库、切换数据库、创建表等操作。通过本文的学习,可以加深对数据库的理解和应用能力。 ... [详细]
author-avatar
王艳kiki
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有