【问题标题】:MYSQL giving different output on Windows 7 And Linux for same queryMYSQL 在 Windows 7 和 Linux 上为相同的查询提供不同的输出
【发布时间】:2015-03-17 14:14:45
【问题描述】:

我已经在 Windows 7 和 Red Hat Linux 上安装了 MySQL。

Windows 7 MySQL 版本 5.6.15 和 Red Hat Linux MySQL 版本是 5.1.12

我的表 wf_params 具有以下架构

Field           Type          Collation        Null    Key     Default  Extra           Privileges                       Comment  
--------------  ------------  ---------------  ------  ------  -------  --------------  -------------------------------  ---------
Id              bigint(20)    (NULL)           NO      PRI     (NULL)   auto_increment  select,insert,update,references           
Name            varchar(100)  utf8_unicode_ci  YES             (NULL)                   select,insert,update,references           
LookupId        bigint(20)    (NULL)           YES             (NULL)                   select,insert,update,references           
ExternalAuthId  bigint(20)    (NULL)           YES             (NULL)                   select,insert,update,references           
LastSync        varchar(50)   utf8_unicode_ci  YES             (NULL)                   select,insert,update,references           
TaskType        varchar(50)   utf8_general_ci  YES             (NULL)                   select,insert,update,references   

它包含数据:

    Id  TaskTypeId  TaskType  Name         Type    Operator  Value            Format  IsDefault  
------  ----------  --------  -----------  ------  --------  ---------------  ------  -----------
     1           2  Trigger   labels       String  EqualsTo  UNREAD,STARRED   (NULL)            1
     2           1  Trigger   albumName    String  EqualsTo  Timeline Photos  (NULL)            1
     3           2  Action    Email        String  EqualsTo  (NULL)           (NULL)            0
     4           7  Trigger   MachineList  String  (NULL)    (NULL)           (NULL)            0

当我执行以下查询时

SELECT UPPER( CONCAT(TaskType,'_',TaskTypeId)) 'OperationId'  , NAME , VALUE   
    FROM wf_params WHERE IsDefault = TRUE;

在 Linux 上,它给我的输出如下:

OperationId  NAME       VALUE            
-----------  ---------  -----------------
Trigger_2    labels     UNREAD,STARRED   
Trigger_1    albumName  Timeline Photos  

但是当我在安装了 MySQL 的 Windows 7 上执行查询时,它会给我输出

OperationId  NAME       VALUE            
-----------  ---------  -----------------
TRIGGER_2    labels     UNREAD,STARRED   
TRIGGER_1    albumName  Timeline Photos  

为什么会这样? 为什么它在linux机器上没有转换为大写?

【问题讨论】:

    标签: java mysql linux windows-7


    【解决方案1】:

    检查表格是否区分大小写。特别注意,在 Windows 上,表名不区分大小写,而在 Linux 上,它们区分大小写。

    http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html

    【讨论】:

      猜你喜欢
      • 2012-07-10
      • 2021-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-14
      • 2017-03-15
      • 1970-01-01
      相关资源
      最近更新 更多