| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/sql/kernel/qsqldriver.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | static QString prepareIdentifier(const QString &identifier, | - | ||||||||||||
| 6 | QSqlDriver::IdentifierType type, const QSqlDriver *driver) | - | ||||||||||||
| 7 | { | - | ||||||||||||
| 8 | ((!(driver != __null)) ? qt_assert("driver != NULL",__FILE__,48) : qt_noop()); | - | ||||||||||||
| 9 | QString ret = identifier; | - | ||||||||||||
| 10 | if (!driver->isIdentifierEscaped(identifier, type)
| 10-1324 | ||||||||||||
| 11 | ret = driver->escapeIdentifier(identifier, type); | - | ||||||||||||
| 12 | } executed 1324 times by 4 tests: end of blockExecuted by:
| 1324 | ||||||||||||
| 13 | return executed 1334 times by 4 tests: ret;return ret;Executed by:
executed 1334 times by 4 tests: return ret;Executed by:
| 1334 | ||||||||||||
| 14 | } | - | ||||||||||||
| 15 | QSqlDriver::QSqlDriver(QObject *parent) | - | ||||||||||||
| 16 | : QObject(*new QSqlDriverPrivate, parent) | - | ||||||||||||
| 17 | { | - | ||||||||||||
| 18 | } executed 20 times by 10 tests: end of blockExecuted by:
| 20 | ||||||||||||
| 19 | - | |||||||||||||
| 20 | - | |||||||||||||
| 21 | - | |||||||||||||
| 22 | QSqlDriver::QSqlDriver(QSqlDriverPrivate &dd, QObject *parent) | - | ||||||||||||
| 23 | : QObject(dd, parent) | - | ||||||||||||
| 24 | { | - | ||||||||||||
| 25 | } executed 32 times by 9 tests: end of blockExecuted by:
| 32 | ||||||||||||
| 26 | - | |||||||||||||
| 27 | - | |||||||||||||
| 28 | - | |||||||||||||
| 29 | - | |||||||||||||
| 30 | - | |||||||||||||
| 31 | QSqlDriver::~QSqlDriver() | - | ||||||||||||
| 32 | { | - | ||||||||||||
| 33 | } | - | ||||||||||||
| 34 | bool QSqlDriver::isOpen() const | - | ||||||||||||
| 35 | { | - | ||||||||||||
| 36 | return executed 8317 times by 12 tests: d_func()->isOpen;return d_func()->isOpen;Executed by:
executed 8317 times by 12 tests: return d_func()->isOpen;Executed by:
| 8317 | ||||||||||||
| 37 | } | - | ||||||||||||
| 38 | - | |||||||||||||
| 39 | - | |||||||||||||
| 40 | - | |||||||||||||
| 41 | - | |||||||||||||
| 42 | - | |||||||||||||
| 43 | - | |||||||||||||
| 44 | bool QSqlDriver::isOpenError() const | - | ||||||||||||
| 45 | { | - | ||||||||||||
| 46 | return executed 5602 times by 9 tests: d_func()->isOpenError;return d_func()->isOpenError;Executed by:
executed 5602 times by 9 tests: return d_func()->isOpenError;Executed by:
| 5602 | ||||||||||||
| 47 | } | - | ||||||||||||
| 48 | void QSqlDriver::setOpen(bool open) | - | ||||||||||||
| 49 | { | - | ||||||||||||
| 50 | d_func()->isOpen = open; | - | ||||||||||||
| 51 | } executed 89 times by 10 tests: end of blockExecuted by:
| 89 | ||||||||||||
| 52 | void QSqlDriver::setOpenError(bool error) | - | ||||||||||||
| 53 | { | - | ||||||||||||
| 54 | d_func()->isOpenError = error; | - | ||||||||||||
| 55 | if (error
| 3-89 | ||||||||||||
| 56 | d_func()->isOpen = false; executed 3 times by 1 test: d_func()->isOpen = false;Executed by:
| 3 | ||||||||||||
| 57 | } executed 92 times by 10 tests: end of blockExecuted by:
| 92 | ||||||||||||
| 58 | bool QSqlDriver::beginTransaction() | - | ||||||||||||
| 59 | { | - | ||||||||||||
| 60 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 61 | } | - | ||||||||||||
| 62 | bool QSqlDriver::commitTransaction() | - | ||||||||||||
| 63 | { | - | ||||||||||||
| 64 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 65 | } | - | ||||||||||||
| 66 | bool QSqlDriver::rollbackTransaction() | - | ||||||||||||
| 67 | { | - | ||||||||||||
| 68 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 69 | } | - | ||||||||||||
| 70 | void QSqlDriver::setLastError(const QSqlError &error) | - | ||||||||||||
| 71 | { | - | ||||||||||||
| 72 | d_func()->error = error; | - | ||||||||||||
| 73 | } executed 37 times by 9 tests: end of blockExecuted by:
| 37 | ||||||||||||
| 74 | - | |||||||||||||
| 75 | - | |||||||||||||
| 76 | - | |||||||||||||
| 77 | - | |||||||||||||
| 78 | - | |||||||||||||
| 79 | - | |||||||||||||
| 80 | QSqlError QSqlDriver::lastError() const | - | ||||||||||||
| 81 | { | - | ||||||||||||
| 82 | return executed 29 times by 6 tests: d_func()->error;return d_func()->error;Executed by:
executed 29 times by 6 tests: return d_func()->error;Executed by:
| 29 | ||||||||||||
| 83 | } | - | ||||||||||||
| 84 | QStringList QSqlDriver::tables(QSql::TableType) const | - | ||||||||||||
| 85 | { | - | ||||||||||||
| 86 | return executed 1 time by 1 test: QStringList();return QStringList();Executed by:
executed 1 time by 1 test: return QStringList();Executed by:
| 1 | ||||||||||||
| 87 | } | - | ||||||||||||
| 88 | - | |||||||||||||
| 89 | - | |||||||||||||
| 90 | - | |||||||||||||
| 91 | - | |||||||||||||
| 92 | - | |||||||||||||
| 93 | - | |||||||||||||
| 94 | - | |||||||||||||
| 95 | QSqlIndex QSqlDriver::primaryIndex(const QString&) const | - | ||||||||||||
| 96 | { | - | ||||||||||||
| 97 | return never executed: QSqlIndex();return QSqlIndex();never executed: return QSqlIndex(); | 0 | ||||||||||||
| 98 | } | - | ||||||||||||
| 99 | QSqlRecord QSqlDriver::record(const QString & ) const | - | ||||||||||||
| 100 | { | - | ||||||||||||
| 101 | return never executed: QSqlRecord();return QSqlRecord();never executed: return QSqlRecord(); | 0 | ||||||||||||
| 102 | } | - | ||||||||||||
| 103 | QString QSqlDriver::escapeIdentifier(const QString &identifier, IdentifierType) const | - | ||||||||||||
| 104 | { | - | ||||||||||||
| 105 | return never executed: identifier;return identifier;never executed: return identifier; | 0 | ||||||||||||
| 106 | } | - | ||||||||||||
| 107 | bool QSqlDriver::isIdentifierEscaped(const QString &identifier, IdentifierType type) const | - | ||||||||||||
| 108 | { | - | ||||||||||||
| 109 | (void)type;; | - | ||||||||||||
| 110 | return executed 2790 times by 8 tests: identifier.size() > 2return identifier.size() > 2 && identifier.startsWith(QLatin1Char('"')) && identifier.endsWith(QLatin1Char('"'));Executed by:
executed 2790 times by 8 tests: return identifier.size() > 2 && identifier.startsWith(QLatin1Char('"')) && identifier.endsWith(QLatin1Char('"'));Executed by:
| 651-2790 | ||||||||||||
| 111 | && identifier.startsWith(QLatin1Char('"'))
executed 2790 times by 8 tests: return identifier.size() > 2 && identifier.startsWith(QLatin1Char('"')) && identifier.endsWith(QLatin1Char('"'));Executed by:
| 208-2790 | ||||||||||||
| 112 | && identifier.endsWith(QLatin1Char('"'))
executed 2790 times by 8 tests: return identifier.size() > 2 && identifier.startsWith(QLatin1Char('"')) && identifier.endsWith(QLatin1Char('"'));Executed by:
| 0-2790 | ||||||||||||
| 113 | } | - | ||||||||||||
| 114 | QString QSqlDriver::stripDelimiters(const QString &identifier, IdentifierType type) const | - | ||||||||||||
| 115 | { | - | ||||||||||||
| 116 | QString ret; | - | ||||||||||||
| 117 | if (isIdentifierEscaped(identifier, type)
| 0-99 | ||||||||||||
| 118 | ret = identifier.mid(1); | - | ||||||||||||
| 119 | ret.chop(1); | - | ||||||||||||
| 120 | } executed 99 times by 4 tests: else {end of blockExecuted by:
| 99 | ||||||||||||
| 121 | ret = identifier; | - | ||||||||||||
| 122 | } never executed: end of block | 0 | ||||||||||||
| 123 | return executed 99 times by 4 tests: ret;return ret;Executed by:
executed 99 times by 4 tests: return ret;Executed by:
| 99 | ||||||||||||
| 124 | } | - | ||||||||||||
| 125 | QString QSqlDriver::sqlStatement(StatementType type, const QString &tableName, | - | ||||||||||||
| 126 | const QSqlRecord &rec, bool preparedStatement) const | - | ||||||||||||
| 127 | { | - | ||||||||||||
| 128 | int i; | - | ||||||||||||
| 129 | QString s; | - | ||||||||||||
| 130 | s.reserve(128); | - | ||||||||||||
| 131 | switch (type) { | - | ||||||||||||
| 132 | case executed 293 times by 3 tests: SelectStatement:case SelectStatement:Executed by:
executed 293 times by 3 tests: case SelectStatement:Executed by:
| 293 | ||||||||||||
| 133 | for (i = 0; i < rec.count()
| 293-721 | ||||||||||||
| 134 | if (rec.isGenerated(i)
| 0-721 | ||||||||||||
| 135 | s.append(prepareIdentifier(rec.fieldName(i), QSqlDriver::FieldName, this)).append(QLatin1String(", ")); executed 721 times by 3 tests: s.append(prepareIdentifier(rec.fieldName(i), QSqlDriver::FieldName, this)).append(QLatin1String(", "));Executed by:
| 721 | ||||||||||||
| 136 | } executed 721 times by 3 tests: end of blockExecuted by:
| 721 | ||||||||||||
| 137 | if (s.isEmpty()
| 0-293 | ||||||||||||
| 138 | return never executed: s;return s;never executed: return s; | 0 | ||||||||||||
| 139 | s.chop(2); | - | ||||||||||||
| 140 | s.prepend(QLatin1String("SELECT ")).append(QLatin1String(" FROM ")).append(tableName); | - | ||||||||||||
| 141 | break; executed 293 times by 3 tests: break;Executed by:
| 293 | ||||||||||||
| 142 | case executed 135 times by 3 tests: WhereStatement:case WhereStatement:Executed by:
executed 135 times by 3 tests: case WhereStatement:Executed by:
| 135 | ||||||||||||
| 143 | { | - | ||||||||||||
| 144 | const QString tableNamePrefix = tableName.isEmpty()
| 0-135 | ||||||||||||
| 145 | ? QString() | - | ||||||||||||
| 146 | : prepareIdentifier(tableName, QSqlDriver::TableName, this) + QLatin1Char('.'); | - | ||||||||||||
| 147 | for (int i = 0; i < rec.count()
| 135-286 | ||||||||||||
| 148 | s.append(QLatin1String(i? " AND " : "WHERE ")); | - | ||||||||||||
| 149 | s.append(tableNamePrefix); | - | ||||||||||||
| 150 | s.append(prepareIdentifier(rec.fieldName(i), QSqlDriver::FieldName, this)); | - | ||||||||||||
| 151 | if (rec.isNull(i)
| 17-269 | ||||||||||||
| 152 | s.append(QLatin1String(" IS NULL")); executed 17 times by 2 tests: s.append(QLatin1String(" IS NULL"));Executed by:
| 17 | ||||||||||||
| 153 | else if (preparedStatement
| 117-152 | ||||||||||||
| 154 | s.append(QLatin1String(" = ?")); executed 152 times by 3 tests: s.append(QLatin1String(" = ?"));Executed by:
| 152 | ||||||||||||
| 155 | else | - | ||||||||||||
| 156 | s.append(QLatin1String(" = ")).append(formatValue(rec.field(i))); executed 117 times by 3 tests: s.append(QLatin1String(" = ")).append(formatValue(rec.field(i)));Executed by:
| 117 | ||||||||||||
| 157 | } | - | ||||||||||||
| 158 | break; executed 135 times by 3 tests: break;Executed by:
| 135 | ||||||||||||
| 159 | } | - | ||||||||||||
| 160 | case executed 49 times by 2 tests: UpdateStatement:case UpdateStatement:Executed by:
executed 49 times by 2 tests: case UpdateStatement:Executed by:
| 49 | ||||||||||||
| 161 | s.append(QLatin1String("UPDATE ")).append(tableName).append( | - | ||||||||||||
| 162 | QLatin1String(" SET ")); | - | ||||||||||||
| 163 | for (i = 0; i < rec.count()
| 49-153 | ||||||||||||
| 164 | if (!rec.isGenerated(i)
| 64-89 | ||||||||||||
| 165 | continue; executed 89 times by 2 tests: continue;Executed by:
| 89 | ||||||||||||
| 166 | s.append(prepareIdentifier(rec.fieldName(i), QSqlDriver::FieldName, this)).append(QLatin1Char('=')); | - | ||||||||||||
| 167 | if (preparedStatement
| 0-64 | ||||||||||||
| 168 | s.append(QLatin1Char('?')); executed 64 times by 2 tests: s.append(QLatin1Char('?'));Executed by:
| 64 | ||||||||||||
| 169 | else | - | ||||||||||||
| 170 | s.append(formatValue(rec.field(i))); never executed: s.append(formatValue(rec.field(i))); | 0 | ||||||||||||
| 171 | s.append(QLatin1String(", ")); | - | ||||||||||||
| 172 | } executed 64 times by 2 tests: end of blockExecuted by:
| 64 | ||||||||||||
| 173 | if (s.endsWith(QLatin1String(", "))
| 0-49 | ||||||||||||
| 174 | s.chop(2); executed 49 times by 2 tests: s.chop(2);Executed by:
| 49 | ||||||||||||
| 175 | else | - | ||||||||||||
| 176 | s.clear(); never executed: s.clear(); | 0 | ||||||||||||
| 177 | break; executed 49 times by 2 tests: break;Executed by:
| 49 | ||||||||||||
| 178 | case executed 22 times by 1 test: DeleteStatement:case DeleteStatement:Executed by:
executed 22 times by 1 test: case DeleteStatement:Executed by:
| 22 | ||||||||||||
| 179 | s.append(QLatin1String("DELETE FROM ")).append(tableName); | - | ||||||||||||
| 180 | break; executed 22 times by 1 test: break;Executed by:
| 22 | ||||||||||||
| 181 | case executed 53 times by 2 tests: InsertStatement:case InsertStatement:Executed by:
executed 53 times by 2 tests: {case InsertStatement:Executed by:
| 53 | ||||||||||||
| 182 | s.append(QLatin1String("INSERT INTO ")).append(tableName).append(QLatin1String(" (")); | - | ||||||||||||
| 183 | QString vals; | - | ||||||||||||
| 184 | for (i = 0; i < rec.count()
| 53-145 | ||||||||||||
| 185 | if (!rec.isGenerated(i)
| 17-128 | ||||||||||||
| 186 | continue; executed 17 times by 1 test: continue;Executed by:
| 17 | ||||||||||||
| 187 | s.append(prepareIdentifier(rec.fieldName(i), QSqlDriver::FieldName, this)).append(QLatin1String(", ")); | - | ||||||||||||
| 188 | if (preparedStatement
| 0-128 | ||||||||||||
| 189 | vals.append(QLatin1Char('?')); executed 128 times by 2 tests: vals.append(QLatin1Char('?'));Executed by:
| 128 | ||||||||||||
| 190 | else | - | ||||||||||||
| 191 | vals.append(formatValue(rec.field(i))); never executed: vals.append(formatValue(rec.field(i))); | 0 | ||||||||||||
| 192 | vals.append(QLatin1String(", ")); | - | ||||||||||||
| 193 | } executed 128 times by 2 tests: end of blockExecuted by:
| 128 | ||||||||||||
| 194 | if (vals.isEmpty()
| 1-52 | ||||||||||||
| 195 | s.clear(); | - | ||||||||||||
| 196 | } executed 1 time by 1 test: else {end of blockExecuted by:
| 1 | ||||||||||||
| 197 | vals.chop(2); | - | ||||||||||||
| 198 | s[s.length() - 2] = QLatin1Char(')'); | - | ||||||||||||
| 199 | s.append(QLatin1String("VALUES (")).append(vals).append(QLatin1Char(')')); | - | ||||||||||||
| 200 | } executed 52 times by 2 tests: end of blockExecuted by:
| 52 | ||||||||||||
| 201 | break; executed 53 times by 2 tests: }break;Executed by:
| 53 | ||||||||||||
| 202 | } | - | ||||||||||||
| 203 | return executed 552 times by 4 tests: s;return s;Executed by:
executed 552 times by 4 tests: return s;Executed by:
| 552 | ||||||||||||
| 204 | } | - | ||||||||||||
| 205 | QString QSqlDriver::formatValue(const QSqlField &field, bool trimStrings) const | - | ||||||||||||
| 206 | { | - | ||||||||||||
| 207 | const QLatin1String nullTxt("NULL"); | - | ||||||||||||
| 208 | - | |||||||||||||
| 209 | QString r; | - | ||||||||||||
| 210 | if (field.isNull()
| 0-126 | ||||||||||||
| 211 | r = nullTxt; never executed: r = nullTxt; | 0 | ||||||||||||
| 212 | else { | - | ||||||||||||
| 213 | switch (field.type()) { | - | ||||||||||||
| 214 | case executed 82 times by 4 tests: QVariant::Int:case QVariant::Int:Executed by:
executed 82 times by 4 tests: case QVariant::Int:Executed by:
| 82 | ||||||||||||
| 215 | case never executed: QVariant::UInt:case QVariant::UInt:never executed: case QVariant::UInt: | 0 | ||||||||||||
| 216 | if (field.value().type() == QVariant::Bool
| 0-82 | ||||||||||||
| 217 | r = field.value().toBool()
never executed: r = field.value().toBool() ? QLatin1String("1") : QLatin1String("0"); | 0 | ||||||||||||
| 218 | else | - | ||||||||||||
| 219 | r = field.value().toString(); executed 82 times by 4 tests: r = field.value().toString();Executed by:
| 82 | ||||||||||||
| 220 | break; executed 82 times by 4 tests: break;Executed by:
| 82 | ||||||||||||
| 221 | - | |||||||||||||
| 222 | case never executed: QVariant::Date:case QVariant::Date:never executed: case QVariant::Date: | 0 | ||||||||||||
| 223 | if (field.value().toDate().isValid()
| 0 | ||||||||||||
| 224 | r = QLatin1Char('\'') + field.value().toDate().toString(Qt::ISODate) never executed: r = QLatin1Char('\'') + field.value().toDate().toString(Qt::ISODate) + QLatin1Char('\''); | 0 | ||||||||||||
| 225 | + QLatin1Char('\''); never executed: r = QLatin1Char('\'') + field.value().toDate().toString(Qt::ISODate) + QLatin1Char('\''); | 0 | ||||||||||||
| 226 | else | - | ||||||||||||
| 227 | r = nullTxt; never executed: r = nullTxt; | 0 | ||||||||||||
| 228 | break; never executed: break; | 0 | ||||||||||||
| 229 | case never executed: QVariant::Time:case QVariant::Time:never executed: case QVariant::Time: | 0 | ||||||||||||
| 230 | if (field.value().toTime().isValid()
| 0 | ||||||||||||
| 231 | r = QLatin1Char('\'') + field.value().toTime().toString(Qt::ISODate) never executed: r = QLatin1Char('\'') + field.value().toTime().toString(Qt::ISODate) + QLatin1Char('\''); | 0 | ||||||||||||
| 232 | + QLatin1Char('\''); never executed: r = QLatin1Char('\'') + field.value().toTime().toString(Qt::ISODate) + QLatin1Char('\''); | 0 | ||||||||||||
| 233 | else | - | ||||||||||||
| 234 | r = nullTxt; never executed: r = nullTxt; | 0 | ||||||||||||
| 235 | break; never executed: break; | 0 | ||||||||||||
| 236 | case never executed: QVariant::DateTime:case QVariant::DateTime:never executed: case QVariant::DateTime: | 0 | ||||||||||||
| 237 | if (field.value().toDateTime().isValid()
| 0 | ||||||||||||
| 238 | r = QLatin1Char('\'') + never executed: r = QLatin1Char('\'') + field.value().toDateTime().toString(Qt::ISODate) + QLatin1Char('\''); | 0 | ||||||||||||
| 239 | field.value().toDateTime().toString(Qt::ISODate) + QLatin1Char('\''); never executed: r = QLatin1Char('\'') + field.value().toDateTime().toString(Qt::ISODate) + QLatin1Char('\''); | 0 | ||||||||||||
| 240 | else | - | ||||||||||||
| 241 | r = nullTxt; never executed: r = nullTxt; | 0 | ||||||||||||
| 242 | break; never executed: break; | 0 | ||||||||||||
| 243 | - | |||||||||||||
| 244 | case executed 43 times by 3 tests: QVariant::String:case QVariant::String:Executed by:
executed 43 times by 3 tests: case QVariant::String:Executed by:
| 43 | ||||||||||||
| 245 | case never executed: QVariant::Char:case QVariant::Char:never executed: case QVariant::Char: | 0 | ||||||||||||
| 246 | { | - | ||||||||||||
| 247 | QString result = field.value().toString(); | - | ||||||||||||
| 248 | if (trimStrings
| 6-37 | ||||||||||||
| 249 | int end = result.length(); | - | ||||||||||||
| 250 | while (end
| 2-13 | ||||||||||||
| 251 | end--; executed 9 times by 1 test: end--;Executed by:
| 9 | ||||||||||||
| 252 | result.truncate(end); | - | ||||||||||||
| 253 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||
| 254 | - | |||||||||||||
| 255 | result.replace(QLatin1Char('\''), QLatin1String("''")); | - | ||||||||||||
| 256 | r = QLatin1Char('\'') + result + QLatin1Char('\''); | - | ||||||||||||
| 257 | break; executed 43 times by 3 tests: break;Executed by:
| 43 | ||||||||||||
| 258 | } | - | ||||||||||||
| 259 | case never executed: QVariant::Bool:case QVariant::Bool:never executed: case QVariant::Bool: | 0 | ||||||||||||
| 260 | r = QString::number(field.value().toBool()); | - | ||||||||||||
| 261 | break; never executed: break; | 0 | ||||||||||||
| 262 | case never executed: QVariant::ByteArray :case QVariant::ByteArray :never executed: {case QVariant::ByteArray : | 0 | ||||||||||||
| 263 | if (hasFeature(BLOB)
| 0 | ||||||||||||
| 264 | QByteArray ba = field.value().toByteArray(); | - | ||||||||||||
| 265 | QString res; | - | ||||||||||||
| 266 | static const char hexchars[] = "0123456789abcdef"; | - | ||||||||||||
| 267 | for (int i = 0; i < ba.size()
| 0 | ||||||||||||
| 268 | uchar s = (uchar) ba[i]; | - | ||||||||||||
| 269 | res += QLatin1Char(hexchars[s >> 4]); | - | ||||||||||||
| 270 | res += QLatin1Char(hexchars[s & 0x0f]); | - | ||||||||||||
| 271 | } never executed: end of block | 0 | ||||||||||||
| 272 | r = QLatin1Char('\'') + res + QLatin1Char('\''); | - | ||||||||||||
| 273 | break; never executed: break; | 0 | ||||||||||||
| 274 | } | - | ||||||||||||
| 275 | } | - | ||||||||||||
| 276 | - | |||||||||||||
| 277 | default executed 1 time by 1 test: default:Executed by:
code before this statement never executed: default:executed 1 time by 1 test: :default:Executed by:
code before this statement never executed: default:executed 1 time by 1 test: default:Executed by:
| 0-1 | ||||||||||||
| 278 | r = field.value().toString(); | - | ||||||||||||
| 279 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||
| 280 | } | - | ||||||||||||
| 281 | } | - | ||||||||||||
| 282 | return executed 126 times by 4 tests: r;return r;Executed by:
executed 126 times by 4 tests: return r;Executed by:
| 126 | ||||||||||||
| 283 | } | - | ||||||||||||
| 284 | QVariant QSqlDriver::handle() const | - | ||||||||||||
| 285 | { | - | ||||||||||||
| 286 | return never executed: QVariant();return QVariant();never executed: return QVariant(); | 0 | ||||||||||||
| 287 | } | - | ||||||||||||
| 288 | bool QSqlDriver::subscribeToNotification(const QString &name) | - | ||||||||||||
| 289 | { | - | ||||||||||||
| 290 | (void)name;; | - | ||||||||||||
| 291 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 292 | } | - | ||||||||||||
| 293 | bool QSqlDriver::unsubscribeFromNotification(const QString &name) | - | ||||||||||||
| 294 | { | - | ||||||||||||
| 295 | (void)name;; | - | ||||||||||||
| 296 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 297 | } | - | ||||||||||||
| 298 | QStringList QSqlDriver::subscribedToNotifications() const | - | ||||||||||||
| 299 | { | - | ||||||||||||
| 300 | return never executed: QStringList();return QStringList();never executed: return QStringList(); | 0 | ||||||||||||
| 301 | } | - | ||||||||||||
| 302 | void QSqlDriver::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy) | - | ||||||||||||
| 303 | { | - | ||||||||||||
| 304 | d_func()->precisionPolicy = precisionPolicy; | - | ||||||||||||
| 305 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||
| 306 | QSql::NumericalPrecisionPolicy QSqlDriver::numericalPrecisionPolicy() const | - | ||||||||||||
| 307 | { | - | ||||||||||||
| 308 | return executed 2196 times by 10 tests: d_func()->precisionPolicy;return d_func()->precisionPolicy;Executed by:
executed 2196 times by 10 tests: return d_func()->precisionPolicy;Executed by:
| 2196 | ||||||||||||
| 309 | } | - | ||||||||||||
| 310 | - | |||||||||||||
| 311 | - | |||||||||||||
| 312 | - | |||||||||||||
| 313 | - | |||||||||||||
| 314 | - | |||||||||||||
| 315 | - | |||||||||||||
| 316 | QSqlDriver::DbmsType QSqlDriver::dbmsType() const | - | ||||||||||||
| 317 | { | - | ||||||||||||
| 318 | return executed 4 times by 1 test: d_func()->dbmsType;return d_func()->dbmsType;Executed by:
executed 4 times by 1 test: return d_func()->dbmsType;Executed by:
| 4 | ||||||||||||
| 319 | } | - | ||||||||||||
| 320 | bool QSqlDriver::cancelQuery() | - | ||||||||||||
| 321 | { | - | ||||||||||||
| 322 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 323 | } | - | ||||||||||||
| 324 | - | |||||||||||||
| 325 | - | |||||||||||||
| Switch to Source code | Preprocessed file |