drop support for PostgreSQL and MySQL databases

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-09-10 05:03:08 +03:00
parent 1abdfa9775
commit 4209a57e8a
32 changed files with 64 additions and 4316 deletions

View file

@ -161,12 +161,6 @@ add_feature_info(fontconfig WITH_FONTCONFIG "build Fontconfig support")
option(WITH_ODBC "Build ODBC database plugin" ON)
add_feature_info(odbc WITH_ODBC "build ODBC support")
option(WITH_POSTGRESQL "Build PostgreSQL database plugin" ON)
add_feature_info(postgresql WITH_POSTGRESQL "build PostgreSQL support")
option(WITH_MYSQL "Build MySQL database plugin" ON)
add_feature_info(mysql WITH_MYSQL "build MySQL support")
option(WITH_INTL "Build Intl support" ON)
add_feature_info(intl WITH_INTL "build Intl support")
@ -336,24 +330,6 @@ set_package_properties(ODBC PROPERTIES
TYPE RECOMMENDED
)
# v7.4+ required for PQresultErrorField()
find_package(PostgreSQL 7.4)
set_package_properties(PostgreSQL PROPERTIES
PURPOSE "Required for PostgreSQL database support"
DESCRIPTION "The world's most advanced open source database"
URL "https://www.postgresql.org/"
TYPE RECOMMENDED
)
# v4.1.13+ required for multiple statements query and UTF-8 support
find_package(MySQL 4.1.13)
set_package_properties(MySQL PROPERTIES
PURPOSE "Required for MySQL database support"
DESCRIPTION "The world's most popular open source database"
URL "https://www.mysql.com/"
TYPE RECOMMENDED
)
find_package(Intl)
set_package_properties(Intl PROPERTIES
PURPOSE "Required for translations support"

1
README
View file

@ -33,6 +33,7 @@ There are several things you should be aware before considering Katie:
- no SIMD, zero performance impact with decent compiler
- state machine is no more
- removed non-open source DB2, OCI, TDS and InterBase database drivers
- removed PostgreSQL and MySQL database drivers
- removed 3rd party sources that are very common nowdays
- dropped non-open source and discontinued platforms support
- dropped dnotify filesystem watcher support

View file

@ -1,9 +1,6 @@
version: 4.11.0-{branch}-{build}
image: Ubuntu2004
clone_depth: 1
services:
- mysql
- postgresql
cache:
- /home/appveyor/.ccache
@ -17,8 +14,7 @@ build_script:
sudo apt-get install -qq libpcre3-dev libssl-dev zlib1g-dev libzstd-dev libc6-dev libpng-dev \
libjpeg-dev libtiff-dev libcups2-dev libfreetype6-dev libfontconfig1-dev libdbus-1-dev \
libicu-dev unixodbc-dev libpq-dev libmariadbclient-dev libmariadbd-dev liblz4-dev \
libsqlite3-dev xorg-dev dbus-x11 libjansson-dev ccache
libicu-dev unixodbc-dev libsqlite3-dev xorg-dev dbus-x11 libjansson-dev ccache
export PATH="/usr/lib/ccache/:$PATH"

View file

@ -1,48 +0,0 @@
# - Try to find MySQL
# Once done this will define
#
# MYSQL_FOUND - system has MySQL
# MYSQL_INCLUDES - the MySQL include directory
# MYSQL_LIBRARIES - the libraries needed to use MySQL
#
# Copyright (C) 2015, Ivailo Monev, <xakepa10@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
include(FindPkgConfig)
include(FindPackageHandleStandardArgs)
# Only MariaDB provides pkg-config files and only in recent versions
pkg_check_modules(PC_MYSQL QUIET libmariadb)
# However, both provide config program
find_program(MYSQL_CONFIG
NAMES mariadb_config mysql_config
HINTS $ENV{MYSQLDIR}/bin
)
if(MYSQL_CONFIG)
execute_process(
COMMAND ${MYSQL_CONFIG} --version
OUTPUT_VARIABLE MYSQL_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
find_path(MYSQL_INCLUDES
NAMES mysql.h
PATH_SUFFIXES mariadb mysql
HINTS $ENV{MYSQLDIR}/include ${PC_MYSQL_INCLUDEDIR}
)
find_library(MYSQL_LIBRARIES
NAMES mariadbd mysqld
HINTS $ENV{MYSQLDIR}/lib ${PC_MYSQL_LIBDIR}
)
find_package_handle_standard_args(MySQL
VERSION_VAR MYSQL_VERSION
REQUIRED_VARS MYSQL_LIBRARIES MYSQL_INCLUDES
)
mark_as_advanced(MYSQL_INCLUDES MYSQL_LIBRARIES)

View file

@ -1,33 +0,0 @@
# - Try to find PostgreSQL database engine
# Once done this will define
#
# POSTGRESQL_FOUND - system has PostgreSQL database engine
# POSTGRESQL_INCLUDES - the PostgreSQL database engine include directory
# POSTGRESQL_LIBRARIES - the libraries needed to use PostgreSQL database engine
#
# Copyright (C) 2020, Ivailo Monev, <xakepa10@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
include(FindPkgConfig)
include(FindPackageHandleStandardArgs)
pkg_check_modules(PC_POSTGRESQL QUIET libpq)
find_path(POSTGRESQL_INCLUDES
NAMES libpq-fe.h
PATH_SUFFIXES postgresql
HINTS $ENV{POSTGRESQLDIR}/include ${PC_POSTGRESQL_INCLUDEDIR}
)
find_library(POSTGRESQL_LIBRARIES
NAMES pq
HINTS $ENV{POSTGRESQLDIR}/lib ${PC_POSTGRESQL_LIBDIR}
)
find_package_handle_standard_args(PostgreSQL
VERSION_VAR PC_POSTGRESQL_VERSION
REQUIRED_VARS POSTGRESQL_LIBRARIES POSTGRESQL_INCLUDES
)
mark_as_advanced(POSTGRESQL_INCLUDES POSTGRESQL_LIBRARIES)

View file

@ -12,10 +12,8 @@ url='https://github.com/fluxer/katie'
license=('LGPL' 'BSD')
depends=('libsm' 'libxcursor' 'libxinerama' 'icu' 'libcups' 'libxrandr' 'sqlite'
'fontconfig' 'xdg-utils' 'jansson')
makedepends=('cmake' 'git' 'postgresql' 'mariadb-libs' 'unixodbc' 'unifdef')
optdepends=('postgresql-libs: PostgreSQL driver'
'mariadb-libs: MariaDB driver'
'unixodbc: ODBC driver')
makedepends=('cmake' 'git' 'unixodbc' 'unifdef')
optdepends=('unixodbc: ODBC driver')
source=("git+https://github.com/fluxer/katie")
sha1sums=('SKIP')
conflicts=('katie')

View file

@ -10,14 +10,13 @@ Build-Depends: debhelper (>= 9~), libssl-dev, zlib1g-dev, libzstd-dev,
libcups2-dev, libfreetype6-dev, libfontconfig1-dev, libpcre3-dev,
libdbus-1-dev, unixodbc-dev, libicu-dev, libsqlite3-dev, cmake, git,
xserver-xorg-dev, libxinerama-dev, libxrandr-dev, libxrender-dev,
libxcursor-dev, libsm-dev, libpq-dev, libmariadbclient-dev, libmariadbd-dev,
unifdef | dpkg
libxcursor-dev, libsm-dev, unifdef | dpkg
Package: katie-runtime
Architecture: amd64 arm64 armel armhf i386 mips mips64el mipsel ppc64el s390x hurd-i386
Section: x11
Depends: ${shlibs:Depends}, ${misc:Depends}, xdg-utils
Recommends: unixodbc, libpq5, libmariadbclient, xserver-xorg-core
Recommends: unixodbc, xserver-xorg-core
Description: C++ toolkit derived from the Qt 4.8 framework
Katie is continuation of the Qt4 C++ toolkit with the goal to keep it alive,
clean it up, fix some bugs and backport some features from Qt5. It is based

View file

@ -7,7 +7,7 @@ Summary: C++ toolkit derived from the Qt 4.8 framework
License: BSD and LGPLv2+
URL: https://github.com/fluxer/katie
BuildRequires: gcc-c++ cmake libicu-devel libzstd-devel jansson-devel zlib-devel libsq3-devel libpng-devel freetype-devel pcre-devel openssl-devel libX11-devel libXinerama-devel libXrandr-devel libXrender-devel libXfixes-devel libXcursor-devel libSM-devel libICE-devel dbus-devel libtiff-devel libjpeg-turbo-devel fontconfig-devel cups-devel libiodbc-devel libpq-devel mariadb-embedded-devel unifdef
BuildRequires: gcc-c++ cmake libicu-devel libzstd-devel jansson-devel zlib-devel libsq3-devel libpng-devel freetype-devel pcre-devel openssl-devel libX11-devel libXinerama-devel libXrandr-devel libXrender-devel libXfixes-devel libXcursor-devel libSM-devel libICE-devel dbus-devel libtiff-devel libjpeg-turbo-devel fontconfig-devel cups-devel libiodbc-devel unifdef
Requires: xdg-utils
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig

View file

@ -25,20 +25,11 @@ LIB_DEPENDS = libzstd.so:archivers/zstd libicuuc.so:devel/icu \
libcups.so:print/cups libiodbc.so:databases/libiodbc
CMAKE_ARGS = -DKATIE_TOOLS_SUFFIX="-katie"
OPTIONS_DEFINE = NLS MYSQL PGSQL
OPTIONS_DEFINE = NLS
OPTIONS_SUB = yes
NLS_DESC = Build translator and translations
NLS_USES = gettext
NLS_CMAKE_ON = -DWITH_INTL=TRUE
NLS_CMAKE_OFF = -DWITH_INTL=FALSE
MYSQL_DESC = Build MySQL database plugin
MYSQL_USES = mysql
MYSQL_CMAKE_ON = -DWITH_MYSQL=TRUE
MYSQL_CMAKE_OFF = -DWITH_MYSQL=FALSE
PGSQL_DESC = Build PostgreSQL database plugin
PGSQL_USES = pgsql
WANT_PGSQL = client
PGSQL_CMAKE_ON = -DWITH_POSTGRESQL=TRUE
PGSQL_CMAKE_OFF = -DWITH_POSTGRESQL=FALSE
.include <bsd.port.mk>

View file

@ -1459,8 +1459,6 @@ lib/katie/plugins/imageformats/libqtga.so
lib/katie/plugins/imageformats/libqtiff.so
lib/katie/plugins/script/libqtscriptdbus.so
lib/katie/plugins/sqldrivers/libqsqlodbc.so
%%MYSQL%%lib/katie/plugins/sqldrivers/libqsqlmysql.so
%%PGSQL%%lib/katie/plugins/sqldrivers/libqsqlpsql.so
lib/libKtCore.so
lib/libKtCore.so.4.11
lib/libKtCore.so.4.11.0

View file

@ -23,8 +23,6 @@ DL_AUTO_VARS = yes
DEPENDS = xdg-utils-[0-9]*:../../misc/xdg-utils
.include "options.mk"
.include "../../sysutils/desktop-file-utils/desktopdb.mk"
.include "../../archivers/zstd/buildlink3.mk"
.include "../../textproc/jansson/buildlink3.mk"

View file

@ -1461,9 +1461,7 @@ lib/katie/plugins/imageformats/libqsvg.so
lib/katie/plugins/imageformats/libqtga.so
lib/katie/plugins/imageformats/libqtiff.so
lib/katie/plugins/script/libqtscriptdbus.so
${PLIST.mysql}lib/katie/plugins/sqldrivers/libqsqlmysql.so
lib/katie/plugins/sqldrivers/libqsqlodbc.so
${PLIST.pgsql}lib/katie/plugins/sqldrivers/libqsqlpsql.so
lib/libKtCore.so
lib/libKtCore.so.4.11
lib/libKtCore.so.4.11.0

View file

@ -1,25 +0,0 @@
# $NetBSD$
PKG_OPTIONS_VAR = PKG_OPTIONS.katie
PKG_SUPPORTED_OPTIONS = mysql pgsql
PKG_SUGGESTED_OPTIONS =
.include "../../mk/bsd.options.mk"
PLIST_VARS += mysql pgsql
.if !empty(PKG_OPTIONS:Mmysql)
CMAKE_ARGS += -DWITH_MYSQL=TRUE
PLIST.mysql = yes
. include "../../mk/mysql.buildlink3.mk"
.else
CMAKE_ARGS += -DWITH_MYSQL=FALSE
.endif
.if !empty(PKG_OPTIONS:Mpgsql)
CMAKE_ARGS += -DWITH_POSTGRESQL=TRUE
PLIST.pgsql = yes
. include "../../mk/pgsql.buildlink3.mk"
.else
CMAKE_ARGS += -DWITH_POSTGRESQL=FALSE
.endif

View file

@ -8,8 +8,8 @@ rm -rf "$cwd/../minsize"
mkdir -p "$cwd/../minsize"
cd "$cwd/../minsize"
export CFLAGS="$CFLAGS -flto"
export CXXFLAGS="$CXXFLAGS -flto -fno-exceptions"
# export CFLAGS="$CFLAGS -flto"
# export CXXFLAGS="$CXXFLAGS -flto -fno-exceptions"
cmake ../ -DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=/usr $@

View file

@ -49,15 +49,9 @@ endif()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins/sqldrivers")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins/sqldrivers")
if(WITH_MYSQL AND MYSQL_FOUND)
add_subdirectory(sqldrivers/mysql)
endif()
if(WITH_ODBC AND ODBC_FOUND)
add_subdirectory(sqldrivers/odbc)
endif()
if(WITH_POSTGRESQL AND POSTGRESQL_FOUND)
add_subdirectory(sqldrivers/psql)
endif()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins/designer")

View file

@ -1,24 +0,0 @@
set(MYSQLCDRIVER_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/qsql_mysql.h
)
set(MYSQLCDRIVER_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/mysqlmain.cpp
${CMAKE_CURRENT_SOURCE_DIR}/qsql_mysql.cpp
)
include_directories(${MYSQL_INCLUDES})
katie_setup_target(qsqlmysqlplugin ${MYSQLCDRIVER_SOURCES} ${MYSQLCDRIVER_HEADERS})
add_library(qsqlmysqlplugin MODULE ${qsqlmysqlplugin_SOURCES})
target_link_libraries(qsqlmysqlplugin KtSql ${MYSQL_LIBRARIES})
set_target_properties(qsqlmysqlplugin PROPERTIES OUTPUT_NAME qsqlmysql)
katie_setup_plugin(qsqlmysqlplugin)
install(
TARGETS qsqlmysqlplugin
DESTINATION ${KATIE_PLUGINS_PATH}/sqldrivers
COMPONENT Runtime
)

View file

@ -1,61 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the plugins of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qsqldriverplugin.h"
#include "qstringlist.h"
#include "qsql_mysql.h"
QT_BEGIN_NAMESPACE
class QMYSQLDriverPlugin : public QSqlDriverPlugin
{
public:
QMYSQLDriverPlugin();
QSqlDriver* create(const QString &);
QStringList keys() const;
};
QMYSQLDriverPlugin::QMYSQLDriverPlugin()
: QSqlDriverPlugin()
{
}
QSqlDriver* QMYSQLDriverPlugin::create(const QString &name)
{
if (name == QLatin1String("QMYSQL") || name == QLatin1String("QMYSQL3")) {
QMYSQLDriver* driver = new QMYSQLDriver();
return driver;
}
return 0;
}
QStringList QMYSQLDriverPlugin::keys() const
{
static const QStringList list = QStringList()
<< QLatin1String("QMYSQL3")
<< QLatin1String("QMYSQL");
return list;
}
Q_EXPORT_PLUGIN2(qsqlmysql, QMYSQLDriverPlugin)
QT_END_NAMESPACE

File diff suppressed because it is too large Load diff

View file

@ -1,106 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtSql module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSQL_MYSQL_H
#define QSQL_MYSQL_H
#include <QtSql/qsqldriver.h>
#include <QtSql/qsqlresult.h>
#include <mysql.h>
QT_BEGIN_NAMESPACE
class QMYSQLDriverPrivate;
class QMYSQLResultPrivate;
class QMYSQLDriver;
class QSqlRecordInfo;
class QMYSQLResult : public QSqlResult
{
friend class QMYSQLDriver;
friend class QMYSQLResultPrivate;
public:
explicit QMYSQLResult(const QMYSQLDriver* db);
~QMYSQLResult();
QVariant handle() const;
protected:
void cleanup();
bool fetch(int i);
bool fetchNext();
bool fetchLast();
bool fetchFirst();
QVariant data(int field) const;
bool isNull(int field) const;
bool reset (const QString& query);
int size() const;
int numRowsAffected() const;
QVariant lastInsertId() const;
QSqlRecord record() const;
void virtual_hook(int id, void *data);
bool nextResult();
bool prepare(const QString& stmt);
bool exec();
private:
QMYSQLResultPrivate* d;
};
class QMYSQLDriver : public QSqlDriver
{
Q_OBJECT
friend class QMYSQLResult;
public:
explicit QMYSQLDriver(QObject *parent=0);
~QMYSQLDriver();
bool hasFeature(DriverFeature f) const;
bool open(const QString & db,
const QString & user,
const QString & password,
const QString & host,
int port,
const QString& connOpts);
void close();
QSqlResult *createResult() const;
QStringList tables(QSql::TableType) const;
QSqlIndex primaryIndex(const QString& tablename) const;
QSqlRecord record(const QString& tablename) const;
QString formatValue(const QSqlField &field,
bool trimStrings) const;
QVariant handle() const;
QString escapeIdentifier(const QString &identifier, IdentifierType type) const;
bool isIdentifierEscaped(const QString &identifier, IdentifierType type) const;
protected:
bool beginTransaction();
bool commitTransaction();
bool rollbackTransaction();
private:
QMYSQLDriverPrivate* d;
};
QT_END_NAMESPACE
#endif // QSQL_MYSQL_H

View file

@ -1,24 +0,0 @@
set(PSQLDRIVER_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/qsql_psql.h
)
set(PSQLDRIVER_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/psqlmain.cpp
${CMAKE_CURRENT_SOURCE_DIR}/qsql_psql.cpp
)
include_directories(${POSTGRESQL_INCLUDES})
katie_setup_target(qsqlpsqlplugin ${PSQLDRIVER_SOURCES} ${PSQLDRIVER_HEADERS})
add_library(qsqlpsqlplugin MODULE ${qsqlpsqlplugin_SOURCES})
target_link_libraries(qsqlpsqlplugin KtSql ${POSTGRESQL_LIBRARIES})
set_target_properties(qsqlpsqlplugin PROPERTIES OUTPUT_NAME qsqlpsql)
katie_setup_plugin(qsqlpsqlplugin)
install(
TARGETS qsqlpsqlplugin
DESTINATION ${KATIE_PLUGINS_PATH}/sqldrivers
COMPONENT Runtime
)

View file

@ -1,61 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the plugins of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qsqldriverplugin.h"
#include "qstringlist.h"
#include "qsql_psql.h"
QT_BEGIN_NAMESPACE
class QPSQLDriverPlugin : public QSqlDriverPlugin
{
public:
QPSQLDriverPlugin();
QSqlDriver* create(const QString &);
QStringList keys() const;
};
QPSQLDriverPlugin::QPSQLDriverPlugin()
: QSqlDriverPlugin()
{
}
QSqlDriver* QPSQLDriverPlugin::create(const QString &name)
{
if (name == QLatin1String("QPSQL") || name == QLatin1String("QPSQL7")) {
QPSQLDriver* driver = new QPSQLDriver();
return driver;
}
return 0;
}
QStringList QPSQLDriverPlugin::keys() const
{
static const QStringList list = QStringList()
<< QLatin1String("QPSQL7")
<< QLatin1String("QPSQL");
return list;
}
Q_EXPORT_PLUGIN2(qsqlpsql, QPSQLDriverPlugin)
QT_END_NAMESPACE

File diff suppressed because it is too large Load diff

View file

@ -1,124 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtSql module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSQL_PSQL_H
#define QSQL_PSQL_H
#include <QtSql/qsqlresult.h>
#include <QtSql/qsqldriver.h>
#include <libpq-fe.h>
#include <pg_config.h>
QT_BEGIN_NAMESPACE
class QPSQLResultPrivate;
class QPSQLDriverPrivate;
class QPSQLDriver;
class QSqlRecordInfo;
class QPSQLResult : public QSqlResult
{
friend class QPSQLResultPrivate;
public:
QPSQLResult(const QPSQLDriver* db, const QPSQLDriverPrivate* p);
~QPSQLResult();
QVariant handle() const;
protected:
void cleanup();
bool fetch(int i);
bool fetchFirst();
bool fetchLast();
QVariant data(int i) const;
bool isNull(int field) const;
bool reset (const QString& query);
int size() const;
int numRowsAffected() const;
QSqlRecord record() const;
QVariant lastInsertId() const;
bool prepare(const QString& query);
bool exec();
private:
QPSQLResultPrivate *d;
};
class QPSQLDriver : public QSqlDriver
{
Q_OBJECT
public:
enum Protocol {
VersionUnknown = -1,
Version74 = 1,
Version8 = 2,
Version81 = 3,
Version82 = 4,
Version83 = 5,
Version84 = 6,
Version9 = 7,
VersionMaybeCompatible = 32
};
explicit QPSQLDriver(QObject *parent=0);
~QPSQLDriver();
bool hasFeature(DriverFeature f) const;
bool open(const QString & db,
const QString & user,
const QString & password,
const QString & host,
int port,
const QString& connOpts);
bool isOpen() const;
void close();
QSqlResult *createResult() const;
QStringList tables(QSql::TableType) const;
QSqlIndex primaryIndex(const QString& tablename) const;
QSqlRecord record(const QString& tablename) const;
Protocol protocol() const;
QVariant handle() const;
QString escapeIdentifier(const QString &identifier, IdentifierType type) const;
QString formatValue(const QSqlField &field, bool trimStrings) const;
bool subscribeToNotification(const QString &name);
bool unsubscribeFromNotification(const QString &name);
QStringList subscribedToNotifications() const;
protected:
bool beginTransaction();
bool commitTransaction();
bool rollbackTransaction();
private Q_SLOTS:
void _q_handleNotification(int);
private:
QPSQLDriverPrivate *d;
};
QT_END_NAMESPACE
#endif // QSQL_PSQL_H

View file

@ -457,9 +457,7 @@ QStringList QSqlDatabase::connectionNames()
\table
\header \i Driver Type \i Description
\row \i QMYSQL \i MySQL Driver
\row \i QODBC \i ODBC Driver (includes Microsoft SQL Server)
\row \i QPSQL \i PostgreSQL Driver
\row \i QODBC \i ODBC version 3 or above
\row \i QSQLITE \i SQLite version 3 or above
\endtable
@ -957,7 +955,7 @@ QSqlRecord QSqlDatabase::record(const QString& tablename) const
database client used:
\table
\header \i ODBC \i MySQL \i PostgreSQL
\header \i ODBC
\row
\i
@ -973,47 +971,10 @@ QSqlRecord QSqlDatabase::record(const QString& tablename) const
\i SQL_ATTR_CONNECTION_POOLING
\endlist
\i
\list
\i CLIENT_COMPRESS
\i CLIENT_FOUND_ROWS
\i CLIENT_IGNORE_SPACE
\i CLIENT_SSL
\i CLIENT_ODBC
\i CLIENT_NO_SCHEMA
\i CLIENT_INTERACTIVE
\i UNIX_SOCKET
\i MYSQL_OPT_RECONNECT
\endlist
\i
\list
\i connect_timeout
\i options
\i tty
\i requiressl
\i service
\endlist
\header \i DB2 \i OCI \i TDS
\row
\i
\list
\i SQL_ATTR_ACCESS_MODE
\i SQL_ATTR_LOGIN_TIMEOUT
\endlist
\i
\list
\i OCI_ATTR_PREFETCH_ROWS
\i OCI_ATTR_PREFETCH_MEMORY
\endlist
\i
\e none
\header \i SQLite \i Interbase
\header \i SQLite
\row
\i
@ -1023,12 +984,6 @@ QSqlRecord QSqlDatabase::record(const QString& tablename) const
\i QSQLITE_ENABLE_SHARED_CACHE
\endlist
\i
\list
\i ISC_DPB_LC_CTYPE
\i ISC_DPB_SQL_ROLE_NAME
\endlist
\endtable
Examples:
@ -1076,50 +1031,14 @@ bool QSqlDatabase::isDriverAvailable(const QString& name)
yourself. It might be your own database driver, or you might just
need to instantiate one of the Qt drivers yourself. If you do
this, it is recommended that you include the driver code in your
application. For example, you can create a PostgreSQL connection
with your own QPSQL driver like this:
application.
\snippet doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp 5
\codeline
\snippet doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp 6
The above code sets up a PostgreSQL connection and instantiates a
QPSQLDriver object. Next, addDatabase() is called to add the
connection to the known connections so that it can be used by the
Qt SQL classes. When a driver is instantiated with a connection
handle (or set of handles), Qt assumes that you have already
opened the database connection.
\note We assume that \c qtdir is the directory where Qt is
installed. This will pull in the code that is needed to use the
PostgreSQL client library and to instantiate a QPSQLDriver object,
assuming that you have the PostgreSQL headers somewhere in your
include search path.
Remember that you must link your application against the database
client library. Make sure the client library is in your linker's
search path, and add lines like these to your \c{.pro} file:
\snippet doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp 7
The method described works for all the supplied drivers. The only
difference will be in the driver constructor arguments. Here is a
table of the drivers included with Qt, their source code files,
and their constructor arguments:
Here is a table of the drivers included with Qt, their name and
their constructor arguments:
\table
\header \i Driver \i Class name \i Constructor arguments \i File to include
\row
\i QPSQL
\i QPSQLDriver
\i PGconn *connection
\i \c qsql_psql.cpp
\row
\i QMYSQL
\i QMYSQLDriver
\i MYSQL *connection
\i \c qsql_mysql.cpp
\row
\i QODBC
\i QODBCDriver
\i SQLHANDLE environment, SQLHANDLE connection
@ -1132,11 +1051,6 @@ bool QSqlDatabase::isDriverAvailable(const QString& name)
\row
\endtable
The host name (or service name) is needed when constructing the
QTDSDriver for creating new connections for internal queries. This
is to prevent blocking when several QSqlQuery objects are used
simultaneously.
\warning Adding a database connection with the same connection
name as an existing connection, causes the existing connection to
be replaced by the new one.

View file

@ -76,10 +76,8 @@ inline static QString qTableName( const QString& prefix, QSqlDriver* driver )
inline static bool testWhiteSpaceNames( const QString &name )
{
return name.startsWith( QLatin1String("QPSQL") )
|| name.startsWith( QLatin1String("QODBC") )
|| name.startsWith( QLatin1String("QSQLITE") )
|| name.startsWith( QLatin1String("QMYSQL") );
return name.startsWith( QLatin1String("QODBC") )
|| name.startsWith( QLatin1String("QSQLITE") );
}
class tst_Databases
@ -189,34 +187,6 @@ public:
void addDbs()
{
// This requires a local ODBC data source to be configured( pointing to a MySql database )
// addDb( "QODBC", "mysqlodbc", "troll", "trond" );
// addDb( "QODBC", "SqlServer", "troll", "trond" );
// addDb( "QODBC", "silencetestdb", "troll", "trond", "silence" );
// addDb( "QODBC", "horseheadtestdb", "troll", "trondk", "horsehead" );
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no" );
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3307 );
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3308, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 4.1.1
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3309, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 5.0.18 Linux
// addDb( "QMYSQL3", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // MySQL 5.1.36 Windows
// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql41.apac.nokia.com" ); // MySQL 4.1.22-2.el4 linux
// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql50.apac.nokia.com" ); // MySQL 5.0.45-7.el5 linux
// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql51.apac.nokia.com" ); // MySQL 5.1.36-6.7.2.i586 linux
// addDb( "QPSQL7", "testdb", "troll", "trond", "horsehead.nokia.troll.no" ); // V7.2 NOT SUPPORTED!
// addDb( "QPSQL7", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 5434 ); // V7.2 NOT SUPPORTED! Multi-byte
// addDb( "QPSQL7", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 5435 ); // V7.3
// addDb( "QPSQL7", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 5436 ); // V7.4
// addDb( "QPSQL7", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 5437 ); // V8.0.3
// addDb( "QPSQL7", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // V8.2.1, UTF-8
// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-postgres74.apac.nokia.com" ); // Version 7.4.19-1.el4_6.1
// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-pgsql81.apac.nokia.com" ); // Version 8.1.11-1.el5_1.1
// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-pgsql84.apac.nokia.com" ); // Version 8.4.1-2.1.i586
// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-pgsql90.apac.nokia.com" ); // Version 9.0.0
// use in-memory database to prevent local files
// addDb("QSQLITE", ":memory:");
addDb( QLatin1String("QSQLITE"), QDir::toNativeSeparators(sqLiteFileName()));
@ -370,12 +340,6 @@ public:
// blobSize is only used if the db doesn't have a generic blob type
static QString blobTypeName( QSqlDatabase db, int blobSize = 10000 )
{
if ( db.driverName().startsWith( QLatin1String("QMYSQL") ) )
return QLatin1String( "longblob" );
if ( db.driverName().startsWith( QLatin1String("QPSQL") ) )
return QLatin1String( "bytea" );
if ( db.driverName().startsWith( QLatin1String("QSQLITE") ) )
return QLatin1String( "blob" );
@ -384,16 +348,6 @@ public:
return QLatin1String( "blob" );
}
static QString autoFieldName( QSqlDatabase db )
{
if ( db.driverName().startsWith( QLatin1String("QMYSQL") ) )
return QLatin1String( "AUTO_INCREMENT" );
/* if ( db.driverName().startsWith( QLatin1String("QPSQL") ) )
return QLatin1String( "SERIAL" );*/
return QString();
}
static QByteArray printError( const QSqlError& err )
{
QString result;
@ -434,12 +388,12 @@ public:
static bool isPostgreSQL( QSqlDatabase db )
{
return db.driverName().startsWith(QLatin1String("QPSQL")) || (db.driverName().startsWith(QLatin1String("QODBC")) && ( db.databaseName().contains(QLatin1String("PostgreSQL"), Qt::CaseInsensitive) || db.databaseName().contains(QLatin1String("pgsql"), Qt::CaseInsensitive) ) );
return db.driverName().startsWith(QLatin1String("QODBC")) && ( db.databaseName().contains(QLatin1String("PostgreSQL"), Qt::CaseInsensitive) || db.databaseName().contains(QLatin1String("pgsql"), Qt::CaseInsensitive) );
}
static bool isMySQL( QSqlDatabase db )
{
return db.driverName().startsWith(QLatin1String("QMYSQL")) || (db.driverName().startsWith(QLatin1String("QODBC")) && db.databaseName().contains(QLatin1String("MySQL"), Qt::CaseInsensitive) );
return db.driverName().startsWith(QLatin1String("QODBC")) && db.databaseName().contains(QLatin1String("MySQL"), Qt::CaseInsensitive);
}
// -1 on fail, else Oracle version
@ -462,26 +416,6 @@ public:
return ver;
}
static QString getMySqlVersion( const QSqlDatabase &db )
{
QSqlQuery q(db);
q.exec( QLatin1String("select version()") );
if(q.next())
return q.value( 0 ).toString();
else
return QString();
}
static QString getPSQLVersion( const QSqlDatabase &db )
{
QSqlQuery q(db);
q.exec( QLatin1String("select version()") );
if(q.next())
return q.value( 0 ).toString();
else
return QString();
}
QString sqLiteFileName() // Return a temporary file name for SQLite DB
{
const QString newFileName = m_sqLitePrefix + QLatin1Char('_')

View file

@ -67,14 +67,8 @@ private slots:
void eventNotification_data() { generic_data(); }
void eventNotification();
void addDatabase();
void errorReporting_data();
void errorReporting();
//database specific tests
void recordMySQL_data() { generic_data("QMYSQL"); }
void recordMySQL();
void recordPSQL_data() { generic_data("QPSQL"); }
void recordPSQL();
void recordSQLite_data() { generic_data("QSQLITE"); }
void recordSQLite();
void recordAccess_data() { generic_data("QODBC"); }
@ -82,9 +76,6 @@ private slots:
void recordSQLServer_data() { generic_data("QODBC"); }
void recordSQLServer();
void eventNotificationPSQL_data() { generic_data("QPSQL"); }
void eventNotificationPSQL();
//database specific 64 bit integer test
void bigIntField_data() { generic_data(); }
void bigIntField();
@ -107,21 +98,8 @@ private slots:
void precisionPolicy_data() { generic_data(); }
void precisionPolicy();
void psql_schemas_data() { generic_data("QPSQL"); }
void psql_schemas();
void psql_escapedIdentifiers_data() { generic_data("QPSQL"); }
void psql_escapedIdentifiers();
void psql_escapeBytea_data() { generic_data("QPSQL"); }
void psql_escapeBytea();
void bug_249059_data() { generic_data("QPSQL"); }
void bug_249059();
void mysqlOdbc_unsignedIntegers_data() { generic_data(); }
void mysqlOdbc_unsignedIntegers();
void mysql_multiselect_data() { generic_data("QMYSQL"); }
void mysql_multiselect(); // For task 144331
void mysql_savepointtest_data() { generic_data("QMYSQL"); }
void mysql_savepointtest();
void accessOdbc_strings_data() { generic_data(); }
void accessOdbc_strings();
@ -194,13 +172,12 @@ static int createFieldTable(const FieldDef fieldDefs[], QSqlDatabase db)
QSqlQuery q(db);
// construct a create table statement consisting of all fieldtypes
QString qs = "create table " + qTableName("qtestfields", __FILE__);
QString autoName = tst_Databases::autoFieldName(db);
if (tst_Databases::isMSAccess(db))
qs.append(" (id int not null");
else if (tst_Databases::isPostgreSQL(db))
qs.append(" (id serial not null");
else
qs.append(QString("(id integer not null %1 primary key").arg(autoName));
qs.append(QString("(id integer not null primary key"));
int i = 0;
for (i = 0; !fieldDefs[ i ].typeName.isNull(); ++i) {
@ -235,11 +212,7 @@ void tst_QSqlDatabase::createTestTables(QSqlDatabase db)
if (!db.isValid())
return;
QSqlQuery q(db);
if (db.driverName().startsWith("QMYSQL"))
// ### stupid workaround until we find a way to hardcode this
// in the MySQL server startup script
q.exec("set table_type=innodb");
else if (tst_Databases::isSqlServer(db)) {
if (tst_Databases::isSqlServer(db)) {
QVERIFY_SQL(q, exec("SET ANSI_DEFAULTS ON"));
QVERIFY_SQL(q, exec("SET IMPLICIT_TRANSACTIONS OFF"));
} else if(tst_Databases::isPostgreSQL(db))
@ -297,14 +270,7 @@ void tst_QSqlDatabase::dropTestTables(QSqlDatabase db)
<< qTableName("testqGetString", __FILE__)
<< qTableName("qtest_sqlguid", __FILE__)
<< qTableName("uint_table", __FILE__)
<< qTableName("uint_test", __FILE__)
<< qTableName("bug_249059", __FILE__);
QSqlQuery q(QString(), db);
if (db.driverName().startsWith("QPSQL")) {
q.exec("drop schema " + qTableName("qtestschema", __FILE__) + " cascade");
q.exec("drop schema " + qTableName("qtestScHeMa", __FILE__) + " cascade");
}
<< qTableName("uint_test", __FILE__);
if (testWhiteSpaceNames(db.driverName()))
tableNames << db.driver()->escapeIdentifier(qTableName("qtest", __FILE__) + " test", QSqlDriver::TableName);
@ -383,36 +349,6 @@ void tst_QSqlDatabase::addDatabase()
QVERIFY(!QSqlDatabase::contains("INVALID_CONNECTION"));
}
void tst_QSqlDatabase::errorReporting_data()
{
QTest::addColumn<QString>("driver");
QTest::newRow("QMYSQL") << QString::fromLatin1("QMYSQL");
QTest::newRow("QPSQL") << QString::fromLatin1("QPSQL");
}
void tst_QSqlDatabase::errorReporting()
{
QFETCH(QString, driver);
if (!QSqlDatabase::drivers().contains(driver))
QSKIP(QString::fromLatin1("Database driver %1 not available").arg(driver).toLocal8Bit().constData(), SkipSingle);
const QString dbName = QLatin1String("errorReportingDb-") + driver;
QSqlDatabase db = QSqlDatabase::addDatabase(driver, dbName);
db.setHostName(QLatin1String("127.0.0.1"));
db.setDatabaseName(QLatin1String("NonExistantDatabase"));
db.setUserName(QLatin1String("InvalidUser"));
db.setPassword(QLatin1String("IncorrectPassword"));
QVERIFY(!db.open());
db = QSqlDatabase();
QSqlDatabase::removeDatabase(dbName);
}
void tst_QSqlDatabase::open()
{
QFETCH(QString, dbName);
@ -447,9 +383,6 @@ void tst_QSqlDatabase::tables()
bool tempTables = false;
QSqlQuery q(db);
if ( db.driverName().startsWith( "QMYSQL" ) && tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt()<5 )
QSKIP( "Test requires MySQL >= 5.0", SkipSingle );
if (!q.exec("CREATE VIEW " + qtest_view + " as select * from " + qtest)) {
qDebug() << "DBMS '" << tst_Databases::dbToString(db) << "' cannot handle VIEWs:"
@ -492,10 +425,6 @@ void tst_QSqlDatabase::tables()
if (tempTables)
QVERIFY(tables.contains(temp_tab, Qt::CaseInsensitive));
QVERIFY(tables.contains(qtest, Qt::CaseInsensitive));
if (db.driverName().startsWith("QPSQL")) {
QVERIFY(tables.contains(qtest + " test"));
}
}
void tst_QSqlDatabase::whitespaceInIdentifiers()
@ -581,8 +510,6 @@ void tst_QSqlDatabase::record()
void tst_QSqlDatabase::testRecord(const FieldDef fieldDefs[], const QSqlRecord& inf, QSqlDatabase db)
{
int i = 0;
if (!tst_Databases::autoFieldName(db).isEmpty()) // Currently only MySQL is tested
QVERIFY2(inf.field(i).isAutoValue(), qPrintable(inf.field(i).name() + " should be reporting as an autovalue"));
for (i = 0; !fieldDefs[ i ].typeName.isNull(); ++i) {
QCOMPARE(inf.field(i+1).name().toUpper(), fieldDefs[ i ].fieldName().toUpper());
if (inf.field(i+1).type() != fieldDefs[ i ].type) {
@ -611,146 +538,6 @@ void tst_QSqlDatabase::commonFieldTest(const FieldDef fieldDefs[], QSqlDatabase
QVERIFY_SQL(q, exec("select * from " + qTableName("qtestfields", __FILE__)));
}
void tst_QSqlDatabase::recordPSQL()
{
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
FieldDef byteadef;
if (db.driver()->hasFeature(QSqlDriver::BLOB))
byteadef = FieldDef("bytea", QVariant::ByteArray, QByteArray("bl\\ah"));
static FieldDef fieldDefs[] = {
FieldDef("bigint", QVariant::LongLong, Q_INT64_C(9223372036854775807)),
FieldDef("bigserial", QVariant::LongLong, 100, false),
FieldDef("bit", QVariant::String, "1"), // a bit in postgres is a bit-string
FieldDef("box", QVariant::String, "(5,6),(1,2)"),
FieldDef("char(20)", QVariant::String, "blah5678901234567890"),
FieldDef("varchar(20)", QVariant::String, "blah5678901234567890"),
FieldDef("cidr", QVariant::String, "12.123.0.0/24"),
FieldDef("circle", QVariant::String, "<(1,2),3>"),
FieldDef("date", QVariant::Date, QDate::currentDate()),
FieldDef("float8", QVariant::Double, 1.12345678912),
FieldDef("inet", QVariant::String, "12.123.12.23"),
FieldDef("integer", QVariant::Int, 2147483647),
FieldDef("interval", QVariant::String, "1 day 12:59:10"),
// LOL... you can create a "line" datatype in PostgreSQL <= 7.2.x but
// as soon as you want to insert data you get a "not implemented yet" error
// FieldDef("line", QVariant::Polygon, QPolygon(QRect(1, 2, 3, 4))),
FieldDef("lseg", QVariant::String, "[(1,1),(2,2)]"),
FieldDef("macaddr", QVariant::String, "08:00:2b:01:02:03"),
FieldDef("money", QVariant::String, "$12.23"),
FieldDef("numeric", QVariant::Double, 1.2345678912),
FieldDef("path", QVariant::String, "((1,2),(3,2),(3,5),(1,5))"),
FieldDef("point", QVariant::String, "(1,2)"),
FieldDef("polygon", QVariant::String, "((1,2),(3,2),(3,5),(1,5))"),
FieldDef("real", QVariant::Double, 1.1234),
FieldDef("smallint", QVariant::Int, 32767),
FieldDef("serial", QVariant::Int, 100, false),
FieldDef("text", QVariant::String, "blah"),
FieldDef("time(6)", QVariant::Time, QTime(1, 2, 3)),
FieldDef("timetz", QVariant::Time, QTime(1, 2, 3)),
FieldDef("timestamp(6)", QVariant::DateTime, QDateTime::currentDateTime()),
FieldDef("timestamptz", QVariant::DateTime, QDateTime::currentDateTime()),
byteadef,
FieldDef()
};
QSqlQuery q(db);
if(tst_Databases::isPostgreSQL(db))
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
q.exec("drop sequence " + qTableName("qtestfields", __FILE__) + "_t_bigserial_seq");
q.exec("drop sequence " + qTableName("qtestfields", __FILE__) + "_t_serial_seq");
// older psql cut off the table name
q.exec("drop sequence " + qTableName("qtestfields", __FILE__).left(15) + "_t_bigserial_seq");
q.exec("drop sequence " + qTableName("qtestfields", __FILE__).left(18) + "_t_serial_seq");
const int fieldCount = createFieldTable(fieldDefs, db);
QVERIFY(fieldCount > 0);
commonFieldTest(fieldDefs, db, fieldCount);
for (int i = 0; i < ITERATION_COUNT; ++i) {
// increase serial values
for (int i2 = 0; !fieldDefs[ i2 ].typeName.isNull(); ++i2) {
if (fieldDefs[ i2 ].typeName == "serial" ||
fieldDefs[ i2 ].typeName == "bigserial") {
FieldDef def = fieldDefs[ i2 ];
def.val = def.val.toInt() + 1;
fieldDefs[ i2 ] = def;
}
}
}
}
void tst_QSqlDatabase::recordMySQL()
{
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
FieldDef bin10, varbin10;
int major = tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt();
int minor = tst_Databases::getMySqlVersion( db ).section( QChar('.'), 1, 1 ).toInt();
int revision = tst_Databases::getMySqlVersion( db ).section( QChar('.'), 2, 2 ).toInt();
int vernum = (major << 16) + (minor << 8) + revision;
/* The below is broken in mysql below 5.0.15
see http://dev.mysql.com/doc/refman/5.0/en/binary-varbinary.html
specifically: Before MySQL 5.0.15, the pad value is space. Values are right-padded
with space on insert, and trailing spaces are removed on select.
*/
if( vernum >= ((5 << 16) + 15) ) {
bin10 = FieldDef("binary(10)", QVariant::ByteArray, QString("123abc "));
varbin10 = FieldDef("varbinary(10)", QVariant::ByteArray, QString("123abcv "));
}
static QDateTime dt(QDate::currentDate(), QTime(1, 2, 3, 0));
static const FieldDef fieldDefs[] = {
FieldDef("tinyint", QVariant::Int, 127),
FieldDef("tinyint unsigned", QVariant::UInt, 255),
FieldDef("smallint", QVariant::Int, 32767),
FieldDef("smallint unsigned", QVariant::UInt, 65535),
FieldDef("mediumint", QVariant::Int, 8388607),
FieldDef("mediumint unsigned", QVariant::UInt, 16777215),
FieldDef("integer", QVariant::Int, 2147483647),
FieldDef("integer unsigned", QVariant::UInt, 4294967295u),
FieldDef("bigint", QVariant::LongLong, Q_INT64_C(9223372036854775807)),
FieldDef("bigint unsigned", QVariant::ULongLong, Q_UINT64_C(18446744073709551615)),
FieldDef("float", QVariant::Double, 1.12345),
FieldDef("double", QVariant::Double, 1.123456789),
FieldDef("decimal(10, 9)", QVariant::Double,1.123456789),
FieldDef("numeric(5, 2)", QVariant::Double, 123.67),
FieldDef("date", QVariant::Date, QDate::currentDate()),
FieldDef("datetime", QVariant::DateTime, dt),
FieldDef("timestamp", QVariant::DateTime, dt, false),
FieldDef("time", QVariant::Time, dt.time()),
FieldDef("year", QVariant::Int, 2003),
FieldDef("char(20)", QVariant::String, "Blah"),
FieldDef("varchar(20)", QVariant::String, "BlahBlah"),
FieldDef("tinytext", QVariant::String, QString("blah5")),
FieldDef("text", QVariant::String, QString("blah6")),
FieldDef("mediumtext", QVariant::String, QString("blah7")),
FieldDef("longtext", QVariant::String, QString("blah8")),
// SET OF?
FieldDef()
};
const int fieldCount = createFieldTable(fieldDefs, db);
QVERIFY(fieldCount > 0);
commonFieldTest(fieldDefs, db, fieldCount);
QSqlQuery q(db);
QVERIFY_SQL(q, exec("SELECT DATE_SUB(CURDATE(), INTERVAL 2 DAY)"));
QVERIFY(q.next());
QCOMPARE(q.value(0).toDateTime().date(), QDate::currentDate().addDays(-2));
}
void tst_QSqlDatabase::recordSQLite()
{
QFETCH(QString, dbName);
@ -876,12 +663,7 @@ void tst_QSqlDatabase::transaction()
QCOMPARE(q.value(0).toInt(), 41);
q.clear(); // for SQLite which does not allow any references on rows that shall be rolled back
if (!db.rollback()) {
if (db.driverName().startsWith("QMYSQL")) {
qDebug() << "MySQL:" << tst_Databases::printError(db.lastError());
QSKIP("MySQL transaction failed ", SkipSingle); //non-fatal
} else {
QFAIL("Could not rollback transaction: " + tst_Databases::printError(db.lastError()));
}
QFAIL("Could not rollback transaction: " + tst_Databases::printError(db.lastError()));
}
QVERIFY_SQL(q, exec("select * from " + qtest + " where id = 41"));
@ -903,9 +685,7 @@ void tst_QSqlDatabase::bigIntField()
QSqlQuery q(db);
q.setForwardOnly(true);
if (drvName.startsWith("QMYSQL")) {
QVERIFY_SQL(q, exec("create table " + qtest_bigint + " (id int, t_s64bit bigint, t_u64bit bigint unsigned)"));
} else if (drvName.startsWith("QPSQL") || tst_Databases::isSqlServer(db)) {
if (tst_Databases::isSqlServer(db)) {
QVERIFY_SQL(q, exec("create table " + qtest_bigint + "(id int, t_s64bit bigint, t_u64bit bigint)"));
} else {
QSKIP("no 64 bit integer support", SkipAll);
@ -914,26 +694,16 @@ void tst_QSqlDatabase::bigIntField()
qlonglong ll = Q_INT64_C(9223372036854775807);
qulonglong ull = Q_UINT64_C(18446744073709551615);
if (drvName.startsWith("QMYSQL")) {
q.bindValue(0, 0);
q.bindValue(1, ll);
q.bindValue(2, ull);
QVERIFY_SQL(q, exec());
q.bindValue(0, 1);
q.bindValue(1, -ll);
q.bindValue(2, ull);
QVERIFY_SQL(q, exec());
} else {
// usinged bigint fields not supported - a cast is necessary
q.bindValue(0, 0);
q.bindValue(1, ll);
q.bindValue(2, (qlonglong) ull);
QVERIFY_SQL(q, exec());
q.bindValue(0, 1);
q.bindValue(1, -ll);
q.bindValue(2, (qlonglong) ull);
QVERIFY_SQL(q, exec());
}
// usinged bigint fields not supported - a cast is necessary
q.bindValue(0, 0);
q.bindValue(1, ll);
q.bindValue(2, (qlonglong) ull);
QVERIFY_SQL(q, exec());
q.bindValue(0, 1);
q.bindValue(1, -ll);
q.bindValue(2, (qlonglong) ull);
QVERIFY_SQL(q, exec());
QVERIFY(q.exec("select * from " + qtest_bigint + " order by id"));
QVERIFY(q.next());
QCOMPARE(q.value(1).toDouble(), (double)ll);
@ -951,9 +721,7 @@ void tst_QSqlDatabase::caseSensivity()
CHECK_DATABASE(db);
bool cs = false;
if (db.driverName().startsWith("QMYSQL")
|| db.driverName().startsWith("QSQLITE")
|| db.driverName().startsWith("QTDS")
if (db.driverName().startsWith("QSQLITE")
|| db.driverName().startsWith("QODBC"))
cs = true;
@ -990,146 +758,6 @@ void tst_QSqlDatabase::noEscapedFieldNamesInRecord()
QCOMPARE(q.record().fieldName(0), fieldname);
}
void tst_QSqlDatabase::psql_schemas()
{
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
if (!db.tables(QSql::SystemTables).contains("pg_namespace"))
QSKIP("server does not support schemas", SkipSingle);
QSqlQuery q(db);
if(tst_Databases::isPostgreSQL(db)) {
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
}
QVERIFY_SQL(q, exec("CREATE SCHEMA " + qTableName("qtestschema", __FILE__)));
QString table = qTableName("qtestschema", __FILE__) + '.' + qTableName("qtesttable", __FILE__);
QVERIFY_SQL(q, exec("CREATE TABLE " + table + " (id int primary key, name varchar(20))"));
QVERIFY(db.tables().contains(table));
QSqlRecord rec = db.record(table);
QCOMPARE(rec.count(), 2);
QCOMPARE(rec.fieldName(0), QString("id"));
QCOMPARE(rec.fieldName(1), QString("name"));
QSqlIndex idx = db.primaryIndex(table);
QCOMPARE(idx.count(), 1);
QCOMPARE(idx.fieldName(0), QString("id"));
}
void tst_QSqlDatabase::psql_escapedIdentifiers()
{
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
QSqlDriver* drv = db.driver();
CHECK_DATABASE(db);
if (!db.tables(QSql::SystemTables).contains("pg_namespace"))
QSKIP("server does not support schemas", SkipSingle);
QSqlQuery q(db);
if(tst_Databases::isPostgreSQL(db))
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
const QString schemaName(qTableName("qtestScHeMa", __FILE__)),
tableName(qTableName("qtest", __FILE__)),
field1Name(QLatin1String("fIeLdNaMe")),
field2Name(QLatin1String("ZuLu"));
q.exec(QString("DROP SCHEMA \"%1\" CASCADE").arg(schemaName));
QString createSchema = QString("CREATE SCHEMA \"%1\"").arg(schemaName);
QVERIFY_SQL(q, exec(createSchema));
QString createTable = QString("CREATE TABLE \"%1\".\"%2\" (\"%3\" int PRIMARY KEY, \"%4\" varchar(20))").arg(schemaName).arg(tableName).arg(field1Name).arg(field2Name);
QVERIFY_SQL(q, exec(createTable));
QVERIFY(db.tables().contains(schemaName + '.' + tableName, Qt::CaseSensitive));
QSqlField fld1(field1Name, QVariant::Int);
QSqlField fld2(field2Name, QVariant::String);
QSqlRecord rec;
rec.append(fld1);
rec.append(fld2);
QVERIFY_SQL(q, exec(drv->sqlStatement(QSqlDriver::SelectStatement, db.driver()->escapeIdentifier(schemaName, QSqlDriver::TableName) + '.' + db.driver()->escapeIdentifier(tableName, QSqlDriver::TableName), rec, false)));
rec = q.record();
QCOMPARE(rec.count(), 2);
QCOMPARE(rec.fieldName(0), field1Name);
QCOMPARE(rec.fieldName(1), field2Name);
QCOMPARE(rec.field(0).type(), QVariant::Int);
q.exec(QString("DROP SCHEMA \"%1\" CASCADE").arg(schemaName));
}
void tst_QSqlDatabase::psql_escapeBytea()
{
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
const char dta[4] = {'\x71', '\x14', '\x32', '\x81'};
QByteArray ba(dta, 4);
QSqlQuery q(db);
const QString tableName(qTableName("batable", __FILE__));
QVERIFY_SQL(q, exec(QString("CREATE TABLE %1 (ba bytea)").arg(tableName)));
QSqlQuery iq(db);
QVERIFY_SQL(iq, prepare(QString("INSERT INTO %1 VALUES (?)").arg(tableName)));
iq.bindValue(0, QVariant(ba));
QVERIFY_SQL(iq, exec());
QVERIFY_SQL(q, exec(QString("SELECT ba FROM %1").arg(tableName)));
QVERIFY_SQL(q, next());
QByteArray res = q.value(0).toByteArray();
int i = 0;
for (; i < ba.size(); ++i){
if (ba[i] != res[i])
break;
}
QCOMPARE(i, 4);
}
void tst_QSqlDatabase::bug_249059()
{
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
QSqlQuery q(db);
const QString tableName(qTableName("bug_249059", __FILE__));
QVERIFY_SQL(q, exec(QString("CREATE TABLE %1 (dt timestamp, t time)").arg(tableName)));
QSqlQuery iq(db);
QVERIFY_SQL(iq, prepare(QString("INSERT INTO %1 VALUES (?, ?)").arg(tableName)));
iq.bindValue(0, QVariant(QString("2001-09-09 04:05:06.789 -5:00")));
iq.bindValue(1, QVariant(QString("04:05:06.789 -5:00")));
QVERIFY_SQL(iq, exec());
iq.bindValue(0, QVariant(QString("2001-09-09 04:05:06.789 +5:00")));
iq.bindValue(1, QVariant(QString("04:05:06.789 +5:00")));
QVERIFY_SQL(iq, exec());
QVERIFY_SQL(q, exec(QString("SELECT dt, t FROM %1").arg(tableName)));
QVERIFY_SQL(q, next());
QDateTime dt1=q.value(0).toDateTime();
QTime t1=q.value(1).toTime();
QVERIFY_SQL(q, next());
QDateTime dt2=q.value(0).toDateTime();
QTime t2=q.value(1).toTime();
// These will fail when timezone support is added, when that's the case, set the second record to 14:05:06.789 and it should work correctly
QCOMPARE(dt1, dt2);
QCOMPARE(t1, t2);
}
// This test should be rewritten to work with Oracle as well - or the Oracle driver
// should be fixed to make this test pass (handle overflows)
void tst_QSqlDatabase::precisionPolicy()
@ -1137,7 +765,6 @@ void tst_QSqlDatabase::precisionPolicy()
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
// DBMS_SPECIFIC(db, "QPSQL");
QSqlQuery q(db);
const QString tableName(qTableName("qtest_prec", __FILE__));
@ -1410,22 +1037,6 @@ void tst_QSqlDatabase::odbc_testqGetString()
QCOMPARE(q.value(1).toString().length(), 65538);
}
void tst_QSqlDatabase::mysql_multiselect()
{
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
const QString qtest(qTableName("qtest", __FILE__));
QSqlQuery q(db);
QVERIFY_SQL(q, exec("SELECT * FROM " + qtest + "; SELECT * FROM " + qtest));
QVERIFY_SQL(q, next());
QVERIFY_SQL(q, exec("SELECT * FROM " + qtest + "; SELECT * FROM " + qtest));
QVERIFY_SQL(q, next());
QVERIFY_SQL(q, exec("SELECT * FROM " + qtest));
}
// This test isn't really necessary as SQL_GUID / uniqueidentifier is
// already tested in recordSQLServer().
void tst_QSqlDatabase::odbc_uniqueidentifier()
@ -1539,26 +1150,6 @@ void tst_QSqlDatabase::eventNotification()
db.open();
}
void tst_QSqlDatabase::eventNotificationPSQL()
{
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
QSqlQuery query(db);
QString procedureName = qTableName("posteventProc", __FILE__);
QSqlDriver &driver=*(db.driver());
QVERIFY_SQL(driver, subscribeToNotification(procedureName));
QSignalSpy spy(db.driver(), SIGNAL(notification(const QString&)));
query.exec(QString("NOTIFY \"%1\"").arg(procedureName));
QCoreApplication::processEvents();
QCOMPARE(spy.count(), 1);
QList<QVariant> arguments = spy.takeFirst();
QVERIFY(arguments.at(0).toString() == procedureName);
QVERIFY_SQL(driver, unsubscribeFromNotification(procedureName));
}
void tst_QSqlDatabase::sqlite_bindAndFetchUInt()
{
QFETCH(QString, dbName);
@ -1602,18 +1193,6 @@ void tst_QSqlDatabase::sqlStatementUseIsNull_189093()
QCOMPARE(statment.count("IS NULL", Qt::CaseInsensitive), 2);
}
void tst_QSqlDatabase::mysql_savepointtest()
{
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
QSqlQuery q(db);
QVERIFY_SQL(q, exec("begin"));
QVERIFY_SQL(q, exec("insert into "+qTableName("qtest", __FILE__)+" VALUES (54, 'foo', 'foo', 54.54)"));
QVERIFY_SQL(q, exec("savepoint foo"));
}
void tst_QSqlDatabase::sqlite_enable_cache_mode()
{
QFETCH(QString, dbName);

View file

@ -119,9 +119,6 @@ void tst_QSqlDriver::record()
for (int i = 0; i < fields.count(); ++i)
QCOMPARE(rec.fieldName(i), fields[i]);
if (db.driverName().startsWith("QPSQL"))
tablename = tablename.toLower();
if(!db.driverName().startsWith("QODBC") && !db.databaseName().contains("PostgreSql")) {
//check we can get records using a properly quoted table name
rec = db.driver()->record(db.driver()->escapeIdentifier(tablename,QSqlDriver::TableName));
@ -131,9 +128,6 @@ void tst_QSqlDriver::record()
for (int i = 0; i < fields.count(); ++i)
QCOMPARE(rec.fieldName(i), fields[i]);
if (db.driverName().startsWith("QPSQL"))
tablename = tablename.toUpper();
//check that we can't get records using incorrect tablename casing that's been quoted
rec = db.driver()->record(db.driver()->escapeIdentifier(tablename,QSqlDriver::TableName));
if (tst_Databases::isMySQL(db)
@ -161,9 +155,6 @@ void tst_QSqlDriver::primaryIndex()
//check that we can get the primary index using a quoted tablename
if (db.driverName().startsWith("QPSQL"))
tablename = tablename.toLower();
if(!db.driverName().startsWith("QODBC") && !db.databaseName().contains("PostgreSql")) {
index = db.driver()->primaryIndex(db.driver()->escapeIdentifier(tablename, QSqlDriver::TableName));
QCOMPARE(index.count(), 1);
@ -173,13 +164,9 @@ void tst_QSqlDriver::primaryIndex()
//check that we can not get the primary index using a quoted but incorrect table name casing
if (db.driverName().startsWith("QPSQL"))
tablename = tablename.toUpper();
index = db.driver()->primaryIndex(db.driver()->escapeIdentifier(tablename, QSqlDriver::TableName));
if (tst_Databases::isMySQL(db)
|| db.driverName().startsWith("QSQLITE")
|| db.driverName().startsWith("QTDS")
|| tst_Databases::isSqlServer(db)
|| tst_Databases::isMSAccess(db))
QCOMPARE(index.count(), 1); //mysql will always find the table name regardless of casing

View file

@ -105,8 +105,6 @@ private slots:
void char1SelectUnicode();
void synonyms_data() { generic_data(); }
void synonyms();
void mysqlOutValues_data() { generic_data("QMYSQL"); }
void mysqlOutValues();
void prepare_bind_exec_data() { generic_data(); }
void prepare_bind_exec();
void prepared_select_data() { generic_data(); }
@ -125,12 +123,8 @@ private slots:
void lastQuery();
void bindBool_data() { generic_data(); }
void bindBool();
void bindWithDoubleColonCastOperator_data() { generic_data(); }
void bindWithDoubleColonCastOperator();
void queryOnInvalidDatabase_data() { generic_data(); }
void queryOnInvalidDatabase();
void createQueryOnClosedDatabase_data() { generic_data(); }
void createQueryOnClosedDatabase();
void seekForwardOnlyQuery_data() { generic_data(); }
void seekForwardOnlyQuery();
void reExecutePreparedForwardOnlyQuery_data() { generic_data(); }
@ -151,23 +145,12 @@ private slots:
void task_250026_data() { generic_data("QODBC"); }
void task_250026();
void task_205701_data() { generic_data("QMYSQL"); }
void task_205701();
void task_233829_data() { generic_data("QPSQL"); }
void task_233829();
void sqlServerReturn0_data() { generic_data(); }
void sqlServerReturn0();
void QTBUG_5251_data() { generic_data("QPSQL"); }
void QTBUG_5251();
void QTBUG_6618_data() { generic_data("QODBC"); }
void QTBUG_6618();
void QTBUG_6852_data() { generic_data("QMYSQL"); }
void QTBUG_6852();
void QTBUG_5765_data() { generic_data("QMYSQL"); }
void QTBUG_5765();
void QTBUG_21884_data() { generic_data("QSQLITE"); }
void QTBUG_21884();
void QTBUG_16967_data() { generic_data("QSQLITE"); }
@ -297,9 +280,6 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db )
<< qTableName("test141895", __FILE__)
<< qTableName( "bug2192", __FILE__);
if ( db.driverName().startsWith("QPSQL") )
tablenames << qTableName("task_233829", __FILE__);
if ( db.driverName().startsWith("QSQLITE") )
tablenames << qTableName( "record_sqlite", __FILE__ );
@ -319,17 +299,13 @@ void tst_QSqlQuery::createTestTables( QSqlDatabase db )
{
QSqlQuery q( db );
if ( db.driverName().startsWith( "QMYSQL" ) )
// ### stupid workaround until we find a way to hardcode this
// in the MySQL server startup script
q.exec( "set table_type=innodb" );
else if(tst_Databases::isPostgreSQL(db))
if(tst_Databases::isPostgreSQL(db))
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
if(tst_Databases::isPostgreSQL(db))
QVERIFY_SQL( q, exec( "create table " + qtest + " (id serial NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id)) WITH OIDS" ) );
else
QVERIFY_SQL( q, exec( "create table " + qtest + " (id int "+tst_Databases::autoFieldName(db) +" NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id))" ) );
QVERIFY_SQL( q, exec( "create table " + qtest + " (id int NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id))" ) );
if ( tst_Databases::isSqlServer( db ) )
QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_null", __FILE__ ) + " (id int null, t_varchar varchar(20) null)" ) );
@ -385,19 +361,11 @@ void tst_QSqlQuery::char1SelectUnicode()
QString uniStr( QChar(0x0915) ); // DEVANAGARI LETTER KA
QSqlQuery q( db );
if ( db.driverName().startsWith( "QMYSQL" ) && tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt()<5 )
QSKIP( "Test requires MySQL >= 5.0", SkipSingle );
QString createQuery;
const QString char1SelectUnicode(qTableName( "char1SU", __FILE__ ));
if ( tst_Databases::isSqlServer( db ) )
createQuery = "create table " + char1SelectUnicode + "(id nchar(1))";
else if ( db.driverName().startsWith( "QPSQL" ) )
createQuery = "create table " + char1SelectUnicode + " (id char(3))";
else if ( db.driverName().startsWith( "QMYSQL" ) )
createQuery = "create table " + char1SelectUnicode + " (id char(1)) "
"default character set 'utf8'";
else
createQuery = "create table " + char1SelectUnicode + " (id char(1))";
@ -424,57 +392,6 @@ void tst_QSqlQuery::char1SelectUnicode()
QSKIP( "Database not unicode capable", SkipSingle );
}
void tst_QSqlQuery::mysqlOutValues()
{
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
const QString hello(qTableName( "hello", __FILE__ )), qtestproc(qTableName( "qtestproc", __FILE__ ));
QSqlQuery q( db );
if ( db.driverName().startsWith( "QMYSQL" ) && tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt()<5 )
QSKIP( "Test requires MySQL >= 5.0", SkipSingle );
q.exec( "drop function " + hello );
QVERIFY_SQL( q, exec( "create function " + hello + " (s char(20)) returns varchar(50) return concat('Hello ', s)" ) );
QVERIFY_SQL( q, exec( "select " + hello + "('world')" ) );
QVERIFY_SQL( q, next() );
QCOMPARE( q.value( 0 ).toString(), QString( "Hello world" ) );
QVERIFY_SQL( q, prepare( "select " + hello + "('harald')" ) );
QVERIFY_SQL( q, exec() );
QVERIFY_SQL( q, next() );
QCOMPARE( q.value( 0 ).toString(), QString( "Hello harald" ) );
QVERIFY_SQL( q, exec( "drop function " + hello ) );
q.exec( "drop procedure " + qtestproc );
QVERIFY_SQL( q, exec( "create procedure " + qtestproc + " () "
"BEGIN select * from " + qtest + " order by id; END" ) );
QVERIFY_SQL( q, exec( "call " + qtestproc + "()" ) );
QVERIFY_SQL( q, next() );
QCOMPARE( q.value( 1 ).toString(), QString( "VarChar1" ) );
QVERIFY_SQL( q, exec( "drop procedure " + qtestproc ) );
QVERIFY_SQL( q, exec( "create procedure " + qtestproc + " (OUT param1 INT) "
"BEGIN set param1 = 42; END" ) );
QVERIFY_SQL( q, exec( "call " + qtestproc + " (@out)" ) );
QVERIFY_SQL( q, exec( "select @out" ) );
QCOMPARE( q.record().fieldName( 0 ), QString( "@out" ) );
QVERIFY_SQL( q, next() );
QCOMPARE( q.value( 0 ).toInt(), 42 );
QVERIFY_SQL( q, exec( "drop procedure " + qtestproc ) );
}
void tst_QSqlQuery::bindBool()
{
// QTBUG-27763: bool value got converted to int 127 by mysql driver becuase sizeof(bool) < sizeof(int).
@ -1086,14 +1003,8 @@ void tst_QSqlQuery::precision()
while ( precStr[i] != 0 && *( precStr + i ) == val[i].toLatin1() )
i++;
// MySQL and TDS have crappy precisions by default
if ( db.driverName().startsWith( "QMYSQL" ) ) {
if ( i < 17 )
QWARN( "MySQL didn't return the right precision" );
} else {
QWARN( QString( tst_Databases::dbToString( db ) + " didn't return the right precision (" +
QString::number( i ) + " out of 21), " + val ).toLatin1() );
}
QWARN( QString( tst_Databases::dbToString( db ) + " didn't return the right precision (" +
QString::number( i ) + " out of 21), " + val ).toLatin1() );
}
} // SQLITE scope
}
@ -1136,9 +1047,6 @@ void tst_QSqlQuery::transaction()
// this is the standard SQL
QString startTransactionStr( "start transaction" );
if ( db.driverName().startsWith( "QMYSQL" ) )
startTransactionStr = "begin work";
QSqlQuery q( db );
QSqlQuery q2( db );
@ -1174,11 +1082,7 @@ void tst_QSqlQuery::transaction()
QCOMPARE( q.value( 0 ).toInt(), 41 );
if ( !q.exec( "rollback" ) ) {
if ( db.driverName().startsWith( "QMYSQL" ) ) {
qDebug( "MySQL: %s", qPrintable(tst_Databases::printError( q.lastError() ) ) );
QSKIP( "MySQL transaction failed ", SkipSingle ); //non-fatal
} else
QFAIL( "Could not rollback transaction: " + tst_Databases::printError( q.lastError() ) );
QFAIL( "Could not rollback transaction: " + tst_Databases::printError( q.lastError() ) );
}
QVERIFY_SQL( q, exec( "select * from" + qtest + " where id = 41" ) );
@ -1283,9 +1187,6 @@ void tst_QSqlQuery::prepare_bind_exec()
QSqlQuery q( db );
if ( db.driverName().startsWith( "QMYSQL" ) && tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt()<5 )
useUnicode = false;
QString createQuery;
if(tst_Databases::isPostgreSQL(db))
@ -1793,40 +1694,6 @@ void tst_QSqlQuery::lastQuery()
QCOMPARE( q.executedQuery(), sql );
}
void tst_QSqlQuery::bindWithDoubleColonCastOperator()
{
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
// Only PostgreSQL support the double-colon cast operator
if ( !db.driverName().startsWith( "QPSQL" ) ) {
QSKIP( "Test requires PostgreSQL", SkipSingle );
return;
}
const QString tablename(qTableName( "bindtest", __FILE__ ));
QSqlQuery q( db );
QVERIFY_SQL( q, exec( "create table " + tablename + " (id1 int, id2 int, id3 int, fld1 int, fld2 int)" ) );
QVERIFY_SQL( q, exec( "insert into " + tablename + " values (1, 2, 3, 10, 5)" ) );
QVERIFY_SQL( q, prepare( "select sum((fld1 - fld2)::int) from " + tablename + " where id1 = :myid1 and id2 =:myid2 and id3=:myid3" ) );
q.bindValue( ":myid1", 1 );
q.bindValue( ":myid2", 2 );
q.bindValue( ":myid3", 3 );
QVERIFY_SQL( q, exec() );
QVERIFY_SQL( q, next() );
if ( db.driver()->hasFeature( QSqlDriver::PreparedQueries ) )
QCOMPARE( q.executedQuery(), QString( "select sum((fld1 - fld2)::int) from " + tablename + " where id1 = ? and id2 =? and id3=?" ) );
else
QCOMPARE( q.executedQuery(), QString( "select sum((fld1 - fld2)::int) from " + tablename + " where id1 = 1 and id2 =2 and id3=3" ) );
}
/* For task 157397: Using QSqlQuery with an invalid QSqlDatabase
does not set the last error of the query.
This test function will output some warnings, that's ok.
@ -1856,40 +1723,6 @@ void tst_QSqlQuery::queryOnInvalidDatabase()
}
}
/* For task 159138: Error on instantiating a sql-query before explicitly
opening the database. This is something we don't support, so this isn't
really a bug. However some of the drivers are nice enough to support it.
*/
void tst_QSqlQuery::createQueryOnClosedDatabase()
{
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
// Only supported by these drivers
if ( !db.driverName().startsWith( "QPSQL" )
&& !db.driverName().startsWith( "QMYSQL" ) ) {
QSKIP( "Test is specific for PostgreSQL and MySql", SkipSingle );
return;
}
db.close();
QSqlQuery q( db );
db.open();
QVERIFY_SQL( q, exec( QString( "select * from %1 where id = 1" ).arg( qtest ) ) );
QVERIFY_SQL( q, next() );
QCOMPARE( q.value( 0 ).toInt(), 1 );
QCOMPARE( q.value( 1 ).toString().trimmed(), QLatin1String( "VarChar1" ) );
QCOMPARE( q.value( 2 ).toString().trimmed(), QLatin1String( "Char1" ) );
db.close();
QVERIFY2( !q.exec( QString( "select * from %1 where id = 1" ).arg( qtest ) ),
qPrintable( QString( "This can't happen! The query should not have been executed!" ) ) );
}
void tst_QSqlQuery::reExecutePreparedForwardOnlyQuery()
{
QFETCH( QString, dbName );
@ -2009,15 +1842,6 @@ void tst_QSqlQuery::nextResult()
QSqlQuery q( db );
if ( db.driverName().startsWith( "QMYSQL" ) && tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt()<5 )
QSKIP( "Test requires MySQL >= 5.0", SkipSingle );
enum DriverType { ODBC, MYSQL };
DriverType driverType = ODBC;
if ( db.driverName().startsWith( "QMYSQL" ) )
driverType = MYSQL;
const QString tableName(qTableName( "more_results", __FILE__ ));
QVERIFY_SQL( q, exec( "CREATE TABLE " + tableName + " (id integer, text varchar(20), num numeric(6, 3), empty varchar(10));" ) );
@ -2049,8 +1873,7 @@ void tst_QSqlQuery::nextResult()
// Query that returns two result sets (batch sql)
// When working with multiple result sets SQL Server insists on non-scrollable cursors
if ( driverType == ODBC )
q.setForwardOnly( true );
q.setForwardOnly( true );
QVERIFY_SQL( q, exec( "SELECT id FROM " + tableName + "; SELECT text, num FROM " + tableName + ';' ) );
@ -2070,10 +1893,7 @@ void tst_QSqlQuery::nextResult()
QCOMPARE( q.record().field( 1 ).name().toUpper(), QString( "NUM" ) );
if ( driverType == MYSQL )
QCOMPARE( q.record().field( 1 ).type(), QVariant::String );
else
QCOMPARE( q.record().field( 1 ).type(), QVariant::Double );
QCOMPARE( q.record().field( 1 ).type(), QVariant::Double );
QVERIFY( q.next() ); // Move to first row of the second result set
@ -2126,24 +1946,12 @@ void tst_QSqlQuery::nextResult()
q.exec( QString( "DROP PROCEDURE %1;" ).arg( procName ) );
if ( driverType == MYSQL )
QVERIFY_SQL( q, exec( QString( "CREATE PROCEDURE %1()"
"\nBEGIN"
"\nSELECT id, text FROM %2;"
"\nSELECT empty, num, text, id FROM %3;"
"\nEND" ).arg( procName ).arg( tableName ).arg( tableName ) ) );
else
QVERIFY_SQL( q, exec( QString( "CREATE PROCEDURE %1"
"\nAS"
"\nSELECT id, text FROM %2"
"\nSELECT empty, num, text, id FROM %3" ).arg( procName ).arg( tableName ).arg( tableName ) ) );
QVERIFY_SQL( q, exec( QString( "CREATE PROCEDURE %1"
"\nAS"
"\nSELECT id, text FROM %2"
"\nSELECT empty, num, text, id FROM %3" ).arg( procName ).arg( tableName ).arg( tableName ) ) );
if ( driverType == MYSQL ) {
q.setForwardOnly( true );
QVERIFY_SQL( q, exec( QString( "CALL %1()" ).arg( procName ) ) );
} else {
QVERIFY_SQL( q, exec( QString( "EXEC %1" ).arg( procName ) ) );
}
QVERIFY_SQL( q, exec( QString( "EXEC %1" ).arg( procName ) ) );
for ( int i = 0; i < 4; i++ ) {
QVERIFY_SQL( q, next() );
@ -2163,13 +1971,6 @@ void tst_QSqlQuery::nextResult()
QCOMPARE( q.value( 3 ).toInt(), 1+i );
}
// MySQL also counts the CALL itself as a result
if ( driverType == MYSQL ) {
QVERIFY( q.nextResult() );
QVERIFY( !q.isSelect() ); // ... but it's not a select
QCOMPARE( q.numRowsAffected(), 0 ); // ... and no rows are affected (at least not with this procedure)
}
QVERIFY( !q.nextResult() );
QVERIFY( !q.isActive() );
@ -2200,9 +2001,7 @@ void tst_QSqlQuery::blobsPreparedQuery()
// In PostgreSQL a BLOB is not called a BLOB, but a BYTEA! :-)
// ... and in SQL Server it can be called a lot, but IMAGE will do.
QString typeName( "BLOB" );
if ( db.driverName().startsWith( "QPSQL" ) )
typeName = "BYTEA";
else if ( db.driverName().startsWith( "QODBC" ) && tst_Databases::isSqlServer( db ))
if ( db.driverName().startsWith( "QODBC" ) && tst_Databases::isSqlServer( db ))
typeName = "IMAGE";
QVERIFY_SQL( q, exec( QString( "CREATE TABLE %1(id INTEGER, data %2)" ).arg( tableName ).arg( typeName ) ) );
@ -2310,21 +2109,6 @@ void tst_QSqlQuery::task_250026()
QCOMPARE( q.value( 0 ).toString().length(), data1026.length() );
}
void tst_QSqlQuery::task_205701()
{
QSqlDatabase qsdb = QSqlDatabase::addDatabase("QMYSQL", "atest");
qsdb.setHostName("test");
qsdb.setDatabaseName("test");
qsdb.setUserName("test");
qsdb.setPassword("test");
qsdb.open();
// {
QSqlQuery query(qsdb);
// }
QSqlDatabase::removeDatabase("atest");
}
#ifdef NOT_READY_YET
// For task: 229811
void tst_QSqlQuery::task_229811()
@ -2409,25 +2193,6 @@ void tst_QSqlQuery::task_234422()
#endif
void tst_QSqlQuery::task_233829()
{
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
QSqlQuery q( db );
const QString tableName(qTableName("task_233829", __FILE__));
QVERIFY_SQL(q,exec("CREATE TABLE " + tableName + "(dbl1 double precision,dbl2 double precision) without oids;"));
QString queryString("INSERT INTO " + tableName +"(dbl1, dbl2) VALUES(?,?)");
double k = 0.0;
QVERIFY_SQL(q,prepare(queryString));
q.bindValue(0,0.0 / k); // nan
q.bindValue(1,0.0 / k); // nan
QVERIFY_SQL(q,exec());
}
void tst_QSqlQuery::sqlServerReturn0()
{
QFETCH( QString, dbName );
@ -2456,37 +2221,6 @@ void tst_QSqlQuery::sqlServerReturn0()
QVERIFY_SQL(q, next());
}
void tst_QSqlQuery::QTBUG_5251()
{
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
const QString timetest(qTableName("timetest", __FILE__));
if (!db.driverName().startsWith( "QPSQL" )) return;
QSqlQuery q(db);
q.exec("DROP TABLE " + timetest);
QVERIFY_SQL(q, exec("CREATE TABLE " + timetest + " (t TIME)"));
QVERIFY_SQL(q, exec("INSERT INTO " + timetest + " VALUES ('1:2:3.666')"));
QSqlTableModel timetestModel(0,db);
timetestModel.setEditStrategy(QSqlTableModel::OnManualSubmit);
timetestModel.setTable(timetest);
QVERIFY_SQL(timetestModel, select());
QCOMPARE(timetestModel.record(0).field(0).value().toTime().toString("HH:mm:ss.zzz"), QString("01:02:03.666"));
QVERIFY_SQL(timetestModel,setData(timetestModel.index(0, 0), QTime(0,12,34,500)));
QCOMPARE(timetestModel.record(0).field(0).value().toTime().toString("HH:mm:ss.zzz"), QString("00:12:34.500"));
QVERIFY_SQL(timetestModel, submitAll());
QCOMPARE(timetestModel.record(0).field(0).value().toTime().toString("HH:mm:ss.zzz"), QString("00:12:34.500"));
QVERIFY_SQL(q, exec("UPDATE " + timetest + " SET t = '0:11:22.33'"));
QVERIFY_SQL(timetestModel, select());
QCOMPARE(timetestModel.record(0).field(0).value().toTime().toString("HH:mm:ss.zzz"), QString("00:11:22.330"));
}
void tst_QSqlQuery::QTBUG_6618()
{
QFETCH( QString, dbName );
@ -2509,75 +2243,6 @@ void tst_QSqlQuery::QTBUG_6618()
QVERIFY(q.lastError().text().contains(errorString));
}
void tst_QSqlQuery::QTBUG_6852()
{
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
if ( tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt()<5 )
QSKIP( "Test requires MySQL >= 5.0", SkipSingle );
QSqlQuery q(db);
const QString tableName(qTableName("bug6852", __FILE__)), procName(qTableName("bug6852_proc", __FILE__));
QVERIFY_SQL(q, exec("DROP PROCEDURE IF EXISTS "+procName));
QVERIFY_SQL(q, exec("CREATE TABLE "+tableName+"(\n"
"MainKey INT NOT NULL,\n"
"OtherTextCol VARCHAR(45) NOT NULL,\n"
"PRIMARY KEY(`MainKey`))"));
QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" VALUES(0, \"Disabled\")"));
QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" VALUES(5, \"Error Only\")"));
QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" VALUES(10, \"Enabled\")"));
QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" VALUES(15, \"Always\")"));
QVERIFY_SQL(q, exec("CREATE PROCEDURE "+procName+"()\n"
"READS SQL DATA\n"
"BEGIN\n"
" SET @st = 'SELECT MainKey, OtherTextCol from "+tableName+"';\n"
" PREPARE stmt from @st;\n"
" EXECUTE stmt;\n"
"END;"));
QVERIFY_SQL(q, exec("CALL "+procName+"()"));
QVERIFY_SQL(q, next());
QCOMPARE(q.value(0).toInt(), 0);
QCOMPARE(q.value(1).toString(), QLatin1String("Disabled"));
}
void tst_QSqlQuery::QTBUG_5765()
{
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
QSqlQuery q(db);
const QString tableName(qTableName("bug5765", __FILE__));
QVERIFY_SQL(q, exec("CREATE TABLE "+tableName+"(testval TINYINT(1) DEFAULT 0)"));
q.prepare("INSERT INTO "+tableName+" SET testval = :VALUE");
q.bindValue(":VALUE", 1);
QVERIFY_SQL(q, exec());
q.bindValue(":VALUE", 12);
QVERIFY_SQL(q, exec());
q.bindValue(":VALUE", 123);
QVERIFY_SQL(q, exec());
QString sql="select testval from "+tableName;
QVERIFY_SQL(q, exec(sql));
QVERIFY_SQL(q, next());
QCOMPARE(q.value(0).toInt(), 1);
QVERIFY_SQL(q, next());
QCOMPARE(q.value(0).toInt(), 12);
QVERIFY_SQL(q, next());
QCOMPARE(q.value(0).toInt(), 123);
QVERIFY_SQL(q, prepare(sql));
QVERIFY_SQL(q, exec());
QVERIFY_SQL(q, next());
QCOMPARE(q.value(0).toInt(), 1);
QVERIFY_SQL(q, next());
QCOMPARE(q.value(0).toInt(), 12);
QVERIFY_SQL(q, next());
QCOMPARE(q.value(0).toInt(), 123);
}
/**
* This test case tests multiple statements in one execution.
* Sqlite driver doesn't support multiple statement at one time.

View file

@ -86,8 +86,6 @@ private slots:
void emptyTable_data() { generic_data(); }
void emptyTable();
void tablesAndSchemas_data() { generic_data("QPSQL"); }
void tablesAndSchemas();
void whitespaceInIdentifiers_data() { generic_data(); }
void whitespaceInIdentifiers();
void primaryKeyOrder_data() { generic_data("QSQLITE"); }
@ -148,10 +146,6 @@ void tst_QSqlTableModel::dropTestTables()
tableNames << qTableName("qtestw hitespace", db.driver());
tst_Databases::safeDropTables(db, tableNames);
if (db.driverName().startsWith("QPSQL")) {
q.exec("DROP SCHEMA " + qTableName("testschema", __FILE__) + " CASCADE");
}
}
}
@ -950,27 +944,6 @@ void tst_QSqlTableModel::emptyTable()
QCOMPARE(model.columnCount(), 1);
}
void tst_QSqlTableModel::tablesAndSchemas()
{
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
QSqlQuery q(db);
q.exec("DROP SCHEMA " + qTableName("testschema", __FILE__) + " CASCADE");
QVERIFY_SQL( q, exec("create schema " + qTableName("testschema", __FILE__)));
QString tableName = qTableName("testschema", __FILE__) + '.' + qTableName("testtable", __FILE__);
QVERIFY_SQL( q, exec("create table " + tableName + "(id int)"));
QVERIFY_SQL( q, exec("insert into " + tableName + " values(1)"));
QVERIFY_SQL( q, exec("insert into " + tableName + " values(2)"));
QSqlTableModel model(0, db);
model.setTable(tableName);
QVERIFY_SQL(model, select());
QCOMPARE(model.rowCount(), 2);
QCOMPARE(model.columnCount(), 1);
}
void tst_QSqlTableModel::whitespaceInIdentifiers()
{
QFETCH(QString, dbName);

View file

@ -158,9 +158,6 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db )
<< qTableName( QLatin1String("test141895"), __FILE__)
<< qTableName( QLatin1String("qtest_oraOCINumber"), __FILE__);
if ( db.driverName().startsWith( QLatin1String("QPSQL") ) )
tablenames << qTableName( QLatin1String("task_233829"), __FILE__);
if ( db.driverName().startsWith( QLatin1String("QSQLITE") ) )
tablenames << qTableName( QLatin1String("record_sqlite"), __FILE__ );
@ -180,19 +177,15 @@ void tst_QSqlQuery::createTestTables( QSqlDatabase db )
{
QSqlQuery q( db );
if ( db.driverName().startsWith( QLatin1String("QMYSQL") ) )
// ### stupid workaround until we find a way to hardcode this
// in the MySQL server startup script
q.exec( QLatin1String("set table_type=innodb") );
else if (tst_Databases::isPostgreSQL(db))
if (tst_Databases::isPostgreSQL(db))
QVERIFY_SQL( q, exec( QLatin1String("set client_min_messages='warning'") ));
if (tst_Databases::isPostgreSQL(db))
QVERIFY_SQL( q, exec( QLatin1String("create table ") + qtest + QLatin1String(" (id serial NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id)) WITH OIDS") ) );
else
QVERIFY_SQL( q, exec( QLatin1String("create table ") + qtest + QLatin1String(" (id int ") + tst_Databases::autoFieldName(db) + QLatin1String(" NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id))") ) );
QVERIFY_SQL( q, exec( QLatin1String("create table ") + qtest + QLatin1String(" (id int NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id))") ) );
if ( tst_Databases::isSqlServer( db ) || db.driverName().startsWith( QLatin1String("QTDS") ) )
if ( tst_Databases::isSqlServer( db ) )
QVERIFY_SQL( q, exec( QLatin1String("create table ") + qTableName( QLatin1String( "qtest_null"), __FILE__ ) + QLatin1String(" (id int null, t_varchar varchar(20) null)") ) );
else
QVERIFY_SQL( q, exec( QLatin1String("create table ") + qTableName( QLatin1String("qtest_null"), __FILE__ ) + QLatin1String(" (id int, t_varchar varchar(20))") ) );
@ -221,8 +214,6 @@ void tst_QSqlQuery::benchmark()
QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db );
if ( tst_Databases::getMySqlVersion( db ).section( QLatin1Char('.'), 0, 0 ).toInt()<5 )
QSKIP( "Test requires MySQL >= 5.0", SkipSingle );
QSqlQuery q(db);
const QString tableName(qTableName(QLatin1String("benchmark"), __FILE__));

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-07 01:25+0300\n"
"POT-Creation-Date: 2021-09-10 05:02+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -38,11 +38,11 @@ msgstr ""
msgid "The file '%1' is not a valid Katie plugin."
msgstr ""
#: src/core/plugin/qlibrary.cpp:464
#: src/core/plugin/qlibrary.cpp:463
msgid "The plugin uses incompatible Katie library: %1 (%2, %3)"
msgstr ""
#: src/core/plugin/qlibrary.cpp:796 src/core/plugin/qpluginloader.cpp:279
#: src/core/plugin/qlibrary.cpp:795 src/core/plugin/qpluginloader.cpp:279
#: src/core/io/qiodevice.cpp:1519 src/network/ssl/qsslerror.cpp:249
#: src/network/socket/qnativesocketengine.cpp:250
#: src/network/access/qftp.cpp:1414 src/uitools/formscriptrunner.cpp:104
@ -5501,42 +5501,6 @@ msgstr ""
msgid "Could not reset to start position"
msgstr ""
#: src/plugins/sqldrivers/psql/qsql_psql.cpp:184
msgctxt "QPSQLResult"
msgid "Unable to create query"
msgstr ""
#: src/plugins/sqldrivers/psql/qsql_psql.cpp:548
msgctxt "QPSQLResult"
msgid "Unable to prepare statement"
msgstr ""
#: src/plugins/sqldrivers/psql/qsql_psql.cpp:794
#: src/plugins/sqldrivers/odbc/qsql_odbc.cpp:1786
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:1164
msgid "Unable to connect"
msgstr ""
#: src/plugins/sqldrivers/psql/qsql_psql.cpp:843
msgid "Could not begin transaction"
msgstr ""
#: src/plugins/sqldrivers/psql/qsql_psql.cpp:871
msgid "Could not commit transaction"
msgstr ""
#: src/plugins/sqldrivers/psql/qsql_psql.cpp:888
msgid "Could not rollback transaction"
msgstr ""
#: src/plugins/sqldrivers/psql/qsql_psql.cpp:1172
msgid "Unable to subscribe"
msgstr ""
#: src/plugins/sqldrivers/psql/qsql_psql.cpp:1204
msgid "Unable to unsubscribe"
msgstr ""
#: src/plugins/sqldrivers/odbc/qsql_odbc.cpp:887
#: src/plugins/sqldrivers/odbc/qsql_odbc.cpp:1226
msgctxt "QODBCResult"
@ -5587,6 +5551,10 @@ msgctxt "QODBCResult"
msgid "Unable to bind variable"
msgstr ""
#: src/plugins/sqldrivers/odbc/qsql_odbc.cpp:1786
msgid "Unable to connect"
msgstr ""
#: src/plugins/sqldrivers/odbc/qsql_odbc.cpp:1792
msgid "Unable to connect - Driver doesn't support all functionality required"
msgstr ""
@ -5596,13 +5564,11 @@ msgid "Unable to disable autocommit"
msgstr ""
#: src/plugins/sqldrivers/odbc/qsql_odbc.cpp:2082
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:1318
#: src/sql/drivers/qsql_sqlite.cpp:633
msgid "Unable to commit transaction"
msgstr ""
#: src/plugins/sqldrivers/odbc/qsql_odbc.cpp:2099
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:1335
#: src/sql/drivers/qsql_sqlite.cpp:648
msgid "Unable to rollback transaction"
msgstr ""
@ -5611,73 +5577,6 @@ msgstr ""
msgid "Unable to enable autocommit"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:445
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:472
msgctxt "QMYSQLResult"
msgid "Unable to fetch data"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:624
msgctxt "QMYSQLResult"
msgid "Unable to execute query"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:630
msgctxt "QMYSQLResult"
msgid "Unable to store result"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:722
msgctxt "QMYSQLResult"
msgid "Unable to execute next query"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:732
msgctxt "QMYSQLResult"
msgid "Unable to store next result"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:799
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:808
msgctxt "QMYSQLResult"
msgid "Unable to prepare statement"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:840
msgctxt "QMYSQLResult"
msgid "Unable to reset statement"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:931
msgctxt "QMYSQLResult"
msgid "Unable to bind value"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:942
msgctxt "QMYSQLResult"
msgid "Unable to execute statement"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:956
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:977
msgctxt "QMYSQLResult"
msgid "Unable to bind outvalues"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:965
msgctxt "QMYSQLResult"
msgid "Unable to store statement results"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:1153
msgid "Unable to open database '"
msgstr ""
#: src/plugins/sqldrivers/mysql/qsql_mysql.cpp:1301
#: src/sql/drivers/qsql_sqlite.cpp:618
msgid "Unable to begin transaction"
msgstr ""
#: src/scripttools/debugging/qscriptedit.cpp:391
#: src/scripttools/debugging/qscriptdebugger.cpp:1768
msgid "Toggle Breakpoint"
@ -5964,6 +5863,10 @@ msgstr ""
msgid "Error closing database"
msgstr ""
#: src/sql/drivers/qsql_sqlite.cpp:618
msgid "Unable to begin transaction"
msgstr ""
#: src/uitools/formbuilderextra.cpp:349
msgctxt "FormBuilder"
msgid "Invalid stretch value for '%1': '%2'"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-07 01:25+0300\n"
"POT-Creation-Date: 2021-09-10 05:02+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"