MySQL++

Check-in [5767708cd6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Modified the ifdefs for four libmysqlclient options that were removed from MySQL 8.0.1 but have not yet been removed in MariaDB. The end user effect is that setting the connection options that no longer exist cause a run-time API error if you are not running a version of libmysqlclient that understands these options.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:5767708cd62fc3a7c4fba61264b7e064138e19db74ab04d5fb369351932b7031
User & Date: tangent 2018-07-12 16:53:47
References
2018-07-12
17:01 Ticket [5e73e7ddd8] install error status still Open with 7 other changes artifact: c141a761af user: tangent
Context
2018-07-12
17:25
Removed two configuration lines from lib/Doxyfile.in that cause newer versions of doxygen to refuse to process the file. We were using the defaults for these, so this won't hurt backwards compatibility. check-in: 158fed1f2c user: tangent tags: trunk
16:53
Modified the ifdefs for four libmysqlclient options that were removed from MySQL 8.0.1 but have not yet been removed in MariaDB. The end user effect is that setting the connection options that no longer exist cause a run-time API error if you are not running a version of libmysqlclient that understands these options. check-in: 5767708cd6 user: tangent tags: trunk
2018-05-02
14:34
Removed "register" qualifiers from all variable declarations. It's deprecated in C++11 and C++14 and is now illegal in C++17. Closes [648dafd5ed]. check-in: 78fc2ae13b user: tangent tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/options.cpp.

1
2
3
4
5
6
7
8
9
10
11
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
...
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
...
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
/***********************************************************************
 options.cpp - Implements the Option class hierarchy.

 Copyright (c) 2007-2009 by Educational Technology Resources, Inc.
 Others may also hold copyrights on code in this file.  See the
 CREDITS file in the top directory of the distribution for details.

 This file is part of MySQL++.

 MySQL++ is free software; you can redistribute it and/or modify it
 under the terms of the GNU Lesser General Public License as published
................................................................................
				Option::err_NONE : Option::err_api_reject;
}


Option::Error
GuessConnectionOption::set(DBDriver* dbd)
{
#if MYSQL_VERSION_ID >= 40101
	return dbd->connected() ? Option::err_connected :
			dbd->set_option(MYSQL_OPT_GUESS_CONNECTION) ?
				Option::err_NONE : Option::err_api_reject;
#else
	return Option::err_api_limit;
#endif
}
................................................................................
				Option::err_NONE : Option::err_api_reject;
}


Option::Error
SetClientIpOption::set(DBDriver* dbd)
{
#if MYSQL_VERSION_ID >= 40101
	return dbd->connected() ? Option::err_connected :
			dbd->set_option(MYSQL_SET_CLIENT_IP, arg_.c_str()) ?
				Option::err_NONE : Option::err_api_reject;
#else
	return Option::err_api_limit;
#endif
}
................................................................................
#endif
}


Option::Error
UseEmbeddedConnectionOption::set(DBDriver* dbd)
{
#if MYSQL_VERSION_ID >= 40101
	return dbd->connected() ? Option::err_connected :
			dbd->set_option(MYSQL_OPT_USE_EMBEDDED_CONNECTION) ?
				Option::err_NONE : Option::err_api_reject;
#else
	return Option::err_api_limit;
#endif
}


Option::Error
UseRemoteConnectionOption::set(DBDriver* dbd)
{
#if MYSQL_VERSION_ID >= 40101
	return dbd->connected() ? Option::err_connected :
			dbd->set_option(MYSQL_OPT_USE_REMOTE_CONNECTION) ?
				Option::err_NONE : Option::err_api_reject;
#else
	return Option::err_api_limit;
#endif
}



|







 







|







 







|







 







|












|







1
2
3
4
5
6
7
8
9
10
11
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
...
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
...
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
/***********************************************************************
 options.cpp - Implements the Option class hierarchy.

 Copyright © 2007-2009, 2018 by Educational Technology Resources, Inc.
 Others may also hold copyrights on code in this file.  See the
 CREDITS file in the top directory of the distribution for details.

 This file is part of MySQL++.

 MySQL++ is free software; you can redistribute it and/or modify it
 under the terms of the GNU Lesser General Public License as published
................................................................................
				Option::err_NONE : Option::err_api_reject;
}


Option::Error
GuessConnectionOption::set(DBDriver* dbd)
{
#if (MYSQL_VERSION_ID >= 40101 && MYSQL_VERSION_ID <= 80100) || defined(MARIADB_BASE_VERSION)
	return dbd->connected() ? Option::err_connected :
			dbd->set_option(MYSQL_OPT_GUESS_CONNECTION) ?
				Option::err_NONE : Option::err_api_reject;
#else
	return Option::err_api_limit;
#endif
}
................................................................................
				Option::err_NONE : Option::err_api_reject;
}


Option::Error
SetClientIpOption::set(DBDriver* dbd)
{
#if (MYSQL_VERSION_ID >= 40101 && MYSQL_VERSION_ID <= 80100) || defined(MARIADB_BASE_VERSION)
	return dbd->connected() ? Option::err_connected :
			dbd->set_option(MYSQL_SET_CLIENT_IP, arg_.c_str()) ?
				Option::err_NONE : Option::err_api_reject;
#else
	return Option::err_api_limit;
#endif
}
................................................................................
#endif
}


Option::Error
UseEmbeddedConnectionOption::set(DBDriver* dbd)
{
#if (MYSQL_VERSION_ID >= 40101 && MYSQL_VERSION_ID <= 80100) || defined(MARIADB_BASE_VERSION)
	return dbd->connected() ? Option::err_connected :
			dbd->set_option(MYSQL_OPT_USE_EMBEDDED_CONNECTION) ?
				Option::err_NONE : Option::err_api_reject;
#else
	return Option::err_api_limit;
#endif
}


Option::Error
UseRemoteConnectionOption::set(DBDriver* dbd)
{
#if (MYSQL_VERSION_ID >= 40101 && MYSQL_VERSION_ID <= 80100) || defined(MARIADB_BASE_VERSION)
	return dbd->connected() ? Option::err_connected :
			dbd->set_option(MYSQL_OPT_USE_REMOTE_CONNECTION) ?
				Option::err_NONE : Option::err_api_reject;
#else
	return Option::err_api_limit;
#endif
}