MySQL 认证 将MySQL库换成Ocenbase后报错
What happened?
Ocenbase兼容MySQL驱动,EMQX采用MySQL认证底层数据库换成Ocenbase后报错如下:
{emqx_auth_mysql,{bad_return,{{emqx_auth_mysql_app,start,[normal,[]]},{'EXIT',{{badmatch,{error,{shutdown,{failed_to_start_child,emqx_auth_mysql,{shutdown,{failed_to_start_child,worker_sup,{shutdown,{failed_to_start_child,{worker,1},{{badmatch,32},[{mysql_protocol,handshake_finish_or_switch_auth,5,[{file,"mysql_protocol.erl"},{line,114}]},{mysql_conn,handshake,1,[{file,"mysql_conn.erl"},{line,202}]},{mysql_conn,'-connect/1-fun-0-',2,[{file,"mysql_conn.erl"},{line,137}]}]}}}}}}}}},[{emqx_auth_mysql_app,start,2,[{file,"emqx_auth_mysql_app.erl"},{line,38}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,293}]}]}}}}}
What did you expect to happen?
能够支持Ocenbase数据库。
How can we reproduce it (as minimally and precisely as possible)?
MySQL 认证 将MySQL库换成Ocenbase。
Anything else we need to know?
No response
EMQX version
$ ./bin/emqx_ctl broker
# paste output here
OS version
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
Log files
we need someone with the mysql protocol level knowledge to help supporting ocenbase in the mysql lib https://github.com/emqx/mysql-otp
@zmstone I am also using Ocenbase and found that the server status returned by MySQL is different.Ocenbase server status is '0x0022',MySQL server status is '0x0002',Will this server status have any impact?
Server status code 0x0022 seems to be the 'OR' result of 0x0020 and 0x0002
-
0x0020: means no index was used in the query, i am unsure why connect or authentication should result in this flag being set. -
0x0002: is the flag intentionally ignored by mysql client implementation
I suppose we can ignore the 0x0020 flag as well, but I have no idea when we'll be able to work on this because we have a lot of work from paying customers.
I have made modifications to the source code of version 4.4.19, and the git address is https://github.com/changdong123/emqx.git.
You need to modify the MySQL driver address in rebar.config in the emqx source code
@songeddy could you help to send a pull-request to https://github.com/emqx/mysql-otp
EMQX 4.4 has reached EOL though, if you help to enhance mysql-otp, we will be able to upgrade it in version 5.
Hi @changdong123,I think add new server_status SERVER_STATUS_NO_INDEX_USED_AUTOCOMMIT is wrong method, although it should still work fine. A new status code should not be added (the mysql official documentation does not have 0x0022).
SERVER_STATUS_NO_INDEX_USED_AUTOCOMMIT is 0x0020, not 0x0022
This status bit will be allowed by EMQX 5.8.6, closing this issue.
https://github.com/emqx/mysql-otp/pull/16