mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-12-01 08:07:08 +01:00
Add MariaDB Connector/C as a built-in alternative (v3.2.3).
This commit is contained in:
1 parent
f192767853
commit
b4bf96ce4b
372 files changed
+90819
-11
No files matched your search
+53
@@ -0,0 +1,53 @@
|
||||
#include "my_test.h"
|
||||
|
||||
#define MAX_COUNT 2000
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
MYSQL *mysql;
|
||||
int i;
|
||||
|
||||
if (argc > 1)
|
||||
get_options(argc, argv);
|
||||
|
||||
get_envvars();
|
||||
|
||||
if (IS_SKYSQL(hostname))
|
||||
return 0;
|
||||
|
||||
diag("hostname: %s", hostname);
|
||||
|
||||
for (i = 0; i < MAX_COUNT; ++i) {
|
||||
|
||||
if (mysql_library_init(-1, NULL, NULL) != 0) {
|
||||
diag("mysql_library_init failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
mysql = mysql_init(NULL);
|
||||
if (!mysql) {
|
||||
diag("mysql_init failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (force_tls)
|
||||
mysql_options(mysql, MYSQL_OPT_SSL_ENFORCE, &force_tls);
|
||||
|
||||
if (!mysql_real_connect(mysql, hostname, username, password, schema, port, socketname, 0)) {
|
||||
diag("mysql_real_connect failed: %s", mysql_error(mysql));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mysql_query(mysql, "SELECT NULL LIMIT 0") != 0) {
|
||||
diag("mysql_query failed: %s", mysql_error(mysql));
|
||||
return 1;
|
||||
}
|
||||
|
||||
mysql_close(mysql);
|
||||
mysql_library_end();
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user