Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MariaDB Support! #37

Open
mariadb-RoelVandePaar opened this issue Mar 27, 2021 · 6 comments
Open

MariaDB Support! #37

mariadb-RoelVandePaar opened this issue Mar 27, 2021 · 6 comments

Comments

@mariadb-RoelVandePaar
Copy link

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
Copy link
Owner

anse1 commented Mar 30, 2021 via email

@mariadb-RoelVandePaar
Copy link
Author

mariadb-RoelVandePaar commented Apr 14, 2021 via email

@anse1
Copy link
Owner

anse1 commented Apr 16, 2021 via email

@anse1
Copy link
Owner

anse1 commented Apr 16, 2021 via email

@mariadb-RoelVandePaar
Copy link
Author

mariadb-RoelVandePaar commented Apr 22, 2021 via email

@RoelVdP
Copy link

RoelVdP commented Jan 31, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants