You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
CONC-282:
Connector/C now provides additional information for package version mariadb_config --cc_version lists the package version Beside MARIADB_PACKAGE_VERSION numeric representation MARIADB_PACKAGE_VERSION_ID can be used now within preprocessor directives
This commit is contained in:
@@ -39,6 +39,9 @@ SET(CPACK_PACKAGE_VERSION_MAJOR 3)
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR 0)
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH 2)
|
||||
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
MATH(EXPR MARIADB_PACKAGE_VERSION_ID "${CPACK_PACKAGE_VERSION_MAJOR} * 10000 +
|
||||
${CPACK_PACKAGE_VERSION_MINOR} * 100 +
|
||||
${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
|
||||
MACRO(ADD_OPTION _name _text _default)
|
||||
IF(NOT DEFINED ${_name})
|
||||
@@ -165,6 +168,7 @@ IF(GIT_EXECUTABLE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
SET(PROTOCOL_VERSION 10) # we adapted new password option from PHP's mysqlnd !
|
||||
|
||||
# if C/C is build as subproject inside MariaDB server tree we will
|
||||
# use the version defined by server
|
||||
IF(MAJOR_VERSION)
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#define MYSQL_CONFIG_NAME "my"
|
||||
|
||||
#define MARIADB_PACKAGE_VERSION "@CPACK_PACKAGE_VERSION@"
|
||||
#define MARIADB_PACKAGE_VERSION_ID @MARIADB_PACKAGE_VERSION_ID@
|
||||
#define MARIADB_SYSTEM_TYPE "@CMAKE_SYSTEM_NAME@"
|
||||
#define MARIADB_MACHINE_TYPE "@CMAKE_SYSTEM_PROCESSOR@"
|
||||
#define MARIADB_PLUGINDIR "@PLUGINDIR@"
|
||||
|
@@ -11,6 +11,7 @@ static char *mariadb_progname;
|
||||
#define LIBS_SYS "@extra_dynamic_LDFLAGS@"
|
||||
#define CFLAGS INCLUDE
|
||||
#define VERSION "@MARIADB_CLIENT_VERSION@"
|
||||
#define CC_VERSION "@CPACK_PACKAGE_VERSION@"
|
||||
#define PLUGIN_DIR "@CMAKE_INSTALL_PREFIX@/@INSTALL_PLUGINDIR@"
|
||||
#define SOCKET "@MARIADB_UNIX_ADDR@"
|
||||
#define PORT "@MARIADB_PORT@"
|
||||
@@ -23,12 +24,13 @@ static struct option long_options[]=
|
||||
{"include", no_argument, 0, 'c'},
|
||||
{"libs", no_argument, 0, 'd'},
|
||||
{"libs_r", no_argument, 0, 'e'},
|
||||
{"libs_sys", no_argument, 0, 'y'},
|
||||
{"libs_sys", no_argument, 0, 'l'},
|
||||
{"version", no_argument, 0, 'f'},
|
||||
{"socket", no_argument, 0, 'g'},
|
||||
{"port", no_argument, 0, 'h'},
|
||||
{"plugindir", no_argument, 0, 'p'},
|
||||
{"tlsinfo", no_argument, 0, 't'},
|
||||
{"cc_version", no_argument, 0, 'g'},
|
||||
{"socket", no_argument, 0, 'h'},
|
||||
{"port", no_argument, 0, 'i'},
|
||||
{"plugindir", no_argument, 0, 'j'},
|
||||
{"tlsinfo", no_argument, 0, 'k'},
|
||||
{NULL, 0, 0, 0}
|
||||
};
|
||||
|
||||
@@ -41,6 +43,7 @@ static const char *values[]=
|
||||
LIBS,
|
||||
LIBS_SYS,
|
||||
VERSION,
|
||||
CC_VERSION,
|
||||
SOCKET,
|
||||
PORT,
|
||||
PLUGIN_DIR,
|
||||
@@ -76,7 +79,7 @@ int main(int argc, char **argv)
|
||||
while(1)
|
||||
{
|
||||
int option_index= 0;
|
||||
c= getopt_long(argc, argv, "abcdef", long_options, &option_index);
|
||||
c= getopt_long(argc, argv, "abcdefghij", long_options, &option_index);
|
||||
|
||||
switch(c) {
|
||||
case 'a':
|
||||
@@ -96,18 +99,21 @@ int main(int argc, char **argv)
|
||||
puts(VERSION);
|
||||
break;
|
||||
case 'g':
|
||||
puts(SOCKET);
|
||||
puts(CC_VERSION);
|
||||
break;
|
||||
case 'h':
|
||||
puts(SOCKET);
|
||||
break;
|
||||
case 'i':
|
||||
puts(PORT);
|
||||
break;
|
||||
case 'p':
|
||||
case 'j':
|
||||
puts(PLUGIN_DIR);
|
||||
break;
|
||||
case 't':
|
||||
case 'k':
|
||||
puts(TLS_LIBRARY_VERSION);
|
||||
break;
|
||||
case 'y':
|
||||
case 'l':
|
||||
puts(LIBS_SYS);
|
||||
break;
|
||||
default:
|
||||
|
@@ -924,7 +924,7 @@ static int test_fetch_double(MYSQL *mysql)
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int test_conc282(MYSQL *mysql)
|
||||
static int test_conc281(MYSQL *mysql)
|
||||
{
|
||||
int rc;
|
||||
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
|
||||
@@ -973,7 +973,7 @@ static int test_conc282(MYSQL *mysql)
|
||||
}
|
||||
|
||||
struct my_tests_st my_tests[] = {
|
||||
{"test_conc282", test_conc282, 1, 0, NULL, NULL},
|
||||
{"test_conc281", test_conc281, 1, 0, NULL, NULL},
|
||||
{"test_fetch_seek", test_fetch_seek, 1, 0, NULL , NULL},
|
||||
{"test_fetch_offset", test_fetch_offset, 1, 0, NULL , NULL},
|
||||
{"test_fetch_column", test_fetch_column, 1, 0, NULL , NULL},
|
||||
|
Reference in New Issue
Block a user