anse1/sqlsmith

MariaDB Support!

mariadb-RoelVandePaar opened this issue · 6 comments

Hi SQLSmith Team! Roel here (principal test engineer at MariaDB). Great program you have here. Would you be so kind as to a connector to MariaDB? Thank you & God bless

Ref https://mariadb.com/kb/en/mysql_query/

anse1 commented
anse1 commented
anse1 commented

Updates:

  1. It was decided not to proceed with a consultancy setup.
  2. I pulled the mysql branch and tested it. Changed the connection to local parameters including using socket (faster!) and recompiled. In the example below, /test/socket.sock is a symlink which can easily be pointed at other instances to test.
~/sqlsmith$ git diff
diff --git a/mysql.cc b/mysql.cc
index 138218c..781ff2e 100644
--- a/mysql.cc
+++ b/mysql.cc
@@ -13,8 +13,8 @@ mysql_connection::mysql_connection(const std::string &conninfo)
 {
   (void) conninfo;
   con = mysql_init(NULL);
-  if (!mysql_real_connect(con, "localhost", "smith", "smith", 
-                         "smith" /*dbname*/, 0, NULL, 0)) {
+  if (!mysql_real_connect(con, "localhost", "root", "",
+                         "test" /*dbname*/, 0, "/test/socket.sock", 0)) {
     throw runtime_error(mysql_error(con));
   }
 }
  1. Ran various tests. It generally generates many long and interesting queries and provided verbose output. Logging statements to a file was also possible.

I would propose, as further steps, to do this:

  1. Introduce variables in mysql.cc instead of hardcoded items so a real --mysql="host='x';port=x;socket='x';user='x';password='x';db='x'" or similar connect string can be used.
  2. merge the mysql branch into master/trunk. The branch will have to pull the current master/trunk first (there are merge conflicts).
  3. Even if there are still some shortcomings, it already works and is usable as-is (release early/release often). This will also make it easier to submit further patches and can widen the use of the product.

Could you kindly have a look at this Andreas (@anse1)? Thank you!