[compatibility](MySQL) update charset to utf8mb4, collation to utf8mb4_0900_bin (#31046)
Doris's behaviour is more like utf8mb4 and utf8mb4_0900_bin than utf8 and utf8_general_ci
This commit is contained in:
@ -650,20 +650,20 @@ public class SessionVariable implements Serializable, Writable {
|
||||
|
||||
// this is used to make c3p0 library happy
|
||||
@VariableMgr.VarAttr(name = CHARACTER_SET_CLIENT)
|
||||
public String charsetClient = "utf8";
|
||||
public String charsetClient = "utf8mb4";
|
||||
@VariableMgr.VarAttr(name = CHARACTER_SET_CONNNECTION)
|
||||
public String charsetConnection = "utf8";
|
||||
public String charsetConnection = "utf8mb4";
|
||||
@VariableMgr.VarAttr(name = CHARACTER_SET_RESULTS)
|
||||
public String charsetResults = "utf8";
|
||||
public String charsetResults = "utf8mb4";
|
||||
@VariableMgr.VarAttr(name = CHARACTER_SET_SERVER)
|
||||
public String charsetServer = "utf8";
|
||||
public String charsetServer = "utf8mb4";
|
||||
@VariableMgr.VarAttr(name = COLLATION_CONNECTION)
|
||||
public String collationConnection = "utf8_general_ci";
|
||||
public String collationConnection = "utf8mb4_0900_bin";
|
||||
@VariableMgr.VarAttr(name = COLLATION_DATABASE)
|
||||
public String collationDatabase = "utf8_general_ci";
|
||||
public String collationDatabase = "utf8mb4_0900_bin";
|
||||
|
||||
@VariableMgr.VarAttr(name = COLLATION_SERVER)
|
||||
public String collationServer = "utf8_general_ci";
|
||||
public String collationServer = "utf8mb4_0900_bin";
|
||||
|
||||
// this is used to make c3p0 library happy
|
||||
@VariableMgr.VarAttr(name = SQL_AUTO_IS_NULL)
|
||||
|
||||
@ -1035,7 +1035,7 @@ public class ShowExecutor {
|
||||
}
|
||||
|
||||
if (table instanceof View) {
|
||||
rows.add(Lists.newArrayList(table.getName(), createTableStmt.get(0), "utf8", "utf8_general_ci"));
|
||||
rows.add(Lists.newArrayList(table.getName(), createTableStmt.get(0), "utf8mb4", "utf8mb4_0900_bin"));
|
||||
resultSet = new ShowResultSet(ShowCreateTableStmt.getViewMetaData(), rows);
|
||||
} else {
|
||||
if (showStmt.isView()) {
|
||||
@ -1661,10 +1661,10 @@ public class ShowExecutor {
|
||||
ShowCollationStmt showStmt = (ShowCollationStmt) stmt;
|
||||
List<List<String>> rows = Lists.newArrayList();
|
||||
List<String> row = Lists.newArrayList();
|
||||
// | utf8_general_ci | utf8 | 33 | Yes | Yes | 1 |
|
||||
row.add("utf8_general_ci");
|
||||
row.add("utf8");
|
||||
row.add("33");
|
||||
// | utf8mb4_0900_bin | utf8mb4 | 309 | Yes | Yes | 1 |
|
||||
row.add("utf8mb4_0900_bin");
|
||||
row.add("utf8mb4");
|
||||
row.add("309");
|
||||
row.add("Yes");
|
||||
row.add("Yes");
|
||||
row.add("1");
|
||||
|
||||
Reference in New Issue
Block a user