Skip to content

Commit

Permalink
Ensure all rows are inserted for LastInsertIdSync and createTestTable…
Browse files Browse the repository at this point in the history
…Complex2BinaryBlobs tests, refs #113
  • Loading branch information
Sannis committed Apr 2, 2012
1 parent afd77c2 commit 1a9d83f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
7 changes: 5 additions & 2 deletions tests/complex/test-binary-buffers.js
Expand Up @@ -37,8 +37,11 @@ exports.createTestTableComplex2BinaryBlobs = function (test) {
" (vc, vbi, bi, b) VALUES ('34\\0\\0', '34\\0\\0', '34\\0\\0', '34\\0\\0');") && res;
test.ok(res, "conn.querySync('INSERT INTO test_table2 ...')");

conn.closeSync();
test.done();
// Ensure all rows are inserted
setTimeout(function () {
conn.closeSync();
test.done();
}, 100);
};

exports.FetchAllSyncWithBinaryFields = function (test) {
Expand Down
13 changes: 8 additions & 5 deletions tests/simple/test-class-mysqlconnection.js
Expand Up @@ -507,12 +507,15 @@ exports.LastInsertIdSync = function (test) {
}

test.equals(res, true, "Insert " + cfg.insert_rows_count + " rows into table " + cfg.test_table);
last_insert_id = conn.lastInsertIdSync();
test.equals(last_insert_id, cfg.insert_rows_count, "conn.lastInsertIdSync()");

conn.closeSync();

test.done();
// Ensure all rows are inserted
setTimeout(function () {
last_insert_id = conn.lastInsertIdSync();
test.equals(last_insert_id, cfg.insert_rows_count, "conn.lastInsertIdSync()");

conn.closeSync();
test.done();
}, 100);
};

exports.MultiMoreResultsSync = function (test) {
Expand Down

0 comments on commit 1a9d83f

Please sign in to comment.