@@ -120,7 +120,6 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
120
120
auto txn = txn_manager.BeginTransaction ();
121
121
// Adding in 200 random decimal inputs between [-127, 127]
122
122
int i;
123
- std::vector<int8_t > inputs;
124
123
int lo = 0 ;
125
124
int hi = 254 ;
126
125
int numEntries = 200 ;
@@ -133,7 +132,6 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
133
132
std::srand (std::time (0 ));
134
133
for (i = 0 ; i < numEntries; i++) {
135
134
int32_t num = (std::rand () % (hi - lo)) - 127 ;
136
- inputs.push_back (num);
137
135
std::ostringstream os;
138
136
os << " insert into foo values(" << i << " , " << num << " );" ;
139
137
TestingSQLUtil::ExecuteSQLQuery (os.str ());
@@ -144,6 +142,10 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
144
142
ref_result.push_back (result_string.str ());
145
143
}
146
144
EXPECT_EQ (i, numEntries);
145
+
146
+ // Add an additional entry of NULL
147
+ TestingSQLUtil::ExecuteSQLQuery (" insert into foo values(0, NULL)" );
148
+ ref_result.push_back (" 0|" );
147
149
txn_manager.CommitTransaction (txn);
148
150
149
151
TestingSQLUtil::ExecuteSQLQueryAndCheckResult (result_query,
@@ -157,7 +159,6 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
157
159
auto txn = txn_manager.BeginTransaction ();
158
160
// Adding in 200 random integer inputs between [-32767, 32767]
159
161
int i;
160
- std::vector<int16_t > inputs;
161
162
int lo = 0 ;
162
163
int hi = 65534 ;
163
164
int numEntries = 200 ;
@@ -170,7 +171,6 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
170
171
std::srand (std::time (0 ));
171
172
for (i = 0 ; i < numEntries; i++) {
172
173
int32_t num = (std::rand () % (hi - lo)) - 32767 ;
173
- inputs.push_back (num);
174
174
std::ostringstream os;
175
175
os << " insert into foo values(" << i << " , " << num << " );" ;
176
176
TestingSQLUtil::ExecuteSQLQuery (os.str ());
@@ -181,6 +181,10 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
181
181
ref_result.push_back (result_string.str ());
182
182
}
183
183
EXPECT_EQ (i, numEntries);
184
+
185
+ // Add an additional entry of NULL
186
+ TestingSQLUtil::ExecuteSQLQuery (" insert into foo values(0, NULL)" );
187
+ ref_result.push_back (" 0|" );
184
188
txn_manager.CommitTransaction (txn);
185
189
186
190
TestingSQLUtil::ExecuteSQLQueryAndCheckResult (result_query,
@@ -194,7 +198,6 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
194
198
auto txn = txn_manager.BeginTransaction ();
195
199
// Adding in 200 random integer inputs between [-32767, 32767]
196
200
int i;
197
- std::vector<int32_t > inputs;
198
201
int lo = 0 ;
199
202
int hi = 65534 ;
200
203
int numEntries = 200 ;
@@ -207,7 +210,6 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
207
210
std::srand (std::time (0 ));
208
211
for (i = 0 ; i < numEntries; i++) {
209
212
int32_t num = (std::rand () % (hi - lo)) - 32767 ;
210
- inputs.push_back (num);
211
213
std::ostringstream os;
212
214
os << " insert into foo values(" << i << " , " << num << " );" ;
213
215
TestingSQLUtil::ExecuteSQLQuery (os.str ());
@@ -218,6 +220,10 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
218
220
ref_result.push_back (result_string.str ());
219
221
}
220
222
EXPECT_EQ (i, numEntries);
223
+
224
+ // Add an additional entry of NULL
225
+ TestingSQLUtil::ExecuteSQLQuery (" insert into foo values(0, NULL)" );
226
+ ref_result.push_back (" 0|" );
221
227
txn_manager.CommitTransaction (txn);
222
228
223
229
TestingSQLUtil::ExecuteSQLQueryAndCheckResult (result_query,
@@ -231,7 +237,6 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
231
237
auto txn = txn_manager.BeginTransaction ();
232
238
// Adding in 200 random integer inputs between [-32767, 32767]
233
239
int i;
234
- std::vector<int32_t > inputs;
235
240
int lo = 0 ;
236
241
int hi = 65534 ;
237
242
int numEntries = 200 ;
@@ -244,7 +249,6 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
244
249
std::srand (std::time (0 ));
245
250
for (i = 0 ; i < numEntries; i++) {
246
251
int32_t num = (std::rand () % (hi - lo)) - 32767 ;
247
- inputs.push_back (num);
248
252
std::ostringstream os;
249
253
os << " insert into foo values(" << i << " , " << num << " );" ;
250
254
TestingSQLUtil::ExecuteSQLQuery (os.str ());
@@ -255,6 +259,10 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
255
259
ref_result.push_back (result_string.str ());
256
260
}
257
261
EXPECT_EQ (i, numEntries);
262
+
263
+ // Add an additional entry of NULL
264
+ TestingSQLUtil::ExecuteSQLQuery (" insert into foo values(0, NULL)" );
265
+ ref_result.push_back (" 0|" );
258
266
txn_manager.CommitTransaction (txn);
259
267
260
268
TestingSQLUtil::ExecuteSQLQueryAndCheckResult (result_query,
@@ -268,7 +276,6 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
268
276
auto txn = txn_manager.BeginTransaction ();
269
277
// Adding in 2500 random decimal inputs between [-500, 500]
270
278
int i;
271
- std::vector<double > inputs;
272
279
int lo = -500 ;
273
280
int hi = 500 ;
274
281
int numEntries = 500 ;
@@ -281,7 +288,6 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
281
288
std::srand (std::time (0 ));
282
289
for (i = 0 ; i < numEntries; i++) {
283
290
double num = 0.45 + (std::rand () % (hi - lo));
284
- inputs.push_back (num);
285
291
std::ostringstream os;
286
292
os << " insert into foo values(" << i << " , " << num << " );" ;
287
293
TestingSQLUtil::ExecuteSQLQuery (os.str ());
@@ -292,6 +298,8 @@ class DecimalFunctionsSQLTest : public PelotonTest {};
292
298
ref_result.push_back (result_string.str ());
293
299
}
294
300
EXPECT_EQ (i, numEntries);
301
+ TestingSQLUtil::ExecuteSQLQuery (" insert into foo values(0, NULL)" );
302
+ ref_result.push_back (" 0|" );
295
303
txn_manager.CommitTransaction (txn);
296
304
297
305
TestingSQLUtil::ExecuteSQLQueryAndCheckResult (result_query,
0 commit comments