mirror of
https://github.com/mariadb-corporation/mariadb-connector-python.git
synced 2025-08-15 23:42:40 +00:00
Windows fixes:
- fixed build (malloc.h needs to be included for alloca) - fixed failing test (using lowercase db name)
This commit is contained in:
@ -27,7 +27,6 @@
|
||||
#include <errmsg.h>
|
||||
#include <mysqld_error.h>
|
||||
#include <time.h>
|
||||
//#include <malloc.h>
|
||||
#include <docs/common.h>
|
||||
|
||||
|
||||
@ -39,6 +38,7 @@ typedef CRITICAL_SECTION pthread_mutex_t;
|
||||
#define pthread_mutex_unlock(A) LeaveCriticalSection(A)
|
||||
#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
|
||||
#define pthread_self() GetCurrentThreadId()
|
||||
#include <malloc.h>
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#endif /* defined(_WIN32) */
|
||||
|
@ -30,11 +30,11 @@ class TestException(unittest.TestCase):
|
||||
|
||||
def test_db_unknown_exception(self):
|
||||
try:
|
||||
create_connection({"database": "Unknown"})
|
||||
create_connection({"database": "unknown"})
|
||||
except mariadb.ProgrammingError as err:
|
||||
self.assertEqual(err.sqlstate, "42000")
|
||||
self.assertEqual(err.errno, 1049)
|
||||
self.assertTrue(err.errmsg.find("Unknown database 'Unknown'") > -1)
|
||||
self.assertTrue(err.errmsg.find("Unknown database 'unknown'") > -1)
|
||||
pass
|
||||
|
||||
def test_conn_timeout_exception(self):
|
||||
|
Reference in New Issue
Block a user