Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/en/docs/lakehouse/multi-catalog/jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,3 +571,29 @@ For Oracle mode, please refer to [Oracle type mapping](#Oracle)
```

When the above phenomenon appears, it may be that mysql server's own memory or CPU resources are exhausted and the MySQL service is unavailable. You can try to increase the memory or CPU resources of MySQL Server.

9. If the results are inconsistent with those in the MYSQL database when you query the MYSQL database using JDBC

First check whether the string in the query field is case-sensitive. For example, there is a field c_1 in the Table with two

data "aaa" and "AAA". If the MYSQL database is not case-sensitive when initializing the MYSQL database, mysql is

case-insensitive by default, but Doris is strictly case-sensitive, so the following situations will occur:

```
Mysql behavior:
select count(c_1) from table where c_1 = "aaa"; The string size is not distinguished, so the result is : 2

Doris behavior:
select count(c_1) from table where c_1 = "aaa"; Strictly delimit the string size, so the result is : 1
```

If the above phenomenon occurs, it needs to be adjusted according to demand, as follows:

Add the "BINARY" keyword when querying in MYSQL to force case sensitivity : select count(c_1) from table where BINARY c_1 =

"aaa"; Or specify it when creating a table in MYSQL : CREATE TABLE table ( c_1 VARCHAR(255) CHARACTER SET binary );

Or specify collation rules to be case sensitive when initializing the MYSQL database : character-set-server=UTF-8 and

collation-server=utf8_bin.
19 changes: 19 additions & 0 deletions docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -570,4 +570,23 @@ Oracle 模式请参考 [Oracle类型映射](#Oracle)
```

出现上述现象时,可能是Mysql Server自身的内存或CPU资源被耗尽导致Mysql服务不可用,可以尝试增大Mysql Server的内存或CPU配置。

9. 使用JDBC查询MYSQL的过程中,如果发现和在MYSQL库的查询结果不一致的情况

首先要先排查下查询字段中是字符串否存在有大小写情况。比如,Table中有一个字段c_1中有"aaa"和"AAA"两条数据,如果在初始化MYSQL数据库时未指定区分字符串
大小写,那么MYSQL默认是不区分字符串大小写的,但是在Doris中是严格区分大小写的,所以会出现以下情况:

```
Mysql行为:
select count(c_1) from table where c_1 = "aaa"; 未区分字符串大小,所以结果为:2

Doris行为:
select count(c_1) from table where c_1 = "aaa"; 严格区分字符串大小,所以结果为:1
```

如果出现上述现象,那么需要按照需求来调整,方式如下:

在MYSQL中查询时添加“BINARY”关键字来强制区分大小写:select count(c_1) from table where BINARY c_1 = "aaa"; 或者在MYSQL中建表时候指定:
CREATE TABLE table ( c_1 VARCHAR(255) CHARACTER SET binary ); 或者在初始化MYSQL数据库时指定校对规则来区分大小写:
character-set-server=UTF-8 和 collation-server=utf8_bin。