Closed water5-cmd closed 2 years ago
I changed CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci
to CHARACTER SET = utf8 COLLATE = utf8_general_ci
, the garbled problem solved.
So, does EdgelessDB support utf8mb4?
Hi, We can reproduce the issue and will investigate.
Turns out this isn't a bug. It can be changed using set global
:
set global character_set_client = 'utf8mb4';
set global character_set_connection = 'utf8mb4';
set global character_set_server = 'utf8mb4';
set global character_set_results = 'utf8mb4';
set global character_set_database = 'utf8mb4';
quit
Then reconnect and it should work.
However, we changed the default charset of EdgelessDB to utf8mb4 in the current master branch. This seems to be more reasonable.
Starting with v0.3.0, the default charset is utf8mb4.
Hi, @thomasten, I have been able to manipulate the edgelessdb inside the enclave, such as adding, deleting, and querying. Now I met a garble problem: query Chinese from edgelessdb database, printing will be garbled. For example: Insert one data to the
usertest
table ofmysql
databasesql statement:
Operating
usertest
with MySQL client under REE, reading and displaying data is normal.When operating
usertest
inside the enclave, the Chinese "你好小明" data will be garbled, the result of printname
usingfmt.Println
is likeFrom here, I know in MariaDB, the default character set is latin1, and the default collation is latin1_swedish_ci. Here is the information in edgelessdb.
But I want to use
utf8mb4
orutf8mb4
, so I changed the configuration, like thisBut the result of printing Chinese characters is still garbled. What should I do to solve the problem of printing messy Chinese characters? About modifying the
latin1
toutf8mb4
of edgelessdb, I addset character_set_database = 'utf8mb4';
inmanifest.json
or inmariadbbootstrap.go
are useless, only under REE using MySQL client can modify thelatin1
toutf8mb4
, is it possible to change these configurations in the code?