MariaDB - unexpected message during auth

I am trying to add support for a MariaDB database to the Kong 0.13.1. I did the following steps:

  • I defined types in a conf_loader.lua for parameters regarding the MariaDB;
  • I added the maria entry to the DATABASE table in a constans.lua;
  • I added the maria entry to the STRATEGIES table in an init.lua;
  • I added the maria defaults to the kong_defaults.lua;
  • I created the kong/db/strategies/maria/init.lua and kong/db/strategies/maria/connector.lua files based on postgres files. I have just copied and pasted postgres files without any changes so far;
  • I added refs to above files to a kong-0.13.1-0.rockspec file.
  • I created an user and a database in the MariaDB.
  • I exported required envs.

I have put the above changes in the following LINK.

When I run a kong migrations up command I receive the following error:

2018/06/25 07:24:09 [verbose] Kong: 0.13.1
2018/06/25 07:24:09 [verbose] no config file found at /etc/kong/kong.conf
2018/06/25 07:24:09 [verbose] no config file found at /etc/kong.conf
2018/06/25 07:24:09 [verbose] no config file, skipping loading
2018/06/25 07:24:09 [verbose] prefix in use: /usr/local/kong
2018/06/25 07:24:09 [verbose] running datastore migrations
Error: 
/usr/local/share/lua/5.1/pgmoon/init.lua:245: unexpected message during auth: n
stack traceback:
	[C]: in function 'error'
	/usr/local/share/lua/5.1/pgmoon/init.lua:245: in function 'auth'
	/usr/local/share/lua/5.1/pgmoon/init.lua:211: in function 'connect'
	./kong/dao/db/maria.lua:348: in function 'query'
	./kong/dao/db/maria.lua:579: in function 'current_migrations'
	./kong/dao/factory.lua:288: in function 'current_migrations'
	./kong/dao/factory.lua:434: in function 'run_migrations'
	./kong/cmd/migrations.lua:34: in function 'cmd_exec'
	./kong/cmd/init.lua:87: in function <./kong/cmd/init.lua:87>
	[C]: in function 'xpcall'
	./kong/cmd/init.lua:87: in function <./kong/cmd/init.lua:44>
	/opt/kong/bin/kong:7: in function 'file_gen'
	init_worker_by_lua:46: in function <init_worker_by_lua:44>
	[C]: in function 'xpcall'
	init_worker_by_lua:53: in function <init_worker_by_lua:51>

BTW: I am not sure if it is important info, but I have also captured network traffic by means of tcpdump. There is the 3-way handshake between the Kong and the MariaDB in the network traffic. Then the Kong sends the parameters regarding MariaDB (user and database) in its package to the Maria. There is the mysql_native_password text in the Maria’s package as a response. At the end Maria sends the Got.packets.out.of.order text in its package to the Kong.

The question is: Do you have any idea how to fix that?