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.size() > indexDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_QSqlQuery
FALSEevaluated 142 times by 1 test
Evaluated by:
  • tst_QSqlQuery
? 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
12-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 116858 times by 7 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
FALSEevaluated 233612 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
) {
116858-233612
18 *(--ptr) = 'a' + i % 16;-
19 i >>= 4;-
20 }
executed 116858 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
116858
21-
22 const int nb = end - ptr;-
23 *(--ptr) = 'a' + nb;-
24 *(--ptr) = ':';-
25-
26 return
executed 233612 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 233612 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
233612
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' < 26Description
TRUEevaluated 64 times by 3 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
FALSEevaluated 33 times by 2 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_qsqlresult - unknown status
|| u - 'A' < 26
u - 'A' < 26Description
TRUEnever evaluated
FALSEevaluated 33 times by 2 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_qsqlresult - unknown status
|| u - '0' < 10
u - '0' < 10Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_qsqlresult - unknown status
|| u == '_'
u == '_'Description
TRUEnever evaluated
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_qsqlresult - unknown status
;
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
0-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->d_func()->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->d_func()->dbmsType == QSqlDriver::PostgreSQL);-
86-
87 while (i < n
i < nDescription
TRUEevaluated 16078 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 255 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
  • tst_qsqlresult - unknown status
) {
255-16078
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 12692 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-12692
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 12660 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-12660
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 12648 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 12327 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 12327 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-12648
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 12327 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 12320 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-12327
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 12660 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
12660
122 }-
123 }-
124 result.squeeze();-
125 values.resize(holders.size());-
126 return
executed 255 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 255 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
255
127}-
128QSqlResult::QSqlResult(const QSqlDriver *db)-
129{-
130 d_ptr = new QSqlResultPrivate;-
131 QSqlResultPrivate * const d = d_func();-
132 d->q_ptr = this;-
133 d->sqldriver = const_cast<QSqlDriver *>(db);-
134 if (d->sqldriver
d->sqldriverDescription
TRUEevaluated 2195 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-2195
135 setNumericalPrecisionPolicy(d->sqldriver->numericalPrecisionPolicy());
executed 2195 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
2195
136}
executed 2195 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
2195
137-
138-
139-
140QSqlResult::QSqlResult(QSqlResultPrivate &dd, const QSqlDriver *db)-
141{-
142 d_ptr = &dd;-
143 QSqlResultPrivate * const d = d_func();-
144 d->q_ptr = this;-
145 d->sqldriver = const_cast<QSqlDriver *>(db);-
146 if (d->sqldriver
d->sqldriverDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
147 setNumericalPrecisionPolicy(d->sqldriver->numericalPrecisionPolicy());
never executed: setNumericalPrecisionPolicy(d->sqldriver->numericalPrecisionPolicy());
0
148}
never executed: end of block
0
149-
150-
151-
152-
153-
154QSqlResult::~QSqlResult()-
155{-
156 QSqlResultPrivate * const d = d_func();-
157 delete d;-
158}
executed 2195 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
2195
159void QSqlResult::setQuery(const QString& query)-
160{-
161 QSqlResultPrivate * const d = d_func();-
162 d->sql = query;-
163}
executed 2557 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
2557
164QString QSqlResult::lastQuery() const-
165{-
166 const QSqlResultPrivate * const d = d_func();-
167 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
168}-
169int QSqlResult::at() const-
170{-
171 const QSqlResultPrivate * const d = d_func();-
172 return
executed 102997 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 102997 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
102997
173}-
174bool QSqlResult::isValid() const-
175{-
176 const QSqlResultPrivate * const d = d_func();-
177 return
executed 9659 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::BeforeFirstRowDescription
TRUEevaluated 9275 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEevaluated 384 times by 6 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
&& d->idx != QSql::AfterLastRow
d->idx != QSql::AfterLastRowDescription
TRUEevaluated 9254 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
FALSEevaluated 21 times by 3 tests
Evaluated by:
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlTableModel
;
executed 9659 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
21-9659
178}-
179bool QSqlResult::isActive() const-
180{-
181 const QSqlResultPrivate * const d = d_func();-
182 return
executed 20171 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 20171 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
20171
183}-
184void QSqlResult::setAt(int index)-
185{-
186 QSqlResultPrivate * const d = d_func();-
187 d->idx = index;-
188}
executed 292539 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
292539
189void QSqlResult::setSelect(bool select)-
190{-
191 QSqlResultPrivate * const d = d_func();-
192 d->isSel = select;-
193}
executed 121905 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
121905
194bool QSqlResult::isSelect() const-
195{-
196 const QSqlResultPrivate * const d = d_func();-
197 return
executed 7591 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 7591 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
7591
198}-
199-
200-
201-
202-
203-
204-
205const QSqlDriver *QSqlResult::driver() const-
206{-
207 const QSqlResultPrivate * const d = d_func();-
208 return
executed 17773 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 17773 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
17773
209}-
210void QSqlResult::setActive(bool active)-
211{-
212 QSqlResultPrivate * const d = d_func();-
213 if (active
activeDescription
TRUEevaluated 26839 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 107307 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 1238 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 25601 times by 8 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlDriver
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
)
1238-107307
214 d->executedQuery = d->sql;
executed 1238 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
1238
215-
216 d->active = active;-
217}
executed 134146 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
134146
218void QSqlResult::setLastError(const QSqlError &error)-
219{-
220 QSqlResultPrivate * const d = d_func();-
221 d->error = error;-
222}
executed 306692 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
306692
223-
224-
225-
226-
227-
228-
229QSqlError QSqlResult::lastError() const-
230{-
231 const QSqlResultPrivate * const d = d_func();-
232 return
executed 246941 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 246941 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
246941
233}-
234bool QSqlResult::fetchNext()-
235{-
236 return
never executed: return fetch(at() + 1);
fetch(at() + 1);
never executed: return fetch(at() + 1);
0
237}-
238bool QSqlResult::fetchPrevious()-
239{-
240 return
never executed: return fetch(at() - 1);
fetch(at() - 1);
never executed: return fetch(at() - 1);
0
241}-
242-
243-
244-
245-
246-
247-
248-
249bool QSqlResult::isForwardOnly() const-
250{-
251 const QSqlResultPrivate * const d = d_func();-
252 return
executed 42254 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 42254 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
42254
253}-
254void QSqlResult::setForwardOnly(bool forward)-
255{-
256 QSqlResultPrivate * const d = d_func();-
257 d->forwardOnly = forward;-
258}
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
259bool QSqlResult::savePrepare(const QString& query)-
260{-
261 QSqlResultPrivate * const d = d_func();-
262 if (!driver()
!driver()Description
TRUEnever evaluated
FALSEevaluated 247 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-247
263 return
never executed: return false;
false;
never executed: return false;
0
264 d->clear();-
265 d->sql = query;-
266 if (!driver()->hasFeature(QSqlDriver::PreparedQueries)
!driver()->has...eparedQueries)Description
TRUEnever evaluated
FALSEevaluated 247 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-247
267 return
never executed: return prepare(query);
prepare(query);
never executed: return prepare(query);
0
268-
269-
270 d->executedQuery = d->namedToPositionalBinding(query);-
271-
272 if (driver()->hasFeature(QSqlDriver::NamedPlaceholders)
driver()->hasF...dPlaceholders)Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_qsqlresult - unknown status
FALSEevaluated 234 times by 7 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
)
13-234
273 d->executedQuery = d->positionalToNamedBinding(query);
executed 13 times by 1 test: d->executedQuery = d->positionalToNamedBinding(query);
Executed by:
  • tst_qsqlresult - unknown status
13
274-
275 return
executed 247 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 247 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
247
276}-
277bool QSqlResult::prepare(const QString& query)-
278{-
279 QSqlResultPrivate * const d = d_func();-
280 d->sql = query;-
281 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
282-
283 d->namedToPositionalBinding(query);-
284 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qsqlresult - unknown status
8
285 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
286}-
287-
288-
289-
290-
291-
292-
293-
294bool QSqlResult::exec()-
295{-
296 QSqlResultPrivate * const d = d_func();-
297 bool ret;-
298-
299 QString query = lastQuery();-
300 if (d->binds == NamedBinding
d->binds == NamedBindingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
301 int i;-
302 QVariant val;-
303 QString holder;-
304 for (i = d->holders.count() - 1; i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i) {
0
305 holder = d->holders.at(i).holderName;-
306 val = d->values.value(d->indexes.value(holder).value(0,-1));-
307 QSqlField f(QLatin1String(""), val.type());-
308 f.setValue(val);-
309 query = query.replace(d->holders.at(i).holderPos,-
310 holder.length(), driver()->formatValue(f));-
311 }
never executed: end of block
0
312 }
never executed: end of block
else {
0
313 QString val;-
314 int i = 0;-
315 int idx = 0;-
316 for (idx = 0; idx < d->values.count()
idx < d->values.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++idx) {
0
317 i = query.indexOf(QLatin1Char('?'), i);-
318 if (i == -1
i == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
319 continue;
never executed: continue;
0
320 QVariant var = d->values.value(idx);-
321 QSqlField f(QLatin1String(""), var.type());-
322 if (var.isNull()
var.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
323 f.clear();
never executed: f.clear();
0
324 else-
325 f.setValue(var);
never executed: f.setValue(var);
0
326 val = driver()->formatValue(f);-
327 query = query.replace(i, 1, driver()->formatValue(f));-
328 i += val.length();-
329 }
never executed: end of block
0
330 }
never executed: end of block
0
331-
332-
333 QString orig = lastQuery();-
334 ret = reset(query);-
335 d->executedQuery = query;-
336 setQuery(orig);-
337 d->resetBindCount();-
338 return
never executed: return ret;
ret;
never executed: return ret;
0
339}-
340-
341-
342-
343-
344-
345-
346-
347void QSqlResult::bindValue(int index, const QVariant& val, QSql::ParamType paramType)-
348{-
349 QSqlResultPrivate * const d = d_func();-
350 d->binds = PositionalBinding;-
351 QList<int>& indexes = d->indexes[d->fieldSerial(index)];-
352 if (!indexes.contains(index)
!indexes.contains(index)Description
TRUEevaluated 472 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
)
472-232988
353 indexes.append(index);
executed 472 times by 7 tests: indexes.append(index);
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
472
354 if (d->values.count() <= index
d->values.count() <= indexDescription
TRUEevaluated 472 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
)
472-232988
355 d->values.resize(index + 1);
executed 472 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
472
356 d->values[index] = val;-
357 if (paramType != QSql::In
paramType != QSql::InDescription
TRUEnever evaluated
FALSEevaluated 233460 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 233460 times by 7 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
)
0-233460
358 d->types[index] = paramType;
never executed: d->types[index] = paramType;
0
359}
executed 233460 times by 7 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
233460
360void QSqlResult::bindValue(const QString& placeholder, const QVariant& val,-
361 QSql::ParamType paramType)-
362{-
363 QSqlResultPrivate * const d = d_func();-
364 d->binds = NamedBinding;-
365-
366-
367 QList<int> indexes = d->indexes.value(placeholder);-
368 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(indexes)>::type> _container_((indexes)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (int idx = *_container_.i; _container_.control; _container_.control = 0) {-
369 if (d->values.count() <= idx
d->values.count() <= idxDescription
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_QSqlQuery
)
0-40
370 d->values.resize(idx + 1);
never executed: d->values.resize(idx + 1);
0
371 d->values[idx] = val;-
372 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
373 d->types[idx] = paramType;
never executed: d->types[idx] = paramType;
0
374 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_QSqlQuery
40
375}
executed 48 times by 2 tests: end of block
Executed by:
  • tst_QSqlQuery
  • tst_QSqlThread
48
376-
377-
378-
379-
380-
381-
382-
383void QSqlResult::addBindValue(const QVariant& val, QSql::ParamType paramType)-
384{-
385 QSqlResultPrivate * const d = d_func();-
386 d->binds = PositionalBinding;-
387 bindValue(d->bindCount, val, paramType);-
388 ++d->bindCount;-
389}
executed 233369 times by 5 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
233369
390-
391-
392-
393-
394-
395-
396-
397QVariant QSqlResult::boundValue(int index) const-
398{-
399 const QSqlResultPrivate * const d = d_func();-
400 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
401}-
402QVariant QSqlResult::boundValue(const QString& placeholder) const-
403{-
404 const QSqlResultPrivate * const d = d_func();-
405 QList<int> indexes = d->indexes.value(placeholder);-
406 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
407}-
408-
409-
410-
411-
412-
413-
414QSql::ParamType QSqlResult::bindValueType(int index) const-
415{-
416 const QSqlResultPrivate * const d = d_func();-
417 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
418}-
419-
420-
421-
422-
423-
424-
425-
426QSql::ParamType QSqlResult::bindValueType(const QString& placeholder) const-
427{-
428 const QSqlResultPrivate * const d = d_func();-
429 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
430}-
431-
432-
433-
434-
435-
436-
437int QSqlResult::boundValueCount() const-
438{-
439 const QSqlResultPrivate * const d = d_func();-
440 return
never executed: return d->values.count();
d->values.count();
never executed: return d->values.count();
0
441}-
442-
443-
444-
445-
446-
447-
448-
449QVector<QVariant>& QSqlResult::boundValues() const-
450{-
451 const QSqlResultPrivate * const d = d_func();-
452 return
executed 119180 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 119180 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
119180
453}-
454-
455-
456-
457-
458QSqlResult::BindingSyntax QSqlResult::bindingSyntax() const-
459{-
460 const QSqlResultPrivate * const d = d_func();-
461 return
never executed: return d->binds;
d->binds;
never executed: return d->binds;
0
462}-
463-
464-
465-
466-
467-
468void QSqlResult::clear()-
469{-
470 QSqlResultPrivate * const d = d_func();-
471 d->clear();-
472}
executed 2554 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
2554
473QString QSqlResult::executedQuery() const-
474{-
475 const QSqlResultPrivate * const d = d_func();-
476 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
477}-
478-
479-
480-
481-
482void QSqlResult::resetBindCount()-
483{-
484 QSqlResultPrivate * const d = d_func();-
485 d->resetBindCount();-
486}
executed 116732 times by 7 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSqlDatabase
  • tst_QSqlQuery
  • tst_QSqlQueryModel
  • tst_QSqlRelationalTableModel
  • tst_QSqlTableModel
  • tst_QSqlThread
116732
487-
488-
489-
490-
491-
492-
493-
494QString QSqlResult::boundValueName(int index) const-
495{-
496 const QSqlResultPrivate * const d = d_func();-
497 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
498}-
499-
500-
501-
502-
503-
504-
505-
506bool QSqlResult::hasOutValues() const-
507{-
508 const QSqlResultPrivate * const d = d_func();-
509 if (d->types.isEmpty()
d->types.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
510 return
never executed: return false;
false;
never executed: return false;
0
511 QHash<int, QSql::ParamType>::ConstIterator it;-
512 for (it = d->types.constBegin(); it != d->types.constEnd()
it != d->types.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
513 if (it.value() != QSql::In
it.value() != QSql::InDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
514 return
never executed: return true;
true;
never executed: return true;
0
515 }
never executed: end of block
0
516 return
never executed: return false;
false;
never executed: return false;
0
517}-
518QSqlRecord QSqlResult::record() const-
519{-
520 return
never executed: return QSqlRecord();
QSqlRecord();
never executed: return QSqlRecord();
0
521}-
522QVariant QSqlResult::lastInsertId() const-
523{-
524 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
525}-
526-
527-
528-
529void QSqlResult::virtual_hook(int, void *)-
530{-
531}-
532bool QSqlResult::execBatch(bool arrayBind)-
533{-
534 (void)arrayBind;;-
535 QSqlResultPrivate * const d = d_func();-
536-
537 QVector<QVariant> values = d->values;-
538 if (values.count() == 0
values.count() == 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSqlQuery
)
0-2
539 return
never executed: return false;
false;
never executed: return false;
0
540 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
541 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
542 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
543 if (!exec()
!exec()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSqlQuery
)
0-2
544 return
never executed: return false;
false;
never executed: return false;
0
545 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QSqlQuery
2
546 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
547}-
548-
549-
550-
551void QSqlResult::detachFromResultSet()-
552{-
553}-
554-
555-
556-
557void QSqlResult::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy)-
558{-
559 QSqlResultPrivate * const d = d_func();-
560 d->precisionPolicy = policy;-
561}
executed 4994 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
4994
562-
563-
564-
565QSql::NumericalPrecisionPolicy QSqlResult::numericalPrecisionPolicy() const-
566{-
567 const QSqlResultPrivate * const d = d_func();-
568 return
executed 2809 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 2809 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
2809
569}-
570-
571-
572-
573bool QSqlResult::nextResult()-
574{-
575 return
never executed: return false;
false;
never executed: return false;
0
576}-
577QVariant QSqlResult::handle() const-
578{-
579 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
580}-
581-
582-
Switch to Source codePreprocessed file

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