You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/bulk_insert/worker_test.rb
+9-9
Original file line number
Diff line number
Diff line change
@@ -266,7 +266,7 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
266
266
assert_equal@insert.insert_sql_statement,"INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES "
267
267
268
268
@insert.add["Yo",15,false,nil,nil]
269
-
assert_equal@insert.compose_insert_query,"INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse')"
269
+
assert_equal@insert.compose_insert_query,"INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,0,NULL,NULL,'chartreuse')"
270
270
end
271
271
272
272
test"adapter dependent mysql methods"do
@@ -286,7 +286,7 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
286
286
287
287
mysql_worker.add["Yo",15,false,nil,nil]
288
288
289
-
assert_equalmysql_worker.compose_insert_query,"INSERT IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse')"
289
+
assert_equalmysql_worker.compose_insert_query,"INSERT IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,0,NULL,NULL,'chartreuse')"
290
290
end
291
291
292
292
test"adapter dependent mysql methods work for mysql2"do
@@ -305,7 +305,7 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
305
305
306
306
mysql_worker.add["Yo",15,false,nil,nil]
307
307
308
-
assert_equalmysql_worker.compose_insert_query,"INSERT IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse') ON DUPLICATE KEY UPDATE `greeting`=VALUES(`greeting`), `age`=VALUES(`age`), `happy`=VALUES(`happy`), `created_at`=VALUES(`created_at`), `updated_at`=VALUES(`updated_at`), `color`=VALUES(`color`)"
308
+
assert_equalmysql_worker.compose_insert_query,"INSERT IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,0,NULL,NULL,'chartreuse') ON DUPLICATE KEY UPDATE `greeting`=VALUES(`greeting`), `age`=VALUES(`age`), `happy`=VALUES(`happy`), `created_at`=VALUES(`created_at`), `updated_at`=VALUES(`updated_at`), `color`=VALUES(`color`)"
309
309
end
310
310
311
311
test"adapter dependent Mysql2Spatial methods"do
@@ -322,7 +322,7 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
322
322
323
323
mysql_worker.add["Yo",15,false,nil,nil]
324
324
325
-
assert_equalmysql_worker.compose_insert_query,"INSERT IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse')"
325
+
assert_equalmysql_worker.compose_insert_query,"INSERT IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,0,NULL,NULL,'chartreuse')"
326
326
end
327
327
328
328
test"adapter dependent postgresql methods"do
@@ -339,7 +339,7 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
339
339
pgsql_worker.adapter_name='PostgreSQL'
340
340
pgsql_worker.add["Yo",15,false,nil,nil]
341
341
342
-
assert_equalpgsql_worker.compose_insert_query,"INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse') ON CONFLICT DO NOTHING RETURNING id"
342
+
assert_equalpgsql_worker.compose_insert_query,"INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,0,NULL,NULL,'chartreuse') ON CONFLICT DO NOTHING RETURNING id"
343
343
end
344
344
345
345
test"adapter dependent PostGIS methods"do
@@ -356,7 +356,7 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
356
356
pgsql_worker.adapter_name='PostGIS'
357
357
pgsql_worker.add["Yo",15,false,nil,nil]
358
358
359
-
assert_equalpgsql_worker.compose_insert_query,"INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse') ON CONFLICT DO NOTHING RETURNING id"
359
+
assert_equalpgsql_worker.compose_insert_query,"INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,0,NULL,NULL,'chartreuse') ON CONFLICT DO NOTHING RETURNING id"
@@ -370,7 +370,7 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
370
370
sqlite_worker.adapter_name='sqlite3'
371
371
sqlite_worker.add["Yo",15,false,nil,nil]
372
372
373
-
assert_equalsqlite_worker.compose_insert_query,"INSERT OR IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse')"
373
+
assert_equalsqlite_worker.compose_insert_query,"INSERT OR IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,0,NULL,NULL,'chartreuse')"
@@ -384,7 +384,7 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
384
384
sqlite_worker.adapter_name='SQLite'
385
385
sqlite_worker.add["Yo",15,false,nil,nil]
386
386
387
-
assert_equalsqlite_worker.compose_insert_query,"INSERT OR IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse')"
387
+
assert_equalsqlite_worker.compose_insert_query,"INSERT OR IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,0,NULL,NULL,'chartreuse')"
388
388
end
389
389
390
390
test"mysql adapter can update duplicates"do
@@ -399,6 +399,6 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
399
399
mysql_worker.adapter_name='MySQL'
400
400
mysql_worker.add["Yo",15,false,nil,nil]
401
401
402
-
assert_equalmysql_worker.compose_insert_query,"INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse') ON DUPLICATE KEY UPDATE `greeting`=VALUES(`greeting`), `age`=VALUES(`age`), `happy`=VALUES(`happy`), `created_at`=VALUES(`created_at`), `updated_at`=VALUES(`updated_at`), `color`=VALUES(`color`)"
402
+
assert_equalmysql_worker.compose_insert_query,"INSERT INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,0,NULL,NULL,'chartreuse') ON DUPLICATE KEY UPDATE `greeting`=VALUES(`greeting`), `age`=VALUES(`age`), `happy`=VALUES(`happy`), `created_at`=VALUES(`created_at`), `updated_at`=VALUES(`updated_at`), `color`=VALUES(`color`)"
0 commit comments