From 586de7fa643d7acb80ac853fb5003995602d5dd2 Mon Sep 17 00:00:00 2001 From: silverqx Date: Thu, 17 Oct 2024 17:49:36 +0200 Subject: [PATCH] upgraded to MySQL v9.1 - workflows, tools, docs, qmake, ... --- .env.win32.example | 2 +- .github/workflows/msvc2022-qt6-drivers.yml | 2 +- .github/workflows/msys2-ucrt64-drivers.yml | 2 +- .github/workflows/vcpkg-windows-drivers.yml | 2 +- NOTES.txt | 18 +++++++++--------- README.md | 2 +- conf.pri.example | 14 +++++++------- docs/building/tinyorm.mdx | 6 +++--- docs/database/getting-started.mdx | 6 +++--- docs/database/query-builder.mdx | 2 +- docs/dependencies.mdx | 2 +- docs/tinydrivers/getting-started.mdx | 10 +++++----- docs/tinyorm/getting-started.mdx | 2 +- drivers/common/src/orm/drivers/sqlfield.cpp | 2 +- .../include/orm/drivers/mysql/mysqldriver.hpp | 2 +- include/orm/databaseconnection.hpp | 2 +- include/orm/schema/columndefinition.hpp | 2 +- qmake/features/private/tiny_find_packages.prf | 2 +- src/orm/schema/blueprint.cpp | 2 +- src/orm/schema/grammars/mysqlschemagrammar.cpp | 2 +- .../schema/grammars/postgresschemagrammar.cpp | 2 +- .../schema/grammars/sqliteschemagrammar.cpp | 2 +- tools/qtbuild-qmysql-driver.ps1 | 2 +- 23 files changed, 45 insertions(+), 45 deletions(-) diff --git a/.env.win32.example b/.env.win32.example index cc93e330f..c8aa24a32 100644 --- a/.env.win32.example +++ b/.env.win32.example @@ -6,4 +6,4 @@ TINY_VCPKG_ROOT = $$quote(E:/xyz/vcpkg/) TINY_VCPKG_TRIPLET = x64-windows # MySQL C library (default installation path is auto-detected) -#TINY_MYSQL_ROOT = $$quote($$(ProgramFiles)/MySQL/MySQL Server 9.0/) +#TINY_MYSQL_ROOT = $$quote($$(ProgramFiles)/MySQL/MySQL Server 9.1/) diff --git a/.github/workflows/msvc2022-qt6-drivers.yml b/.github/workflows/msvc2022-qt6-drivers.yml index 02d6be01b..c9e925008 100644 --- a/.github/workflows/msvc2022-qt6-drivers.yml +++ b/.github/workflows/msvc2022-qt6-drivers.yml @@ -35,7 +35,7 @@ jobs: # Settings (constant variables) TINY_QT_VERSION: 6.7.2 TINY_QT_SPEC: win64_msvc2019_64 - TINY_MYSQL_SERVICE: MySQL90 + TINY_MYSQL_SERVICE: MySQL91 # My system is unresponsive with 10 TINY_PARALLEL: 8 diff --git a/.github/workflows/msys2-ucrt64-drivers.yml b/.github/workflows/msys2-ucrt64-drivers.yml index c94991971..a0fbeead6 100644 --- a/.github/workflows/msys2-ucrt64-drivers.yml +++ b/.github/workflows/msys2-ucrt64-drivers.yml @@ -38,7 +38,7 @@ jobs: # Don't user more than 3 for GCC, it would need 64GB RAM (no money 💵) TINY_PARALLEL_GCC: 3 TINY_PARALLEL_CLANG_OR_VCPKG: 9 - TINY_MYSQL_SERVICE: MySQL90 + TINY_MYSQL_SERVICE: MySQL91 # Used by the msys2.cmd script and cygpath.exe MSYS2_ROOT: C:\msys64 diff --git a/.github/workflows/vcpkg-windows-drivers.yml b/.github/workflows/vcpkg-windows-drivers.yml index 0385aa0e1..3aeb01034 100644 --- a/.github/workflows/vcpkg-windows-drivers.yml +++ b/.github/workflows/vcpkg-windows-drivers.yml @@ -23,7 +23,7 @@ jobs: env: # Settings (constant variables) - TINY_MYSQL_SERVICE: MySQL90 + TINY_MYSQL_SERVICE: MySQL91 TINY_PARALLEL: 10 # State variables diff --git a/NOTES.txt b/NOTES.txt index a138c0cf6..532a15e83 100644 --- a/NOTES.txt +++ b/NOTES.txt @@ -590,7 +590,7 @@ MySQL Timezone tables: mysql_config_editor print --all mysql --login-path=root -p mysql source timezone_posix.sql; -Restart-Service MySQL90 +Restart-Service MySQL91 Versions info: @@ -1290,7 +1290,7 @@ TinyDrivers output of operator<<()-s: Output of all TinyDrivers operator<<()-s SqlDatabase, SqlRecord, SqlField, DummySqlError -SqlDatabase(driver="QMYSQL", database="tinyorm_test_1", host="mysql.test", port=3306, user="szachara", open=true", options="SSL_CERT=C:/mysql/mysql_9.0/data/client-cert.pem;SSL_CA=C:/mysql/mysql_9.0/data/ca.pem;SSL_KEY=C:/mysql/mysql_9.0/data/client-key.pem") +SqlDatabase(driver="QMYSQL", database="tinyorm_test_1", host="mysql.test", port=3306, user="szachara", open=true", options="SSL_CERT=C:/mysql/mysql_9.1/data/client-cert.pem;SSL_CA=C:/mysql/mysql_9.1/data/ca.pem;SSL_KEY=C:/mysql/mysql_9.1/data/client-key.pem") -- SqlRecord(7) 0: SqlField(name: "id", type: qulonglong, value: "1", isNull: false, isValid: true, length: 20, precision: 0, required: true, sqlType: 8, sqlTypeName: BIGINT, autoIncrement: true, tableName: "users") @@ -3763,10 +3763,10 @@ MariaDB11 NT SERVICE\MariaDB11 mysqld.exe --install MariaDB11 --defaults-file="E:\mysql\mariadb_11\data\my.ini" -MySQL90 -"C:\Program Files\MySQL\MySQL Server 9.0\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 9.0\my.ini" MySQL90 -NT SERVICE\MySQL90 -mysqld.exe --install MySQL90 --defaults-file="C:\ProgramData\MySQL\MySQL Server 9.0\my.ini" +MySQL91 +"C:\Program Files\MySQL\MySQL Server 9.1\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 9.1\my.ini" MySQL91 +NT SERVICE\MySQL91 +mysqld.exe --install MySQL91 --defaults-file="C:\ProgramData\MySQL\MySQL Server 9.1\my.ini" postgresql-x64-16 "C:\Program Files\PostgreSQL\16\bin\pg_ctl.exe" runservice -N "postgresql-x64-16" -D "E:\postgres\16\data" -w @@ -3852,11 +3852,11 @@ MySQL option files syntax: - C API client library as well - [mysql] is applied for MySQL programs only - options in last sections override the previous one - - the best order is: [client], [mysqlXYZ], [mysqld], [mysqld-9.0] - - [mysqld-9.0] targets specific MySQL version + - the best order is: [client], [mysqlXYZ], [mysqld], [mysqld-9.1] + - [mysqld-9.1] targets specific MySQL version - the [DEFAULT] section can be used for own variables, if some variable value can't be resolved the this section is checked at first - - https://dev.mysql.com/doc/refman/9.0/en/option-files.html#option-file-syntax + - https://dev.mysql.com/doc/refman/9.1/en/option-files.html#option-file-syntax vcpkg CMake build command: diff --git a/README.md b/README.md index ae60417bb..17d136f61 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ The following list summarizes the main features of the `TinyDrivers` and `TinyMy - this is only true for our `TinyDrivers` library ❗ - all database drivers described in the [Database](https://www.tinyorm.org/database/getting-started#introduction) documentation are supported when linking against the [`QtSql`](https://doc.qt.io/qt/qtsql-index.html) module - both, normal and prepared statements are supported - - TLS/SSL connections using [`MYSQL_OPT_SSL_MODE`](https://dev.mysql.com/doc/c-api/9.0/en/mysql-options.html) (verify_ca, verify_identity) 🔥 + - TLS/SSL connections using [`MYSQL_OPT_SSL_MODE`](https://dev.mysql.com/doc/c-api/9.1/en/mysql-options.html) (verify_ca, verify_identity) 🔥 - setting many other MySQL connection options (see [`mysqldriver_p.cpp`](https://github.com/silverqx/TinyORM/blob/main/drivers/mysql/src/orm/drivers/mysql/mysqldriver_p.cpp)) - building and linking against the [`MariaDB Connector/C`](https://mariadb.com/kb/en/mariadb-connector-c/) 🕺 - transactions diff --git a/conf.pri.example b/conf.pri.example index c7fe59be3..1c8d72777 100644 --- a/conf.pri.example +++ b/conf.pri.example @@ -30,7 +30,7 @@ # environment variable. # - TINY_MYSQL_ROOT - Path to the MySQL installation folder. # If not defined, then it tries to guess the MySQL installation folder: -# $$(ProgramFiles)/MySQL/MySQL Server (9.0|8.4|8.3|8.2|8.1|8.0|5.7)/) +# $$(ProgramFiles)/MySQL/MySQL Server (9.1|9.0|8.4|8.3|8.2|8.1|8.0|5.7)/) # # You can set these variables in the .env (recommended) or conf.pri files, # in the .qmake.conf file (or wherever you want), or as environment variables. @@ -38,8 +38,8 @@ # These variables will be set after auto-configuration is done: # # - TINY_VCPKG_INCLUDE - Path to the vcpkg include folder (vcpkg/installed//include/). -# - TINY_MYSQL_INCLUDE - Path to the MySQL include folder (MySQL Server 9.0/include/). -# - TINY_MYSQL_LIB - Path to the MySQL lib folder (MySQL Server 9.0/lib/). +# - TINY_MYSQL_INCLUDE - Path to the MySQL include folder (MySQL Server 9.1/include/). +# - TINY_MYSQL_LIB - Path to the MySQL lib folder (MySQL Server 9.1/lib/). # # The TINY_MYSQL_INCLUDE and TINY_MYSQL_LIB are only set on win32 platform except mingw. @@ -158,7 +158,7 @@ else:win32-msvc|win32-clang-msvc { # Explicitly specify the MySQL root installation path using the $$TINY_MYSQL_ROOT # !disable_autoconf { # # Used in the tiny_find_mysql() -# TINY_MYSQL_ROOT = $$quote($$(ProgramFiles)/MySQL/MySQL Server 9.0/) +# TINY_MYSQL_ROOT = $$quote($$(ProgramFiles)/MySQL/MySQL Server 9.1/) # return() # } @@ -172,12 +172,12 @@ else:win32-msvc|win32-clang-msvc { mysql_ping { # Find the MySQL C library and add it on system include path and library path tiny_find_mysql() -# tiny_find_mysql($$quote($$(ProgramFiles)/MySQL/MySQL Server 9.0/)) +# tiny_find_mysql($$quote($$(ProgramFiles)/MySQL/MySQL Server 9.1/)) # tiny_add_system_includepath(\ -# $$quote(C:/Program Files/MySQL/MySQL Server 9.0/include/)) +# $$quote(C:/Program Files/MySQL/MySQL Server 9.1/include/)) -# LIBS_PRIVATE += $$quote(-LC:/Program Files/MySQL/MySQL Server 9.0/lib/) +# LIBS_PRIVATE += $$quote(-LC:/Program Files/MySQL/MySQL Server 9.1/lib/) # LIBS_PRIVATE += -llibmysql } } diff --git a/docs/building/tinyorm.mdx b/docs/building/tinyorm.mdx index fac7b9f61..aa62dd2d3 100644 --- a/docs/building/tinyorm.mdx +++ b/docs/building/tinyorm.mdx @@ -1019,7 +1019,7 @@ These are `qmake` and `environment` variables that affect the `Aut | -------------------- | ----------- | | `TINY_VCPKG_ROOT` | Path to the `vcpkg` installation folder.
If not defined, then it tries to use the `VCPKG_ROOT` environment variable. | | `TINY_VCPKG_TRIPLET` | The `vcpkg` `triplet` to use (vcpkg/installed/$$TINY_VCPKG_TRIPLET/).
If not defined, then it tries to guess the `vcpkg` `triplet` based on the current compiler and OS (based on the `QMAKESPEC`), and as the last thing, it tries to use the `VCPKG_DEFAULT_TRIPLET` environment variable. | -| `TINY_MYSQL_ROOT` | Path to the `MySQL` installation folder.
If not defined, then it tries to guess the `MySQL` installation folder (`win32` only): $$(ProgramFiles)/MySQL/MySQL Server (9.0|8.4|8.3|8.2|8.1|8.0|5.7)/ | +| `TINY_MYSQL_ROOT` | Path to the `MySQL` installation folder.
If not defined, then it tries to guess the `MySQL` installation folder (`win32` only): $$(ProgramFiles)/MySQL/MySQL Server (9.1|9.0|8.4|8.3|8.2|8.1|8.0|5.7)/ | You can set these variables in the `.env` (recommended) or `conf.pri` files, in the `.qmake.conf` file (or wherever you want), or as environment variables. @@ -1028,8 +1028,8 @@ These variables will be set after `auto-configuration` is done: | Variable Name | Description | | -------------------- | ----------- | | `TINY_VCPKG_INCLUDE` | Path to the `vcpkg` `include` folder (vcpkg/installed/<triplet>/include/). | -| `TINY_MYSQL_INCLUDE` | Path to the `MySQL` `include` folder (MySQL Server 9.0/include/). | -| `TINY_MYSQL_LIB` | Path to the `MySQL` `lib` folder (MySQL Server 9.0/lib/). | +| `TINY_MYSQL_INCLUDE` | Path to the `MySQL` `include` folder (MySQL Server 9.1/include/). | +| `TINY_MYSQL_LIB` | Path to the `MySQL` `lib` folder (MySQL Server 9.1/lib/). | The `TINY_MYSQL_INCLUDE` and `TINY_MYSQL_LIB` are only set on `win32` platform except `mingw`. diff --git a/docs/database/getting-started.mdx b/docs/database/getting-started.mdx index adc2ad889..ad2bfdd52 100644 --- a/docs/database/getting-started.mdx +++ b/docs/database/getting-started.mdx @@ -364,7 +364,7 @@ The first argument is configuration hash which is of type `QVariantHash` and the You may also configure connection options by `options` key as `QVariantHash` or `QString`, you can pass any [connection options](https://doc.qt.io/qt/qsqldatabase.html#setConnectOptions) supported by `QSqlDatabase`. -You can also configure [Transaction Isolation Levels](https://dev.mysql.com/doc/refman/9.0/en/innodb-transaction-isolation-levels.html) for MySQL connection with the `isolation_level` configuration option. +You can also configure [Transaction Isolation Levels](https://dev.mysql.com/doc/refman/9.1/en/innodb-transaction-isolation-levels.html) for MySQL connection with the `isolation_level` configuration option. The `version` option is relevant only for the MySQL connections and you can save/avoid one database query (select version()) if you provide it manually. Based on this version will be decided which [session variables](https://github.com/silverqx/TinyORM/blob/main/src/orm/connectors/mysqlconnector.cpp#L182) will be set if strict mode is enabled and whether to use an [alias](https://github.com/silverqx/TinyORM/blob/main/src/orm/query/grammars/mysqlgrammar.cpp#L36) during the `upsert` method call. @@ -800,13 +800,13 @@ Since unprepared statements do not bind parameters, they may be vulnerable to SQ #### Implicit Commits -When using the `DB` facade's `statement` methods within transactions, you must be careful to avoid statements that cause [implicit commits](https://dev.mysql.com/doc/refman/9.0/en/implicit-commit.html). These statements will cause the database engine to indirectly commit the entire transaction, leaving TinyORM unaware of the database's transaction level. An example of such a statement is creating a database table: +When using the `DB` facade's `statement` methods within transactions, you must be careful to avoid statements that cause [implicit commits](https://dev.mysql.com/doc/refman/9.1/en/implicit-commit.html). These statements will cause the database engine to indirectly commit the entire transaction, leaving TinyORM unaware of the database's transaction level. An example of such a statement is creating a database table: ```cpp DB::statement("create table users (name varchar(255) null)"); ``` -Please refer to the MySQL manual for [a list of all statements](https://dev.mysql.com/doc/refman/9.0/en/implicit-commit.html) that trigger implicit commits. +Please refer to the MySQL manual for [a list of all statements](https://dev.mysql.com/doc/refman/9.1/en/implicit-commit.html) that trigger implicit commits. ### Using Multiple Database Connections diff --git a/docs/database/query-builder.mdx b/docs/database/query-builder.mdx index d9026ce4d..f9a4d34c9 100644 --- a/docs/database/query-builder.mdx +++ b/docs/database/query-builder.mdx @@ -1025,7 +1025,7 @@ All databases except SQL Server require the columns in the second argument of th ::: :::info -Row and column aliases will be used with the MySQL server >=8.0.19 instead of the VALUES() function as is described in the MySQL [documentation](https://dev.mysql.com/doc/refman/9.0/en/insert-on-duplicate.html). The MySQL server version is auto-detected and can be overridden in the [configuration](/database/getting-started.mdx#configuration). +Row and column aliases will be used with the MySQL server >=8.0.19 instead of the VALUES() function as is described in the MySQL [documentation](https://dev.mysql.com/doc/refman/9.1/en/insert-on-duplicate.html). The MySQL server version is auto-detected and can be overridden in the [configuration](/database/getting-started.mdx#configuration). ::: ## Update Statements diff --git a/docs/dependencies.mdx b/docs/dependencies.mdx index a5fb7fbc9..47f51c5fc 100644 --- a/docs/dependencies.mdx +++ b/docs/dependencies.mdx @@ -31,7 +31,7 @@ Be aware that the standard support for the last release of the __Qt v5__ series ##### Optional -- >= [MySQL Connector/C 8](https://dev.mysql.com/downloads/c-api/) - used only for the [`mysql_ping`](https://dev.mysql.com/doc/c-api/9.0/en/mysql-ping.html) function and provided by [MySQL 8 Server](https://dev.mysql.com/downloads/mysql/) +- >= [MySQL Connector/C 8](https://dev.mysql.com/downloads/c-api/) - used only for the [`mysql_ping`](https://dev.mysql.com/doc/c-api/9.1/en/mysql-ping.html) function and provided by [MySQL 8 Server](https://dev.mysql.com/downloads/mysql/) :::info The `TinyORM` will support `Qt` versions that aren't [end-of-life](https://endoflife.date/qt). diff --git a/docs/tinydrivers/getting-started.mdx b/docs/tinydrivers/getting-started.mdx index fb86c2b41..4b692e1be 100644 --- a/docs/tinydrivers/getting-started.mdx +++ b/docs/tinydrivers/getting-started.mdx @@ -29,7 +29,7 @@ It was designed to drop the `QtSql` dependency while maintaining backward compat #### Features summary - both, normal and prepared statements are supported - - TLS/SSL connections using [`MYSQL_OPT_SSL_MODE`](https://dev.mysql.com/doc/c-api/9.0/en/mysql-options.html) (verify_ca, verify_identity) 🔥 + - TLS/SSL connections using [`MYSQL_OPT_SSL_MODE`](https://dev.mysql.com/doc/c-api/9.1/en/mysql-options.html) (verify_ca, verify_identity) 🔥 - setting many other MySQL connection options (see [`mysqldriver_p.cpp`](https://github.com/silverqx/TinyORM/blob/main/drivers/mysql/src/orm/drivers/mysql/mysqldriver_p.cpp)) - building and linking against the [`MariaDB Connector/C`](https://mariadb.com/kb/en/mariadb-connector-c/) 🕺 - transactions @@ -65,9 +65,9 @@ All database drivers described in the [Database](database/getting-started.mdx#in The following describes the differences between `QMYSQL` and `TinyMySql` drivers. -The `QMYSQL` driver doesn't support setting `MySQL` non-flag [connection options](https://dev.mysql.com/doc/c-api/9.0/en/mysql-options.html) like `MYSQL_OPT_RECONNECT` without the value, it needs to be defined with value like `=1` or `=TRUE` (case-sensitive), only real flag options like `CLIENT_INTERACTIVE` can be set without the value and `=` character. +The `QMYSQL` driver doesn't support setting `MySQL` non-flag [connection options](https://dev.mysql.com/doc/c-api/9.1/en/mysql-options.html) like `MYSQL_OPT_RECONNECT` without the value, it needs to be defined with value like `=1` or `=TRUE` (case-sensitive), only real flag options like `CLIENT_INTERACTIVE` can be set without the value and `=` character. -On the other hand, the `TinyMySql` driver allows setting non-flag [connection options](https://dev.mysql.com/doc/c-api/9.0/en/mysql-options.html) options without the value and `=` character, which are considered enabled (ON or TRUE). +On the other hand, the `TinyMySql` driver allows setting non-flag [connection options](https://dev.mysql.com/doc/c-api/9.1/en/mysql-options.html) options without the value and `=` character, which are considered enabled (ON or TRUE). ##### Removed features @@ -115,7 +115,7 @@ To control shared and static build use [`static`](building/tinyorm.mdx#qmake-sta Performance is several milliseconds faster compared to `QtSql` with the `QMYSQL` driver. It was tuned using the `KCacheGrind` to be so. It's ~40ms faster on [`TinyOrmPlayground`](https://github.com/silverqx/TinyOrmPlayground) project with __620__ database queries compiled using `GCC v13.2.1` Debug build on Linux. Similar results can be expected on other platforms but it's not guaranteed. -This means performance is very similar to `QtSql`. There is not much to speed up because `TinyDrivers` code is swift and 90% of the time is spent inside the [`MySQL C API`](https://dev.mysql.com/doc/c-api/9.0/en/) because we always have to wait for the database server, especially when creating database connections using eg. [`mysql_real_connect()`](https://dev.mysql.com/doc/c-api/9.0/en/mysql-real-connect.html) (this function is king among the slowest functions 😎, which is understandable of course). +This means performance is very similar to `QtSql`. There is not much to speed up because `TinyDrivers` code is swift and 90% of the time is spent inside the [`MySQL C API`](https://dev.mysql.com/doc/c-api/9.1/en/) because we always have to wait for the database server, especially when creating database connections using eg. [`mysql_real_connect()`](https://dev.mysql.com/doc/c-api/9.1/en/mysql-real-connect.html) (this function is king among the slowest functions 😎, which is understandable of course). ## Internals @@ -125,7 +125,7 @@ This means performance is very similar to `QtSql`. There is not much to speed up - SQL API layer - Public API layer -The Driver layer is eg. `TinyMySql` library which is responsible for communicating with the underlying database driver (eg. [`MySQL C API`](https://dev.mysql.com/doc/c-api/9.0/en/)). +The Driver layer is eg. `TinyMySql` library which is responsible for communicating with the underlying database driver (eg. [`MySQL C API`](https://dev.mysql.com/doc/c-api/9.1/en/)). The SQL API layer is a semi-layer that glues everything up and sits between the Public interface API and the Driver layer. diff --git a/docs/tinyorm/getting-started.mdx b/docs/tinyorm/getting-started.mdx index 76e3f6505..e61084d14 100644 --- a/docs/tinyorm/getting-started.mdx +++ b/docs/tinyorm/getting-started.mdx @@ -851,7 +851,7 @@ All databases except SQL Server require the columns in the second argument of th ::: :::info -Row and column aliases will be used with the MySQL server >=8.0.19 instead of the VALUES() function as is described in the MySQL [documentation](https://dev.mysql.com/doc/refman/9.0/en/insert-on-duplicate.html). The MySQL server version is auto-detected and can be overridden in the [configuration](/database/getting-started.mdx#configuration). +Row and column aliases will be used with the MySQL server >=8.0.19 instead of the VALUES() function as is described in the MySQL [documentation](https://dev.mysql.com/doc/refman/9.1/en/insert-on-duplicate.html). The MySQL server version is auto-detected and can be overridden in the [configuration](/database/getting-started.mdx#configuration). ::: ## Deleting Models diff --git a/drivers/common/src/orm/drivers/sqlfield.cpp b/drivers/common/src/orm/drivers/sqlfield.cpp index 2e4d1e50b..82eb1f262 100644 --- a/drivers/common/src/orm/drivers/sqlfield.cpp +++ b/drivers/common/src/orm/drivers/sqlfield.cpp @@ -134,7 +134,7 @@ operator<<(QDebug debug, const TINYORM_PREPEND_NAMESPACE(Orm::Drivers::SqlField) in MySQL v8.3, what means connector C API doesn't provide this default field value, also both IS_NULLABLE and COLUMN_DEFAULT must be checked to correctly obtain this information, there is also some info at about NO_DEFAULT_VALUE_FLAG: - https://dev.mysql.com/doc/c-api/9.0/en/c-api-data-structures.html: + https://dev.mysql.com/doc/c-api/9.1/en/c-api-data-structures.html: - SHOW COLUMNS FROM users; - describe users; (the same as SHOW COLUMNS) - select c.COLUMN_NAME, c.IS_NULLABLE, c.COLUMN_DEFAULT from information_schema.`COLUMNS` c where c.TABLE_SCHEMA = 'tinyorm_test_1' and c.TABLE_NAME = 'users'; (this select-s as little info as possible) diff --git a/drivers/mysql/include/orm/drivers/mysql/mysqldriver.hpp b/drivers/mysql/include/orm/drivers/mysql/mysqldriver.hpp index 19766283e..64d7a6c6b 100644 --- a/drivers/mysql/include/orm/drivers/mysql/mysqldriver.hpp +++ b/drivers/mysql/include/orm/drivers/mysql/mysqldriver.hpp @@ -97,7 +97,7 @@ namespace Orm::Drivers::MySql int MySqlDriver::maximumIdentifierLength(const IdentifierType /*unused*/) const noexcept { - // https://dev.mysql.com/doc/refman/9.0/en/identifier-length.html + // https://dev.mysql.com/doc/refman/9.1/en/identifier-length.html return 64; } diff --git a/include/orm/databaseconnection.hpp b/include/orm/databaseconnection.hpp index 4943cb714..d612b348d 100644 --- a/include/orm/databaseconnection.hpp +++ b/include/orm/databaseconnection.hpp @@ -614,7 +614,7 @@ namespace Orm const QString &queryString, const QList &preparedBindings, const RunCallback &callback) const { - // TODO would be good to call KILL on lost connection to free locks, https://dev.mysql.com/doc/c-api/9.0/en/c-api-auto-reconnect.html silverqx + // TODO would be good to call KILL on lost connection to free locks, https://dev.mysql.com/doc/c-api/9.1/en/c-api-auto-reconnect.html silverqx if (!causedByLostConnection(errorMessage)) std::rethrow_exception(ePtr); diff --git a/include/orm/schema/columndefinition.hpp b/include/orm/schema/columndefinition.hpp index d614beb9c..e9598a575 100644 --- a/include/orm/schema/columndefinition.hpp +++ b/include/orm/schema/columndefinition.hpp @@ -171,7 +171,7 @@ namespace Orm::SchemaNs std::optional precision = std::nullopt; /* srid max. value should be 2^32-1 as is described here, so unsigned int should be ok: - https://dev.mysql.com/doc/refman/9.0/en/spatial-function-argument-handling.html */ + https://dev.mysql.com/doc/refman/9.1/en/spatial-function-argument-handling.html */ /*! The spatial reference identifier (SRID) of a geometry identifies the SRS in which the geometry is defined (MySQL/PostgreSQL). */ std::optional srid = std::nullopt; diff --git a/qmake/features/private/tiny_find_packages.prf b/qmake/features/private/tiny_find_packages.prf index b048ea5da..86fa802a1 100644 --- a/qmake/features/private/tiny_find_packages.prf +++ b/qmake/features/private/tiny_find_packages.prf @@ -124,7 +124,7 @@ defineReplace(tiny_mysql_root_win32) { return() # Supported MySQL versions - mysqlVersions = 9.0 8.4 8.3 8.2 8.1 8.0 5.7 + mysqlVersions = 9.1 9.0 8.4 8.3 8.2 8.1 8.0 5.7 for(version, mysqlVersions) { mysqlRoot = $$clean_path(\ diff --git a/src/orm/schema/blueprint.cpp b/src/orm/schema/blueprint.cpp index 3493d8b7f..f825ce0dc 100644 --- a/src/orm/schema/blueprint.cpp +++ b/src/orm/schema/blueprint.cpp @@ -295,7 +295,7 @@ ColumnDefinitionReference<> Blueprint::longText(const QString &column) return addColumn(ColumnType::LongText, column); } -// TODO schema, fix and unify real/double/float types with latest standard and remove deprecated APIs, what I have understood from the MySQL and PostgreSQL docs it should be like this; I should have real and double (double precision) types without any total, places or precision params and then I should have float type that should have precision param, currently this total and places params are deprecated as described in https://dev.mysql.com/doc/refman/9.0/en/floating-point-types.html and will be removed in future, also add this column types to tests and to the playground also check numeric/decimal type, its different animal silverqx +// TODO schema, fix and unify real/double/float types with latest standard and remove deprecated APIs, what I have understood from the MySQL and PostgreSQL docs it should be like this; I should have real and double (double precision) types without any total, places or precision params and then I should have float type that should have precision param, currently this total and places params are deprecated as described in https://dev.mysql.com/doc/refman/9.1/en/floating-point-types.html and will be removed in future, also add this column types to tests and to the playground also check numeric/decimal type, its different animal silverqx ColumnDefinitionReference<> Blueprint::Float(const QString &column, const std::optional total, const std::optional places, const bool isUnsigned) diff --git a/src/orm/schema/grammars/mysqlschemagrammar.cpp b/src/orm/schema/grammars/mysqlschemagrammar.cpp index 2e76bcca9..3ecd92923 100644 --- a/src/orm/schema/grammars/mysqlschemagrammar.cpp +++ b/src/orm/schema/grammars/mysqlschemagrammar.cpp @@ -439,7 +439,7 @@ QString MySqlSchemaGrammar::escapeString(QString value) const special characters but for PostgreSQL only single-quote, it doesn't matter though, it will work anyway. On MySQL escaping of ^Z, \0, and \ is needed on some environments, described here: - https://dev.mysql.com/doc/refman/9.0/en/string-literals.html + https://dev.mysql.com/doc/refman/9.1/en/string-literals.html On PostgreSQL escaping using \ is is more SQL standard conforming, described here, (especially look at the caution box): https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-SPECIAL-CHARS*/ diff --git a/src/orm/schema/grammars/postgresschemagrammar.cpp b/src/orm/schema/grammars/postgresschemagrammar.cpp index 87a54875d..8b58f8ee9 100644 --- a/src/orm/schema/grammars/postgresschemagrammar.cpp +++ b/src/orm/schema/grammars/postgresschemagrammar.cpp @@ -458,7 +458,7 @@ QString PostgresSchemaGrammar::escapeString(QString value) const special characters but for PostgreSQL only single-quote, it doesn't matter though, it will work anyway. On MySQL escaping of ^Z, \0, and \ is needed on some environments, described here: - https://dev.mysql.com/doc/refman/9.0/en/string-literals.html + https://dev.mysql.com/doc/refman/9.1/en/string-literals.html On PostgreSQL escaping using \ is is more SQL standard conforming, described here, (especially look at the caution box): https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-SPECIAL-CHARS*/ diff --git a/src/orm/schema/grammars/sqliteschemagrammar.cpp b/src/orm/schema/grammars/sqliteschemagrammar.cpp index 2da6a151e..4ec439495 100644 --- a/src/orm/schema/grammars/sqliteschemagrammar.cpp +++ b/src/orm/schema/grammars/sqliteschemagrammar.cpp @@ -393,7 +393,7 @@ QString SQLiteSchemaGrammar::escapeString(QString value) const // clazy:exclude= special characters but for PostgreSQL only single-quote, it doesn't matter though, it will work anyway. On MySQL escaping of ^Z, \0, and \ is needed on some environments, described here: - https://dev.mysql.com/doc/refman/9.0/en/string-literals.html + https://dev.mysql.com/doc/refman/9.1/en/string-literals.html On PostgreSQL escaping using \ is is more SQL standard conforming, described here, (especially look at the caution box): https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-SPECIAL-CHARS*/ diff --git a/tools/qtbuild-qmysql-driver.ps1 b/tools/qtbuild-qmysql-driver.ps1 index ef706d180..786e0d377 100644 --- a/tools/qtbuild-qmysql-driver.ps1 +++ b/tools/qtbuild-qmysql-driver.ps1 @@ -17,7 +17,7 @@ Param( [ValidatePattern('^(?:[8-9]|1[0-2])\.\d{1,2}$', ErrorMessage = 'The argument "{0}" is not the correct Qt version number. ' + 'The argument "{0}" does not match the "{1}" pattern.')] - [string] $MySQLVersion = '9.0', + [string] $MySQLVersion = '9.1', [Parameter(HelpMessage = 'Clean CMake build (delete the $QtVersion build folder).')] [switch] $CleanBuild,