MySQL++

Check-in [b238cd34c2]
Login

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

Overview
Comment:DBDriver::shutdown() now executes a SHUTDOWN query on MySQL 8.0.0 and higher due to removal of the C API function mysql_shutdown() in that release. They put it back in 8.0.1, but only due to end-user complaints, and they say it'll go away for good eventually, so we prefer to deploy and test this workaround before then.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b238cd34c2e426b4e5a24e0c305f2457c8acf386895e9f1f89d42b668ff1015b
User & Date: tangent 2018-07-18 21:01:54
Context
2018-07-26
07:13
Removed Wishlist file: a subset of its contents is now in the Fossil wiki and ticket trackers. Dropped items are those we probably will never get to. If they come up again, they can be added as tickets. check-in: dd35735f4f user: tangent tags: trunk
2018-07-18
21:01
DBDriver::shutdown() now executes a SHUTDOWN query on MySQL 8.0.0 and higher due to removal of the C API function mysql_shutdown() in that release. They put it back in 8.0.1, but only due to end-user complaints, and they say it'll go away for good eventually, so we prefer to deploy and test this workaround before then. check-in: b238cd34c2 user: tangent tags: trunk
2018-07-12
20:05
Conditionally using std::unique_ptr instead of auto_ptr on C++11 and newer versions of g++ and clang++ to avoid the warning about using a deprecated feature. Closes [97f62ef016]. check-in: 08496d4b48 user: tangent tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/dbdriver.cpp.

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

#include "exceptions.h"

#include <cstring>
#include <memory>
#include <sstream>

// An argument was added to mysql_shutdown() in MySQL 4.1.3 and 5.0.1.
#if ((MYSQL_VERSION_ID >= 40103) && (MYSQL_VERSION_ID <= 49999)) || (MYSQL_VERSION_ID >= 50001)
#	define SHUTDOWN_ARG ,SHUTDOWN_DEFAULT
#else
#	define SHUTDOWN_ARG
#endif

using namespace std;

namespace mysqlpp {

DBDriver::DBDriver() :
is_connected_(false)
{







<
<
<
<
<
<
<







28
29
30
31
32
33
34







35
36
37
38
39
40
41

#include "exceptions.h"

#include <cstring>
#include <memory>
#include <sstream>








using namespace std;

namespace mysqlpp {

DBDriver::DBDriver() :
is_connected_(false)
{
335
336
337
338
339
340
341











342

343
344
345
346
347
348
349
}


bool
DBDriver::shutdown()
{
	error_message_.clear();











	return mysql_shutdown(&mysql_ SHUTDOWN_ARG);

}


bool
DBDriver::thread_aware()
{
#if defined(MYSQLPP_PLATFORM_WINDOWS) || defined(HAVE_PTHREAD) || defined(HAVE_SYNCH_H)







>
>
>
>
>
>
>
>
>
>
>
|
>







328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
}


bool
DBDriver::shutdown()
{
	error_message_.clear();
#if (MYSQL_VERSION_ID >= 80000)
    // The C API function we were depending on is removed in 8.0.0.  It
    // was replaced in 8.0.1, but they claim they're going to remove it
    // again later, so we prefer to behave as if it's gone for good as
    // of 8.0.0, so we've got a well-tested workaround before then.
    return connected() ? execute("SHUTDOWN", 8) : false;
#elif ((MYSQL_VERSION_ID >= 40103) && (MYSQL_VERSION_ID <= 49999)) || (MYSQL_VERSION_ID >= 50001)
    // An argument was added to mysql_shutdown() in MySQL 4.1.3 and 5.0.1.
	return mysql_shutdown(&mysql_, SHUTDOWN_DEFAULT);
#else
    // Prior versions had no argument
	return mysql_shutdown(&mysql_);
#endif
}


bool
DBDriver::thread_aware()
{
#if defined(MYSQLPP_PLATFORM_WINDOWS) || defined(HAVE_PTHREAD) || defined(HAVE_SYNCH_H)