qsqlresult.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/sql/kernel/qsqlresult.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QString QSqlResultPrivate::holderAt(int index) const-
6{-
7 return
executed 154 times by 1 test: return holders.size() > index ? holders.at(index).holderName : fieldSerial(index);
Executed by:
  • tst_QSqlQuery
holders.size() > index ? holders.at(index).holderName : fieldSerial(index);
executed 154 times by 1 test: return holders.size() > index ? holders.at(index).holderName : fieldSerial(index);
Executed by:
  • tst_QSqlQuery
154
8}-
9-
10-
11QString QSqlResultPrivate::fieldSerial(int i) const-
12{-
13 ushort arr[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};-
14 ushort *end = &arr[(sizeof(arr)/sizeof(*arr))];-
15 ushort *ptr = end;-
16-
17 while (i > 0
i > 0Description
TRUEevaluated 116855 times by 7 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
FALSEevaluated 233607 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
) {
116855-233607
18 *(--ptr) = 'a' + i % 16;-
19 i >>= 4;-
20 }
executed 116855 times by 7 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
116855
21-
22 const int nb = end - ptr;-
23 *(--ptr) = 'a' + nb;-
24 *(--ptr) = ':';-
25-
26 return
executed 233607 times by 8 tests: return QString::fromUtf16(ptr, int(end - ptr));
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
QString::fromUtf16(ptr, int(end - ptr));
executed 233607 times by 8 tests: return QString::fromUtf16(ptr, int(end - ptr));
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
233607
27}-
28-
29static bool qIsAlnum(QChar ch)-
30{-
31 uint u = uint(ch.unicode());-
32-
33 return
executed 97 times by 3 tests: return u - 'a' < 26 || u - 'A' < 26 || u - '0' < 10 || u == '_';
Executed by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
u - 'a' < 26 || u - 'A' < 26 || u - '0' < 10 || u == '_';
executed 97 times by 3 tests: return u - 'a' < 26 || u - 'A' < 26 || u - '0' < 10 || u == '_';
Executed by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
97
34}-
35-
36QString QSqlResultPrivate::positionalToNamedBinding(const QString &query) const-
37{-
38 int n = query.size();-
39-
40 QString result;-
41 result.reserve(n * 5 / 4);-
42 QChar closingQuote;-
43 int count = 0;-
44 bool ignoreBraces = (sqldriver->dbmsType() == QSqlDriver::PostgreSQL);-
45-
46 for (int i = 0; i < n
i < nDescription
TRUEevaluated 253 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
; ++i) {
13-253
47 QChar ch = query.at(i);-
48 if (!closingQuote.isNull()
!closingQuote.isNull()Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 215 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
) {
38-215
49 if (ch == closingQuote
ch == closingQuoteDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
) {
16-22
50 if (closingQuote == QLatin1Char(']')
closingQuote =...atin1Char(']')Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
8
51 && i + 1 < n
i + 1 < nDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
&& query.at(i + 1) == closingQuote
query.at(i + 1...= closingQuoteDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEnever evaluated
) {
0-5
52-
53 ++i;-
54 result += ch;-
55 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qsqlresult - unknown status
else {
3
56 closingQuote = QChar();-
57 }
executed 13 times by 1 test: end of block
Executed by:
  • tst_qsqlresult - unknown status
13
58 }-
59 result += ch;-
60 }
executed 38 times by 1 test: end of block
Executed by:
  • tst_qsqlresult - unknown status
else {
38
61 if (ch == QLatin1Char('?')
ch == QLatin1Char('?')Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 205 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
) {
10-205
62 result += fieldSerial(count++);-
63 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qsqlresult - unknown status
else {
10
64 if (ch == QLatin1Char('\'')
ch == QLatin1Char('\'')Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 200 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
|| ch == QLatin1Char('"')
ch == QLatin1Char('"')Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 197 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
|| ch == QLatin1Char('`')
ch == QLatin1Char('`')Description
TRUEnever evaluated
FALSEevaluated 197 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
)
0-200
65 closingQuote = ch;
executed 8 times by 1 test: closingQuote = ch;
Executed by:
  • tst_qsqlresult - unknown status
8
66 else if (!ignoreBraces
!ignoreBracesDescription
TRUEevaluated 197 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEnever evaluated
&& ch == QLatin1Char('[')
ch == QLatin1Char('[')Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 192 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
)
0-197
67 closingQuote = QLatin1Char(']');
executed 5 times by 1 test: closingQuote = QLatin1Char(']');
Executed by:
  • tst_qsqlresult - unknown status
5
68 result += ch;-
69 }
executed 205 times by 1 test: end of block
Executed by:
  • tst_qsqlresult - unknown status
205
70 }-
71 }-
72 result.squeeze();-
73 return
executed 13 times by 1 test: return result;
Executed by:
  • tst_qsqlresult - unknown status
result;
executed 13 times by 1 test: return result;
Executed by:
  • tst_qsqlresult - unknown status
13
74}-
75-
76QString QSqlResultPrivate::namedToPositionalBinding(const QString &query)-
77{-
78 int n = query.size();-
79-
80 QString result;-
81 result.reserve(n);-
82 QChar closingQuote;-
83 int count = 0;-
84 int i = 0;-
85 bool ignoreBraces = (sqldriver->dbmsType() == QSqlDriver::PostgreSQL);-
86-
87 while (i < n
i < nDescription
TRUEevaluated 15899 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
FALSEevaluated 253 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
) {
253-15899
88 QChar ch = query.at(i);-
89 if (!closingQuote.isNull()
!closingQuote.isNull()Description
TRUEevaluated 3386 times by 4 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlresult - unknown status
FALSEevaluated 12513 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
) {
3386-12513
90 if (ch == closingQuote
ch == closingQuoteDescription
TRUEevaluated 342 times by 4 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlresult - unknown status
FALSEevaluated 3044 times by 4 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlresult - unknown status
) {
342-3044
91 if (closingQuote == QLatin1Char(']')
closingQuote =...atin1Char(']')Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 332 times by 4 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlresult - unknown status
10-332
92 && i + 1 < n
i + 1 < nDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
&& query.at(i + 1) == closingQuote
query.at(i + 1...= closingQuoteDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEnever evaluated
) {
0-7
93-
94 ++i;-
95 result += ch;-
96 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qsqlresult - unknown status
else {
3
97 closingQuote = QChar();-
98 }
executed 339 times by 4 tests: end of block
Executed by:
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlresult - unknown status
339
99 }-
100 result += ch;-
101 ++i;-
102 }
executed 3386 times by 4 tests: end of block
Executed by:
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlresult - unknown status
else {
3386
103 if (ch == QLatin1Char(':')
ch == QLatin1Char(':')Description
TRUEevaluated 32 times by 3 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
FALSEevaluated 12481 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
32-12481
104 && (i == 0
i == 0Description
TRUEnever evaluated
FALSEevaluated 32 times by 3 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
|| query.at(i - 1) != QLatin1Char(':')
query.at(i - 1...atin1Char(':')Description
TRUEevaluated 32 times by 3 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
FALSEnever evaluated
)
0-32
105 && (i + 1 < n
i + 1 < nDescription
TRUEevaluated 32 times by 3 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
FALSEnever evaluated
&& qIsAlnum(query.at(i + 1))
qIsAlnum(query.at(i + 1))Description
TRUEevaluated 32 times by 3 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
FALSEnever evaluated
)) {
0-32
106 int pos = i + 2;-
107 while (pos < n
pos < nDescription
TRUEevaluated 65 times by 3 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlThread
&& qIsAlnum(query.at(pos))
qIsAlnum(query.at(pos))Description
TRUEevaluated 37 times by 3 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_qsqlresult - unknown status
)
4-65
108 ++
executed 37 times by 3 tests: ++pos;
Executed by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
pos;
executed 37 times by 3 tests: ++pos;
Executed by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
37
109 QString holder(query.mid(i, pos - i));-
110 indexes[holder].append(count++);-
111 holders.append(QHolder(holder, i));-
112 result += QLatin1Char('?');-
113 i = pos;-
114 }
executed 32 times by 3 tests: end of block
Executed by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
else {
32
115 if (ch == QLatin1Char('\'')
ch == QLatin1Char('\'')Description
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_qsqlresult - unknown status
FALSEevaluated 12469 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
|| ch == QLatin1Char('"')
ch == QLatin1Char('"')Description
TRUEevaluated 321 times by 3 tests
Evaluated by:
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlresult - unknown status
FALSEevaluated 12148 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
|| ch == QLatin1Char('`')
ch == QLatin1Char('`')Description
TRUEnever evaluated
FALSEevaluated 12148 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
)
0-12469
116 closingQuote = ch;
executed 333 times by 4 tests: closingQuote = ch;
Executed by:
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_qsqlresult - unknown status
333
117 else if (!ignoreBraces
!ignoreBracesDescription
TRUEevaluated 12148 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
FALSEnever evaluated
&& ch == QLatin1Char('[')
ch == QLatin1Char('[')Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 12141 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
)
0-12148
118 closingQuote = QLatin1Char(']');
executed 7 times by 1 test: closingQuote = QLatin1Char(']');
Executed by:
  • tst_qsqlresult - unknown status
7
119 result += ch;-
120 ++i;-
121 }
executed 12481 times by 8 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
12481
122 }-
123 }-
124 result.squeeze();-
125 values.resize(holders.size());-
126 return
executed 253 times by 8 tests: return result;
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
result;
executed 253 times by 8 tests: return result;
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
253
127}-
128QSqlResult::QSqlResult(const QSqlDriver *db)-
129{-
130 d_ptr = new QSqlResultPrivate(this, db);-
131 QSqlResultPrivate * const d = d_func();-
132 if (d->sqldriver
d->sqldriverDescription
TRUEevaluated 263 times by 10 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
FALSEnever evaluated
)
0-263
133 setNumericalPrecisionPolicy(d->sqldriver->numericalPrecisionPolicy());
executed 263 times by 10 tests: setNumericalPrecisionPolicy(d->sqldriver->numericalPrecisionPolicy());
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
263
134}
executed 263 times by 10 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
263
135-
136-
137-
138QSqlResult::QSqlResult(QSqlResultPrivate &dd)-
139 : d_ptr(&dd)-
140{-
141 QSqlResultPrivate * const d = d_func();-
142 if (d->sqldriver
d->sqldriverDescription
TRUEevaluated 1930 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEnever evaluated
)
0-1930
143 setNumericalPrecisionPolicy(d->sqldriver->numericalPrecisionPolicy());
executed 1930 times by 9 tests: setNumericalPrecisionPolicy(d->sqldriver->numericalPrecisionPolicy());
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
1930
144}
executed 1930 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
1930
145-
146-
147-
148-
149-
150QSqlResult::~QSqlResult()-
151{-
152 QSqlResultPrivate * const d = d_func();-
153 delete d;-
154}
executed 2193 times by 19 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qitemmodel - unknown status
  • tst_qsql - unknown status
  • tst_qsqldatabase - unknown status
  • tst_qsqldriver - unknown status
  • tst_qsqlquery - unknown status
  • tst_qsqlquerymodel - unknown status
  • tst_qsqlrelationaltablemodel - unknown status
  • tst_qsqlresult - unknown status
  • tst_qsqltablemodel - unknown status
  • tst_qsqlthread - unknown status
2193
155void QSqlResult::setQuery(const QString& query)-
156{-
157 QSqlResultPrivate * const d = d_func();-
158 d->sql = query;-
159}
executed 2556 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
2556
160QString QSqlResult::lastQuery() const-
161{-
162 const QSqlResultPrivate * const d = d_func();-
163 return
executed 124 times by 3 tests: return d->sql;
Executed by:
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
d->sql;
executed 124 times by 3 tests: return d->sql;
Executed by:
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
124
164}-
165int QSqlResult::at() const-
166{-
167 const QSqlResultPrivate * const d = d_func();-
168 return
executed 102985 times by 9 tests: return d->idx;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->idx;
executed 102985 times by 9 tests: return d->idx;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
102985
169}-
170bool QSqlResult::isValid() const-
171{-
172 const QSqlResultPrivate * const d = d_func();-
173 return
executed 9655 times by 8 tests: return d->idx != QSql::BeforeFirstRow && d->idx != QSql::AfterLastRow;
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->idx != QSql::BeforeFirstRow && d->idx != QSql::AfterLastRow;
executed 9655 times by 8 tests: return d->idx != QSql::BeforeFirstRow && d->idx != QSql::AfterLastRow;
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
9655
174}-
175bool QSqlResult::isActive() const-
176{-
177 const QSqlResultPrivate * const d = d_func();-
178 return
executed 20165 times by 9 tests: return d->active;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->active;
executed 20165 times by 9 tests: return d->active;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
20165
179}-
180void QSqlResult::setAt(int index)-
181{-
182 QSqlResultPrivate * const d = d_func();-
183 d->idx = index;-
184}
executed 292516 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
292516
185void QSqlResult::setSelect(bool select)-
186{-
187 QSqlResultPrivate * const d = d_func();-
188 d->isSel = select;-
189}
executed 121899 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
121899
190bool QSqlResult::isSelect() const-
191{-
192 const QSqlResultPrivate * const d = d_func();-
193 return
executed 7589 times by 9 tests: return d->isSel;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->isSel;
executed 7589 times by 9 tests: return d->isSel;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
7589
194}-
195-
196-
197-
198-
199-
200-
201const QSqlDriver *QSqlResult::driver() const-
202{-
203 const QSqlResultPrivate * const d = d_func();-
204 return
executed 15818 times by 10 tests: return d->sqldriver;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
d->sqldriver;
executed 15818 times by 10 tests: return d->sqldriver;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
15818
205}-
206void QSqlResult::setActive(bool active)-
207{-
208 QSqlResultPrivate * const d = d_func();-
209 if (active
activeDescription
TRUEevaluated 26836 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEevaluated 107291 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
&& d->executedQuery.isEmpty()
d->executedQuery.isEmpty()Description
TRUEevaluated 1237 times by 9 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEevaluated 25599 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
)
1237-107291
210 d->executedQuery = d->sql;
executed 1237 times by 9 tests: d->executedQuery = d->sql;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
1237
211-
212 d->active = active;-
213}
executed 134127 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
134127
214void QSqlResult::setLastError(const QSqlError &error)-
215{-
216 QSqlResultPrivate * const d = d_func();-
217 d->error = error;-
218}
executed 306686 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
306686
219-
220-
221-
222-
223-
224-
225QSqlError QSqlResult::lastError() const-
226{-
227 const QSqlResultPrivate * const d = d_func();-
228 return
executed 246932 times by 9 tests: return d->error;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->error;
executed 246932 times by 9 tests: return d->error;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
246932
229}-
230bool QSqlResult::fetchNext()-
231{-
232 return
never executed: return fetch(at() + 1);
fetch(at() + 1);
never executed: return fetch(at() + 1);
0
233}-
234bool QSqlResult::fetchPrevious()-
235{-
236 return
never executed: return fetch(at() - 1);
fetch(at() - 1);
never executed: return fetch(at() - 1);
0
237}-
238-
239-
240-
241-
242-
243-
244-
245bool QSqlResult::isForwardOnly() const-
246{-
247 const QSqlResultPrivate * const d = d_func();-
248 return
executed 42251 times by 9 tests: return d->forwardOnly;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->forwardOnly;
executed 42251 times by 9 tests: return d->forwardOnly;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
42251
249}-
250void QSqlResult::setForwardOnly(bool forward)-
251{-
252 QSqlResultPrivate * const d = d_func();-
253 d->forwardOnly = forward;-
254}
executed 645 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
645
255bool QSqlResult::savePrepare(const QString& query)-
256{-
257 QSqlResultPrivate * const d = d_func();-
258 if (!driver()
!driver()Description
TRUEnever evaluated
FALSEevaluated 245 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
)
0-245
259 return
never executed: return false;
false;
never executed: return false;
0
260 d->clear();-
261 d->sql = query;-
262 if (!driver()->hasFeature(QSqlDriver::PreparedQueries)
!driver()->has...eparedQueries)Description
TRUEnever evaluated
FALSEevaluated 245 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
)
0-245
263 return
never executed: return prepare(query);
prepare(query);
never executed: return prepare(query);
0
264-
265-
266 d->executedQuery = d->namedToPositionalBinding(query);-
267-
268 if (driver()->hasFeature(QSqlDriver::NamedPlaceholders)
driver()->hasF...dPlaceholders)Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 232 times by 7 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
)
13-232
269 d->executedQuery = d->positionalToNamedBinding(query);
executed 13 times by 1 test: d->executedQuery = d->positionalToNamedBinding(query);
Executed by:
  • tst_qsqlresult - unknown status
13
270-
271 return
executed 245 times by 8 tests: return prepare(d->executedQuery);
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
prepare(d->executedQuery);
executed 245 times by 8 tests: return prepare(d->executedQuery);
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
245
272}-
273bool QSqlResult::prepare(const QString& query)-
274{-
275 QSqlResultPrivate * const d = d_func();-
276 d->sql = query;-
277 if (d->holders.isEmpty()
d->holders.isEmpty()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
) {
5-8
278-
279 d->namedToPositionalBinding(query);-
280 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qsqlresult - unknown status
8
281 return
executed 13 times by 1 test: return true;
Executed by:
  • tst_qsqlresult - unknown status
true;
executed 13 times by 1 test: return true;
Executed by:
  • tst_qsqlresult - unknown status
13
282}-
283-
284-
285-
286-
287-
288-
289-
290bool QSqlResult::exec()-
291{-
292 QSqlResultPrivate * const d = d_func();-
293 bool ret;-
294-
295 QString query = lastQuery();-
296 if (d->binds == NamedBinding
d->binds == NamedBindingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
297 int i;-
298 QVariant val;-
299 QString holder;-
300 for (i = d->holders.count() - 1; i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i) {
0
301 holder = d->holders.at(i).holderName;-
302 val = d->values.value(d->indexes.value(holder).value(0,-1));-
303 QSqlField f(QLatin1String(""), val.type());-
304 f.setValue(val);-
305 query = query.replace(d->holders.at(i).holderPos,-
306 holder.length(), driver()->formatValue(f));-
307 }
never executed: end of block
0
308 }
never executed: end of block
else {
0
309 QString val;-
310 int i = 0;-
311 int idx = 0;-
312 for (idx = 0; idx < d->values.count()
idx < d->values.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++idx) {
0
313 i = query.indexOf(QLatin1Char('?'), i);-
314 if (i == -1
i == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
315 continue;
never executed: continue;
0
316 QVariant var = d->values.value(idx);-
317 QSqlField f(QLatin1String(""), var.type());-
318 if (var.isNull()
var.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
319 f.clear();
never executed: f.clear();
0
320 else-
321 f.setValue(var);
never executed: f.setValue(var);
0
322 val = driver()->formatValue(f);-
323 query = query.replace(i, 1, driver()->formatValue(f));-
324 i += val.length();-
325 }
never executed: end of block
0
326 }
never executed: end of block
0
327-
328-
329 QString orig = lastQuery();-
330 ret = reset(query);-
331 d->executedQuery = query;-
332 setQuery(orig);-
333 d->resetBindCount();-
334 return
never executed: return ret;
ret;
never executed: return ret;
0
335}-
336-
337-
338-
339-
340-
341-
342-
343void QSqlResult::bindValue(int index, const QVariant& val, QSql::ParamType paramType)-
344{-
345 QSqlResultPrivate * const d = d_func();-
346 d->binds = PositionalBinding;-
347 QList<int>& indexes = d->indexes[d->fieldSerial(index)];-
348 if (!indexes.contains(index)
!indexes.contains(index)Description
TRUEevaluated 467 times by 7 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEevaluated 232988 times by 7 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
)
467-232988
349 indexes.append(index);
executed 467 times by 7 tests: indexes.append(index);
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
467
350 if (d->values.count() <= index
d->values.count() <= indexDescription
TRUEevaluated 467 times by 7 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEevaluated 232988 times by 7 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
)
467-232988
351 d->values.resize(index + 1);
executed 467 times by 7 tests: d->values.resize(index + 1);
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
467
352 d->values[index] = val;-
353 if (paramType != QSql::In
paramType != QSql::InDescription
TRUEnever evaluated
FALSEevaluated 233455 times by 7 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
|| !d->types.isEmpty()
!d->types.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 233455 times by 7 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
)
0-233455
354 d->types[index] = paramType;
never executed: d->types[index] = paramType;
0
355}
executed 233455 times by 7 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
233455
356void QSqlResult::bindValue(const QString& placeholder, const QVariant& val,-
357 QSql::ParamType paramType)-
358{-
359 QSqlResultPrivate * const d = d_func();-
360 d->binds = NamedBinding;-
361-
362-
363 const QList<int> indexes = d->indexes.value(placeholder);-
364 for (int idx : indexes) {-
365 if (d->values.count() <= idx
d->values.count() <= idxDescription
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_QSqlQuery
)
0-40
366 d->values.resize(idx + 1);
never executed: d->values.resize(idx + 1);
0
367 d->values[idx] = val;-
368 if (paramType != QSql::In
paramType != QSql::InDescription
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_QSqlQuery
|| !d->types.isEmpty()
!d->types.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_QSqlQuery
)
0-40
369 d->types[idx] = paramType;
never executed: d->types[idx] = paramType;
0
370 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_QSqlQuery
40
371}
executed 48 times by 2 tests: end of block
Executed by:
  • tst_QSqlQuery
  • tst_QSqlThread
48
372-
373-
374-
375-
376-
377-
378-
379void QSqlResult::addBindValue(const QVariant& val, QSql::ParamType paramType)-
380{-
381 QSqlResultPrivate * const d = d_func();-
382 d->binds = PositionalBinding;-
383 bindValue(d->bindCount, val, paramType);-
384 ++d->bindCount;-
385}
executed 233364 times by 5 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
233364
386-
387-
388-
389-
390-
391-
392-
393QVariant QSqlResult::boundValue(int index) const-
394{-
395 const QSqlResultPrivate * const d = d_func();-
396 return
executed 1 time by 1 test: return d->values.value(index);
Executed by:
  • tst_QSqlQuery
d->values.value(index);
executed 1 time by 1 test: return d->values.value(index);
Executed by:
  • tst_QSqlQuery
1
397}-
398QVariant QSqlResult::boundValue(const QString& placeholder) const-
399{-
400 const QSqlResultPrivate * const d = d_func();-
401 QList<int> indexes = d->indexes.value(placeholder);-
402 return
never executed: return d->values.value(indexes.value(0,-1));
d->values.value(indexes.value(0,-1));
never executed: return d->values.value(indexes.value(0,-1));
0
403}-
404-
405-
406-
407-
408-
409-
410QSql::ParamType QSqlResult::bindValueType(int index) const-
411{-
412 const QSqlResultPrivate * const d = d_func();-
413 return
never executed: return d->types.value(index, QSql::In);
d->types.value(index, QSql::In);
never executed: return d->types.value(index, QSql::In);
0
414}-
415-
416-
417-
418-
419-
420-
421-
422QSql::ParamType QSqlResult::bindValueType(const QString& placeholder) const-
423{-
424 const QSqlResultPrivate * const d = d_func();-
425 return
never executed: return d->types.value(d->indexes.value(placeholder).value(0,-1), QSql::In);
d->types.value(d->indexes.value(placeholder).value(0,-1), QSql::In);
never executed: return d->types.value(d->indexes.value(placeholder).value(0,-1), QSql::In);
0
426}-
427-
428-
429-
430-
431-
432-
433int QSqlResult::boundValueCount() const-
434{-
435 const QSqlResultPrivate * const d = d_func();-
436 return
never executed: return d->values.count();
d->values.count();
never executed: return d->values.count();
0
437}-
438-
439-
440-
441-
442-
443-
444-
445QVector<QVariant>& QSqlResult::boundValues() const-
446{-
447 const QSqlResultPrivate * const d = d_func();-
448 return
executed 119177 times by 10 tests: return const_cast<QSqlResultPrivate *>(d)->values;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
const_cast<QSqlResultPrivate *>(d)->values;
executed 119177 times by 10 tests: return const_cast<QSqlResultPrivate *>(d)->values;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
119177
449}-
450-
451-
452-
453-
454QSqlResult::BindingSyntax QSqlResult::bindingSyntax() const-
455{-
456 const QSqlResultPrivate * const d = d_func();-
457 return
never executed: return d->binds;
d->binds;
never executed: return d->binds;
0
458}-
459-
460-
461-
462-
463-
464void QSqlResult::clear()-
465{-
466 QSqlResultPrivate * const d = d_func();-
467 d->clear();-
468}
executed 2553 times by 9 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
2553
469QString QSqlResult::executedQuery() const-
470{-
471 const QSqlResultPrivate * const d = d_func();-
472 return
executed 1 time by 1 test: return d->executedQuery;
Executed by:
  • tst_QSqlQuery
d->executedQuery;
executed 1 time by 1 test: return d->executedQuery;
Executed by:
  • tst_QSqlQuery
1
473}-
474-
475-
476-
477-
478void QSqlResult::resetBindCount()-
479{-
480 QSqlResultPrivate * const d = d_func();-
481 d->resetBindCount();-
482}
executed 116730 times by 7 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
116730
483-
484-
485-
486-
487-
488-
489-
490QString QSqlResult::boundValueName(int index) const-
491{-
492 const QSqlResultPrivate * const d = d_func();-
493 return
executed 154 times by 1 test: return d->holderAt(index);
Executed by:
  • tst_QSqlQuery
d->holderAt(index);
executed 154 times by 1 test: return d->holderAt(index);
Executed by:
  • tst_QSqlQuery
154
494}-
495-
496-
497-
498-
499-
500-
501-
502bool QSqlResult::hasOutValues() const-
503{-
504 const QSqlResultPrivate * const d = d_func();-
505 if (d->types.isEmpty()
d->types.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
506 return
never executed: return false;
false;
never executed: return false;
0
507 QHash<int, QSql::ParamType>::ConstIterator it;-
508 for (it = d->types.constBegin(); it != d->types.constEnd()
it != d->types.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
509 if (it.value() != QSql::In
it.value() != QSql::InDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
510 return
never executed: return true;
true;
never executed: return true;
0
511 }
never executed: end of block
0
512 return
never executed: return false;
false;
never executed: return false;
0
513}-
514QSqlRecord QSqlResult::record() const-
515{-
516 return
never executed: return QSqlRecord();
QSqlRecord();
never executed: return QSqlRecord();
0
517}-
518QVariant QSqlResult::lastInsertId() const-
519{-
520 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
521}-
522-
523-
524-
525void QSqlResult::virtual_hook(int, void *)-
526{-
527}-
528bool QSqlResult::execBatch(bool arrayBind)-
529{-
530 (void)arrayBind;;-
531 QSqlResultPrivate * const d = d_func();-
532-
533 QVector<QVariant> values = d->values;-
534 if (values.count() == 0
values.count() == 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSqlQuery
)
0-2
535 return
never executed: return false;
false;
never executed: return false;
0
536 for (int i = 0; i < values.at(0).toList().count()
i < values.at(...List().count()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSqlQuery
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSqlQuery
; ++i) {
2
537 for (int j = 0; j < values.count()
j < values.count()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSqlQuery
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSqlQuery
; ++j)
2
538 bindValue(j, values.at(j).toList().at(i), QSql::In);
executed 2 times by 1 test: bindValue(j, values.at(j).toList().at(i), QSql::In);
Executed by:
  • tst_QSqlQuery
2
539 if (!exec()
!exec()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSqlQuery
)
0-2
540 return
never executed: return false;
false;
never executed: return false;
0
541 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QSqlQuery
2
542 return
executed 2 times by 1 test: return true;
Executed by:
  • tst_QSqlQuery
true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_QSqlQuery
2
543}-
544-
545-
546-
547void QSqlResult::detachFromResultSet()-
548{-
549}-
550-
551-
552-
553void QSqlResult::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy)-
554{-
555 QSqlResultPrivate * const d = d_func();-
556 d->precisionPolicy = policy;-
557}
executed 4989 times by 10 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
4989
558-
559-
560-
561QSql::NumericalPrecisionPolicy QSqlResult::numericalPrecisionPolicy() const-
562{-
563 const QSqlResultPrivate * const d = d_func();-
564 return
executed 2806 times by 9 tests: return d->precisionPolicy;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
d->precisionPolicy;
executed 2806 times by 9 tests: return d->precisionPolicy;
Executed by:
  • tst_QItemModel
  • tst_QSql
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
2806
565}-
566-
567-
568-
569bool QSqlResult::nextResult()-
570{-
571 return
never executed: return false;
false;
never executed: return false;
0
572}-
573QVariant QSqlResult::handle() const-
574{-
575 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
576}-
577-
578-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9