Changeset View
Changeset View
Standalone View
Standalone View
src/drivers/mysql/MysqlDriver.cpp
Show All 15 Lines | 1 | /* This file is part of the KDE project | |||
---|---|---|---|---|---|
16 | 16 | | |||
17 | You should have received a copy of the GNU Library General Public License | 17 | You should have received a copy of the GNU Library General Public License | ||
18 | along with this program; see the file COPYING. If not, write to | 18 | along with this program; see the file COPYING. If not, write to | ||
19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
20 | * Boston, MA 02110-1301, USA. | 20 | * Boston, MA 02110-1301, USA. | ||
21 | */ | 21 | */ | ||
22 | 22 | | |||
23 | #include "MysqlDriver.h" | 23 | #include "MysqlDriver.h" | ||
24 | #include "MysqlConnection.h" | | |||
25 | #include "KDbDriverBehavior.h" | 24 | #include "KDbDriverBehavior.h" | ||
26 | #include "KDbExpression.h" | 25 | #include "KDbExpression.h" | ||
27 | #include "KDbField.h" | 26 | #include "KDbPreparedStatement.h" | ||
28 | #include "KDb.h" | 27 | #include "MysqlConnection.h" | ||
29 | 28 | | |||
30 | #include <KPluginFactory> | 29 | #include <KPluginFactory> | ||
31 | 30 | | |||
32 | #include <mysql.h> | 31 | #include <mysql.h> | ||
33 | 32 | | |||
34 | KDB_DRIVER_PLUGIN_FACTORY(MysqlDriver, "kdb_mysqldriver.json") | 33 | KDB_DRIVER_PLUGIN_FACTORY(MysqlDriver, "kdb_mysqldriver.json") | ||
35 | 34 | | |||
36 | /*! @todo Implement buffered/unbuffered cursor, rather than buffer everything. | 35 | /*! @todo Implement buffered/unbuffered cursor, rather than buffer everything. | ||
Show All 12 Lines | 43 | { | |||
49 | beh->ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE = true; | 48 | beh->ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE = true; | ||
50 | beh->_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY = false; | 49 | beh->_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY = false; | ||
51 | beh->USING_DATABASE_REQUIRED_TO_CONNECT = false; | 50 | beh->USING_DATABASE_REQUIRED_TO_CONNECT = false; | ||
52 | beh->OPENING_QUOTATION_MARK_BEGIN_FOR_IDENTIFIER = '`'; | 51 | beh->OPENING_QUOTATION_MARK_BEGIN_FOR_IDENTIFIER = '`'; | ||
53 | beh->CLOSING_QUOTATION_MARK_BEGIN_FOR_IDENTIFIER = '`'; | 52 | beh->CLOSING_QUOTATION_MARK_BEGIN_FOR_IDENTIFIER = '`'; | ||
54 | //! @todo add configuration option | 53 | //! @todo add configuration option | ||
55 | beh->TEXT_TYPE_MAX_LENGTH = 255; | 54 | beh->TEXT_TYPE_MAX_LENGTH = 255; | ||
56 | beh->RANDOM_FUNCTION = QLatin1String("RAND"); | 55 | beh->RANDOM_FUNCTION = QLatin1String("RAND"); | ||
56 | beh->GET_TABLE_NAMES_SQL = KDbEscapedString("SHOW TABLES"); | ||||
57 | | ||||
57 | initDriverSpecificKeywords(keywords); | 58 | initDriverSpecificKeywords(keywords); | ||
58 | 59 | | |||
59 | //predefined properties | 60 | //predefined properties | ||
60 | #if MYSQL_VERSION_ID < 40000 | 61 | #if MYSQL_VERSION_ID < 40000 | ||
61 | beh->properties["client_library_version"] = MYSQL_SERVER_VERSION; //nothing better | 62 | beh->properties["client_library_version"] = MYSQL_SERVER_VERSION; //nothing better | ||
62 | beh->properties["default_server_encoding"] = MYSQL_CHARSET; //nothing better | 63 | beh->properties["default_server_encoding"] = MYSQL_CHARSET; //nothing better | ||
63 | #else | 64 | #else | ||
64 | // https://dev.mysql.com/doc/refman/5.7/en/mysql-get-client-version.html | 65 | // https://dev.mysql.com/doc/refman/5.7/en/mysql-get-client-version.html | ||
▲ Show 20 Lines • Show All 193 Lines • Show Last 20 Lines |