Skip to content

Commit 364a488

Browse files
committed
Add ORDER BYs to test queries for better portability
1 parent b759552 commit 364a488

File tree

9 files changed

+34
-34
lines changed

9 files changed

+34
-34
lines changed

test/autoCommitForSelect.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ describe('8. autoCommitForSelect.js', function(){
155155
},
156156
function(callback){
157157
connection.execute(
158-
"SELECT * FROM nodb_departments",
158+
"SELECT * FROM nodb_departments ORDER BY department_id",
159159
function(err, result){
160160
should.not.exist(err);
161161
(result.rows).should.containEql([180, 'Construction']);
@@ -165,7 +165,7 @@ describe('8. autoCommitForSelect.js', function(){
165165
},
166166
function(callback){
167167
anotherConnection.execute(
168-
"SELECT * FROM nodb_departments",
168+
"SELECT * FROM nodb_departments ORDER BY department_id",
169169
function(err, result){
170170
should.not.exist(err);
171171
(result.rows).should.not.containEql([180, 'Construction']);
@@ -227,7 +227,7 @@ describe('8. autoCommitForSelect.js', function(){
227227
},
228228
function(callback){
229229
connection.execute(
230-
"SELECT * FROM nodb_departments",
230+
"SELECT * FROM nodb_departments ORDER BY department_id",
231231
function(err, result){
232232
should.not.exist(err);
233233
(result.rows).should.containEql([180, 'Construction']);
@@ -237,7 +237,7 @@ describe('8. autoCommitForSelect.js', function(){
237237
},
238238
function(callback){
239239
anotherConnection.execute(
240-
"SELECT * FROM nodb_departments",
240+
"SELECT * FROM nodb_departments ORDER BY department_id",
241241
function(err, result){
242242
should.not.exist(err);
243243
(result.rows).should.containEql([180, 'Construction']);
@@ -299,7 +299,7 @@ describe('8. autoCommitForSelect.js', function(){
299299
},
300300
function(callback){
301301
connection.execute(
302-
"SELECT * FROM nodb_departments",
302+
"SELECT * FROM nodb_departments ORDER BY department_id",
303303
{},
304304
{autoCommit: true},
305305
function(err, result){
@@ -311,7 +311,7 @@ describe('8. autoCommitForSelect.js', function(){
311311
},
312312
function(callback){
313313
anotherConnection.execute(
314-
"SELECT * FROM nodb_departments",
314+
"SELECT * FROM nodb_departments ORDER BY department_id",
315315
function(err, result){
316316
should.not.exist(err);
317317
(result.rows).should.containEql([180, 'Construction']);

test/binding.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ describe('4. binding.js', function() {
385385
result.outBinds[0].should.eql([1]);
386386
// console.log(result);
387387
connection.execute(
388-
"SELECT * FROM nodb_binding",
388+
"SELECT * FROM nodb_binding ORDER BY id",
389389
[],
390390
options,
391391
function(err, result) {
@@ -410,7 +410,7 @@ describe('4. binding.js', function() {
410410
(err.message).should.startWith('NJS-044');
411411
// NJS-044: named JSON object is not expected in this context
412412
connection.execute(
413-
"SELECT * FROM nodb_binding",
413+
"SELECT * FROM nodb_binding ORDER BY id",
414414
[],
415415
options,
416416
function(err, result) {
@@ -493,7 +493,7 @@ describe('4. binding.js', function() {
493493
should.not.exist(err);
494494
result.rowsAffected.should.be.exactly(1);
495495
connection.execute(
496-
"SELECT * FROM nodb_binding",
496+
"SELECT * FROM nodb_binding ORDER BY num",
497497
[],
498498
options,
499499
function(err, result) {
@@ -517,7 +517,7 @@ describe('4. binding.js', function() {
517517
//console.log(result);
518518
result.outBinds.should.eql({ '3': [123] });
519519
connection.execute(
520-
"SELECT * FROM nodb_binding",
520+
"SELECT * FROM nodb_binding ORDER BY num",
521521
[],
522522
options,
523523
function(err, result) {
@@ -540,7 +540,7 @@ describe('4. binding.js', function() {
540540
result.rowsAffected.should.be.exactly(1);
541541
// console.log(result);
542542
connection.execute(
543-
"SELECT * FROM nodb_binding",
543+
"SELECT * FROM nodb_binding ORDER BY num",
544544
[],
545545
options,
546546
function(err, result) {
@@ -564,7 +564,7 @@ describe('4. binding.js', function() {
564564
// console.log(result);
565565
result.outBinds[0].should.eql([123]);
566566
connection.execute(
567-
"SELECT * FROM nodb_binding",
567+
"SELECT * FROM nodb_binding ORDER BY num",
568568
[],
569569
options,
570570
function(err, result) {

test/columnMetadata.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ describe('9. columnMetadata.js', function(){
158158
it('9.1.4 shows metaData correctly when retrieving all columns with [SELECT * FROM table] statement', function(done){
159159

160160
connection.execute(
161-
"SELECT * FROM nodb_departments",
161+
"SELECT * FROM nodb_departments ORDER BY department_id",
162162
function(err, result){
163163
should.not.exist(err);
164164
result.rows.length.should.be.exactly(3);
@@ -260,7 +260,7 @@ describe('9. columnMetadata.js', function(){
260260

261261
var sqlWith = "WITH nodb_dep AS " +
262262
"(SELECT * FROM nodb_departments WHERE location_id < 2000) " +
263-
"SELECT * FROM nodb_dep WHERE department_id > 50";
263+
"SELECT * FROM nodb_dep WHERE department_id > 50 ORDER BY department_id";
264264

265265
connection.execute(
266266
sqlWith,
@@ -278,7 +278,7 @@ describe('9. columnMetadata.js', function(){
278278

279279
it('9.1.10 displays metaData correctly with result set', function(done) {
280280
connection.execute(
281-
"SELECT * FROM nodb_departments",
281+
"SELECT * FROM nodb_departments ORDER BY department_id",
282282
[],
283283
{ resultSet: true },
284284
function(err, result) {

test/connection.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ describe('1. connection.js', function(){
218218

219219
connection.should.be.ok;
220220
connection.execute(
221-
"SELECT * FROM nodb_employees",
221+
"SELECT * FROM nodb_employees ORDER BY employee_id",
222222
function(err, result){
223223
should.not.exist(err);
224224
should.exist(result);
@@ -232,7 +232,7 @@ describe('1. connection.js', function(){
232232
it('1.2.2 can also specify for each execution', function(done){
233233
connection.should.be.ok;
234234
connection.execute(
235-
"SELECT * FROM nodb_employees",
235+
"SELECT * FROM nodb_employees ORDER BY employee_id",
236236
{}, { maxRows: 25 },
237237
function(err, result){
238238
should.not.exist(err);
@@ -247,7 +247,7 @@ describe('1. connection.js', function(){
247247
it('1.2.3 can not set maxRows to be 0', function(done){
248248
connection.should.be.ok;
249249
connection.execute(
250-
"SELECT * FROM nodb_employees",
250+
"SELECT * FROM nodb_employees ORDER BY employee_id",
251251
{}, { maxRows: 0 },
252252
function(err, result){
253253
should.exist(err);
@@ -261,7 +261,7 @@ describe('1. connection.js', function(){
261261
it('1.2.4 cannot set maxRows to be a negative number', function(done){
262262
connection.should.be.ok;
263263
connection.execute(
264-
"SELECT * FROM nodb_employees",
264+
"SELECT * FROM nodb_employees ORDER BY employee_id",
265265
{}, {maxRows: -5},
266266
function(err, result){
267267
should.exist(err);
@@ -273,7 +273,7 @@ describe('1. connection.js', function(){
273273

274274
it('1.2.5 sets maxRows to be very large value', function(done) {
275275
connection.execute(
276-
"SELECT * FROM nodb_employees",
276+
"SELECT * FROM nodb_employees ORDER BY employee_id",
277277
{},
278278
{maxRows: 500000},
279279
function(err, result){

test/dataTypeAssist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ assist.sqlCreateTable = function(tableName)
483483
assist.dataTypeSupport = function(connection, tableName, array, done) {
484484
connection.should.be.ok;
485485
connection.execute(
486-
"SELECT * FROM " + tableName,
486+
"SELECT * FROM " + tableName + " ORDER BY num",
487487
[],
488488
{ outFormat: oracledb.OBJECT },
489489
function(err, result) {

test/examples.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ describe('3. examples.js', function(){
485485

486486
connection.should.be.ok;
487487
connection.execute(
488-
"SELECT * FROM nodb_employees",
488+
"SELECT * FROM nodb_employees ORDER BY employees_id",
489489
function(err, result){
490490
should.not.exist(err);
491491
should.exist(result);
@@ -499,7 +499,7 @@ describe('3. examples.js', function(){
499499
it('3.6.2 can also specify for each execution', function(done){
500500
connection.should.be.ok;
501501
connection.execute(
502-
"SELECT * FROM nodb_employees",
502+
"SELECT * FROM nodb_employees ORDER BY employees_id",
503503
{}, {maxRows: 25},
504504
function(err, result){
505505
should.not.exist(err);
@@ -801,7 +801,7 @@ describe('3. examples.js', function(){
801801
},
802802
function(callback){
803803
conn2.execute(
804-
"SELECT * FROM nodb_testcommit",
804+
"SELECT * FROM nodb_testcommit ORDER BY id",
805805
function(err, result){
806806
should.not.exist(err);
807807
// This will only show 'Chris' because inserting 'Alison' is not commited by default.
@@ -926,7 +926,7 @@ describe('3. examples.js', function(){
926926
var numRows = 10; // number of rows to return from each call to getRows()
927927

928928
connection.execute(
929-
"SELECT * FROM nodb_employees",
929+
"SELECT * FROM nodb_employees ORDER BY employees_id",
930930
[],
931931
{ resultSet: true, prefetchRows: 110 },
932932
function(err, result) {
@@ -1015,7 +1015,7 @@ describe('3. examples.js', function(){
10151015
AS \
10161016
BEGIN \
10171017
OPEN p_recordset FOR \
1018-
SELECT * FROM nodb_employees \
1018+
SELECT * FROM nodb_employees\
10191019
WHERE salary > p_sal; \
10201020
END; ";
10211021

test/properties.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ describe('58. properties.js', function() {
493493
},
494494
function(callback) {
495495
connection.execute(
496-
"SELECT * FROM " + tableName,
496+
"SELECT * FROM " + tableName + " ORDER BY num",
497497
[],
498498
{ resultSet: true, outFormat: oracledb.OBJECT },
499499
function(err, result) {

test/resultSet1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ describe('12. resultSet1.js', function() {
13031303
var accessCount = 0;
13041304
var rowsLimit = 50;
13051305
connection.execute(
1306-
"SELECT * FROM nodb_employees",
1306+
"SELECT * FROM nodb_employees ORDER BY employees_id",
13071307
[],
13081308
{ resultSet: true, maxRows: rowsLimit },
13091309
function(err, result) {

test/resultSet2.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ describe('55. resultSet2.js', function() {
297297
it('55.4.1 result set', function(done) {
298298
conn2.should.be.ok;
299299
conn2.execute(
300-
"SELECT * FROM nodb_employees",
300+
"SELECT * FROM nodb_employees ORDER BY employees_id",
301301
[],
302302
{ resultSet: true },
303303
function(err, result) {
@@ -340,7 +340,7 @@ describe('55. resultSet2.js', function() {
340340
async.series([
341341
function(callback) {
342342
connection.execute(
343-
"SELECT * FROM nodb_employees",
343+
"SELECT * FROM nodb_employees ORDER BY employees_id",
344344
[],
345345
{ resultSet: true },
346346
function(err, result) {
@@ -431,7 +431,7 @@ describe('55. resultSet2.js', function() {
431431
connection.should.be.ok;
432432

433433
connection.execute(
434-
"SELECT * FROM nodb_employees",
434+
"SELECT * FROM nodb_employees ORDER BY employees_id",
435435
[],
436436
{ resultSet: true },
437437
function(err, result) {
@@ -543,7 +543,7 @@ describe('55. resultSet2.js', function() {
543543
async.parallel([
544544
function(callback) {
545545
connection.execute(
546-
"SELECT * FROM nodb_employees",
546+
"SELECT * FROM nodb_employees ORDER BY employees_id",
547547
[],
548548
{ resultSet: true },
549549
function(err, result) {
@@ -554,7 +554,7 @@ describe('55. resultSet2.js', function() {
554554
},
555555
function(callback) {
556556
connection.execute(
557-
"SELECT * FROM nodb_employees",
557+
"SELECT * FROM nodb_employees ORDER BY employees_id",
558558
[],
559559
{ resultSet: true },
560560
function(err, result) {
@@ -715,7 +715,7 @@ describe('55. resultSet2.js', function() {
715715
var numRows = 10;
716716
var closeRS = true;
717717
connection.execute(
718-
"SELECT * FROM nodb_employees",
718+
"SELECT * FROM nodb_employees ORDER BY employees_id",
719719
[],
720720
{ resultSet: true },
721721
function(err, result) {

0 commit comments

Comments
 (0)