comparison Framework/MySQL/MySQLDatabase.cpp @ 187:0b78198c28d6

compatibility with mysql client 8.x
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 16 Dec 2020 15:41:06 +0100
parents 6fe74f9a516e
children 3236894320d6
comparison
equal deleted inserted replaced
186:6fe74f9a516e 187:0b78198c28d6
143 143
144 if (parameters_.IsSsl()) 144 if (parameters_.IsSsl())
145 { 145 {
146 if (parameters_.IsVerifyServerCertificates()) 146 if (parameters_.IsVerifyServerCertificates())
147 { 147 {
148 #if (MYSQL_VERSION_ID > 50110 && MYSQL_VERSION_ID < 80000) // Removed in MySQL client 8.0
148 my_bool verifyCert = 1; 149 my_bool verifyCert = 1;
149 mysql_options(mysql_, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (void *) &verifyCert); 150 mysql_options(mysql_, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (void *) &verifyCert);
151 #endif
152
150 mysql_options(mysql_, MYSQL_OPT_SSL_CA, (void *)(parameters_.GetSslCaCertificates())); 153 mysql_options(mysql_, MYSQL_OPT_SSL_CA, (void *)(parameters_.GetSslCaCertificates()));
151 } 154 }
152 155
156 #if (MYSQL_VERSION_ID > 50110 && MYSQL_VERSION_ID < 80000) // Removed in MySQL client 8.0
153 my_bool enforceTls = 1; 157 my_bool enforceTls = 1;
154 mysql_options(mysql_, MYSQL_OPT_SSL_ENFORCE, (void *) &enforceTls); 158 mysql_options(mysql_, MYSQL_OPT_SSL_ENFORCE, (void *) &enforceTls);
159 #endif
155 } 160 }
156 161
157 const char* socket = (parameters_.GetUnixSocket().empty() ? NULL : 162 const char* socket = (parameters_.GetUnixSocket().empty() ? NULL :
158 parameters_.GetUnixSocket().c_str()); 163 parameters_.GetUnixSocket().c_str());
159 164