bulk_insert 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: daeb75000c0960a475cd101c0e5f631ed67cc254
4
- data.tar.gz: 0f7bb5595ee7bbc9c259beb1f65a88c5497470ff
3
+ metadata.gz: 617835c3fcaa4df1727930d799629a1c6c327537
4
+ data.tar.gz: d329fbca56f8be8dc7f79a976843774331eec70e
5
5
  SHA512:
6
- metadata.gz: 6d0bdabab8912f6245403cc420f0f5c5c3d7dc5f8fd922bc0bbb3be057d02fbb58d122c24d1a27a818737280dd6291b350dacdf8719fddd229beee9470ce3e54
7
- data.tar.gz: 1d8334c2676c67d3177aa764409851335288b690bc31362ee20219aac1547c91b39d37f7ecccae82f5ae03740b0885c684f065a08625ced795483793b1daf285
6
+ metadata.gz: 249e90f483244c07d49843619ebd7248b34df29510c2382e1b5f65d3479296e6a1c768d2b00e1d9cc1d3beb58413b2396fa7a13e397ca5b826ec4d15801fde1a
7
+ data.tar.gz: 3e1d944d3a19fc3b5803c44118166c96348092bfe1c5651bb1c67d090708ec54dd9c46385404cad4db7b8265e03517dbf7774e77c0cce5dfb247cbbf414a992c
data/README.md CHANGED
@@ -149,6 +149,24 @@ Book.bulk_insert(*destination_columns, ignore: true) do |worker|
149
149
  end
150
150
  ```
151
151
 
152
+ ### Update Duplicates (MySQL)
153
+
154
+ If you don't want to ignore duplicate rows but instead want to update them
155
+ then you can use the _update_duplicates_ option. Set this option to true
156
+ and when a duplicate row is found the row will be updated with your new
157
+ values. Default value for this option is false.
158
+
159
+ ```ruby
160
+ destination_columns = [:title, :author]
161
+
162
+ # Update duplicate rows
163
+ Book.bulk_insert(*destination_columns, update_duplicates: true) do |worker|
164
+ worker.add(...)
165
+ worker.add(...)
166
+ # ...
167
+ end
168
+ ```
169
+
152
170
 
153
171
  ## License
154
172
 
@@ -4,9 +4,9 @@ module BulkInsert
4
4
  extend ActiveSupport::Concern
5
5
 
6
6
  module ClassMethods
7
- def bulk_insert(*columns, values: nil, set_size:500, ignore: false)
7
+ def bulk_insert(*columns, values: nil, set_size:500, ignore: false, update_duplicates: false)
8
8
  columns = default_bulk_columns if columns.empty?
9
- worker = BulkInsert::Worker.new(connection, table_name, columns, set_size, ignore)
9
+ worker = BulkInsert::Worker.new(connection, table_name, columns, set_size, ignore, update_duplicates)
10
10
 
11
11
  if values.present?
12
12
  transaction do
@@ -1,6 +1,6 @@
1
1
  module BulkInsert
2
2
  MAJOR = 1
3
- MINOR = 5
3
+ MINOR = 6
4
4
  TINY = 0
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join(".")
@@ -5,15 +5,16 @@ module BulkInsert
5
5
  attr_accessor :before_save_callback
6
6
  attr_accessor :after_save_callback
7
7
  attr_accessor :adapter_name
8
- attr_reader :ignore
8
+ attr_reader :ignore, :update_duplicates
9
9
 
10
- def initialize(connection, table_name, column_names, set_size=500, ignore=false)
10
+ def initialize(connection, table_name, column_names, set_size=500, ignore=false, update_duplicates=false)
11
11
  @connection = connection
12
12
  @set_size = set_size
13
13
 
14
14
  @adapter_name = connection.adapter_name
15
15
  # INSERT IGNORE only fails inserts with duplicate keys or unallowed nulls not the whole set of inserts
16
16
  @ignore = ignore
17
+ @update_duplicates = update_duplicates
17
18
 
18
19
  columns = connection.columns(table_name)
19
20
  column_map = columns.inject({}) { |h, c| h.update(c.name => c) }
@@ -85,7 +86,7 @@ module BulkInsert
85
86
 
86
87
  def compose_insert_query
87
88
  sql = insert_sql_statement
88
- @now = Time.now
89
+ @now = Time.now
89
90
  rows = []
90
91
 
91
92
  @set.each do |row|
@@ -113,21 +114,33 @@ module BulkInsert
113
114
  end
114
115
 
115
116
  def insert_sql_statement
116
- insert_ignore = if ignore
117
- if adapter_name == "MySQL"
117
+ "INSERT #{insert_ignore} INTO #{@table_name} (#{@column_names}) VALUES "
118
+ end
119
+
120
+ def insert_ignore
121
+ if ignore
122
+ case adapter_name
123
+ when /^mysql/i
118
124
  'IGNORE'
119
- elsif adapter_name.match(/sqlite.*/i)
125
+ when /\ASQLite/i # SQLite
120
126
  'OR IGNORE'
121
127
  else
122
128
  '' # Not supported
123
129
  end
124
130
  end
125
-
126
- "INSERT #{insert_ignore} INTO #{@table_name} (#{@column_names}) VALUES "
127
131
  end
128
132
 
129
133
  def on_conflict_statement
130
- (adapter_name == 'PostgreSQL' && ignore ) ? ' ON CONFLICT DO NOTHING' : ''
134
+ if (adapter_name =~ /\APost(?:greSQL|GIS)/i && ignore )
135
+ ' ON CONFLICT DO NOTHING'
136
+ elsif adapter_name =~ /^mysql/i && update_duplicates
137
+ update_values = @columns.map do |column|
138
+ "#{column.name}=VALUES(#{column.name})"
139
+ end.join(', ')
140
+ ' ON DUPLICATE KEY UPDATE ' + update_values
141
+ else
142
+ ''
143
+ end
131
144
  end
132
145
  end
133
146
  end
@@ -240,6 +240,40 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
240
240
  assert_equal mysql_worker.compose_insert_query, "INSERT IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse')"
241
241
  end
242
242
 
243
+ test "adapter dependent mysql methods work for mysql2" do
244
+ mysql_worker = BulkInsert::Worker.new(
245
+ Testing.connection,
246
+ Testing.table_name,
247
+ %w(greeting age happy created_at updated_at color),
248
+ 500, # batch size
249
+ true, # ignore
250
+ true) # update_duplicates
251
+ mysql_worker.adapter_name = 'Mysql2'
252
+
253
+ assert_equal mysql_worker.adapter_name, 'Mysql2'
254
+ assert mysql_worker.ignore
255
+
256
+ mysql_worker.add ["Yo", 15, false, nil, nil]
257
+
258
+ assert_equal mysql_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)"
259
+ end
260
+
261
+ test "adapter dependent Mysql2Spatial methods" do
262
+ mysql_worker = BulkInsert::Worker.new(
263
+ Testing.connection,
264
+ Testing.table_name,
265
+ %w(greeting age happy created_at updated_at color),
266
+ 500, # batch size
267
+ true) # ignore
268
+ mysql_worker.adapter_name = 'Mysql2Spatial'
269
+
270
+ assert_equal mysql_worker.adapter_name, 'Mysql2Spatial'
271
+
272
+ mysql_worker.add ["Yo", 15, false, nil, nil]
273
+
274
+ assert_equal mysql_worker.compose_insert_query, "INSERT IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse')"
275
+ end
276
+
243
277
  test "adapter dependent postgresql methods" do
244
278
  pgsql_worker = BulkInsert::Worker.new(
245
279
  Testing.connection,
@@ -253,6 +287,19 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
253
287
  assert_equal pgsql_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"
254
288
  end
255
289
 
290
+ test "adapter dependent PostGIS methods" do
291
+ pgsql_worker = BulkInsert::Worker.new(
292
+ Testing.connection,
293
+ Testing.table_name,
294
+ %w(greeting age happy created_at updated_at color),
295
+ 500, # batch size
296
+ true) # ignore
297
+ pgsql_worker.adapter_name = 'PostGIS'
298
+ pgsql_worker.add ["Yo", 15, false, nil, nil]
299
+
300
+ assert_equal pgsql_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"
301
+ end
302
+
256
303
  test "adapter dependent sqlite3 methods (with lowercase adapter name)" do
257
304
  sqlite_worker = BulkInsert::Worker.new(
258
305
  Testing.connection,
@@ -278,4 +325,18 @@ class BulkInsertWorkerTest < ActiveSupport::TestCase
278
325
 
279
326
  assert_equal sqlite_worker.compose_insert_query, "INSERT OR IGNORE INTO \"testings\" (\"greeting\",\"age\",\"happy\",\"created_at\",\"updated_at\",\"color\") VALUES ('Yo',15,'f',NULL,NULL,'chartreuse')"
280
327
  end
328
+
329
+ test "mysql adapter can update duplicates" do
330
+ mysql_worker = BulkInsert::Worker.new(
331
+ Testing.connection,
332
+ Testing.table_name,
333
+ %w(greeting age happy created_at updated_at color),
334
+ 500, # batch size
335
+ false, # ignore
336
+ true) # update_duplicates
337
+ mysql_worker.adapter_name = 'MySQL'
338
+ mysql_worker.add ["Yo", 15, false, nil, nil]
339
+
340
+ assert_equal mysql_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)"
341
+ end
281
342
  end
@@ -4349,3 +4349,1068 @@ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
4349
4349
  -------------------------------------------------------------
4350
4350
   (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-06-19 19:56:44.825699','2017-06-19 19:56:44.825699','chartreuse'),('Hello',25,'t','2017-06-19 19:56:44.825699','2017-06-19 19:56:44.825699','chartreuse')
4351
4351
   (0.2ms) rollback transaction
4352
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
4353
+  (0.1ms) begin transaction
4354
+ --------------------------------------------------------------------
4355
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
4356
+ --------------------------------------------------------------------
4357
+  (0.1ms) rollback transaction
4358
+  (0.0ms) begin transaction
4359
+ ---------------------------------------------------------------------
4360
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
4361
+ ---------------------------------------------------------------------
4362
+  (0.0ms) rollback transaction
4363
+  (0.0ms) begin transaction
4364
+ ----------------------------------------------------------------------------------------------
4365
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
4366
+ ----------------------------------------------------------------------------------------------
4367
+  (1.0ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 15:38:27.588465','2017-09-28 15:38:27.588465','chartreuse'),('Howdy',20,'f','2017-09-28 15:38:27.588465','2017-09-28 15:38:27.588465','chartreuse')
4368
+ Testing Load (0.2ms) SELECT "testings".* FROM "testings"
4369
+  (0.3ms) rollback transaction
4370
+  (0.1ms) begin transaction
4371
+ ----------------------------------------------------------------------------
4372
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
4373
+ ----------------------------------------------------------------------------
4374
+  (0.0ms) rollback transaction
4375
+  (0.0ms) begin transaction
4376
+ ----------------------------------------------------------
4377
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods
4378
+ ----------------------------------------------------------
4379
+  (0.0ms) rollback transaction
4380
+  (0.0ms) begin transaction
4381
+ -------------------------------------------------------------------
4382
+ BulkInsertWorkerTest: test_after_save_callback_can_be_set_as_a_proc
4383
+ -------------------------------------------------------------------
4384
+  (0.0ms) rollback transaction
4385
+  (0.0ms) begin transaction
4386
+ -------------------------------------------------------------
4387
+ BulkInsertWorkerTest: test_before_save_can_manipulate_the_set
4388
+ -------------------------------------------------------------
4389
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',25,'t','2017-09-28 15:38:27.599116','2017-09-28 15:38:27.599116','chartreuse')
4390
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4391
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4392
+  (0.3ms) rollback transaction
4393
+  (0.1ms) begin transaction
4394
+ --------------------------------------------------------------
4395
+ BulkInsertWorkerTest: test_after_save_stores_a_block_as_a_proc
4396
+ --------------------------------------------------------------
4397
+  (0.0ms) rollback transaction
4398
+  (0.0ms) begin transaction
4399
+ -------------------------------------------------------------
4400
+ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
4401
+ -------------------------------------------------------------
4402
+  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 15:38:27.606350','2017-09-28 15:38:27.606350','chartreuse'),('Hello',25,'t','2017-09-28 15:38:27.606350','2017-09-28 15:38:27.606350','chartreuse')
4403
+  (0.2ms) rollback transaction
4404
+  (0.0ms) begin transaction
4405
+ ------------------------------------------------------
4406
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
4407
+ ------------------------------------------------------
4408
+  (0.0ms) rollback transaction
4409
+  (0.0ms) begin transaction
4410
+ --------------------------------------------------------
4411
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
4412
+ --------------------------------------------------------
4413
+  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 15:38:27.607830','2017-09-28 15:38:27.607830','chartreuse'),('Hello',25,'t','2017-09-28 15:38:27.607830','2017-09-28 15:38:27.607830','chartreuse')
4414
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4415
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4416
+  (0.2ms) rollback transaction
4417
+  (0.0ms) begin transaction
4418
+ ----------------------------------------------------------------
4419
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
4420
+ ----------------------------------------------------------------
4421
+  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2017-09-28 15:38:27.609130','2017-09-28 15:38:27.609130','chartreuse')
4422
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4423
+  (0.2ms) rollback transaction
4424
+  (0.0ms) begin transaction
4425
+ ------------------------------------------------------------------------------------------
4426
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_lowercase_adapter_name)
4427
+ ------------------------------------------------------------------------------------------
4428
+  (0.0ms) rollback transaction
4429
+  (0.0ms) begin transaction
4430
+ --------------------------------------------------------------------
4431
+ BulkInsertWorkerTest: test_before_save_callback_can_be_set_as_a_proc
4432
+ --------------------------------------------------------------------
4433
+  (0.0ms) rollback transaction
4434
+  (0.0ms) begin transaction
4435
+ --------------------------------------------------------------------------------
4436
+ BulkInsertWorkerTest: test_save!_doesn't_blow_up_if_before_save_emptying_the_set
4437
+ --------------------------------------------------------------------------------
4438
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4439
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4440
+  (0.0ms) rollback transaction
4441
+  (0.0ms) begin transaction
4442
+ ---------------------------------------------------------------
4443
+ BulkInsertWorkerTest: test_adapter_dependent_postgresql_methods
4444
+ ---------------------------------------------------------------
4445
+  (0.0ms) rollback transaction
4446
+  (0.0ms) begin transaction
4447
+ -------------------------------------------
4448
+ BulkInsertWorkerTest: test_default_set_size
4449
+ -------------------------------------------
4450
+  (0.0ms) rollback transaction
4451
+  (0.0ms) begin transaction
4452
+ ---------------------------------------------------------
4453
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
4454
+ ---------------------------------------------------------
4455
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 15:38:27.613712','2017-09-28 15:38:27.613712','chartreuse')
4456
+  (0.2ms) rollback transaction
4457
+  (0.1ms) begin transaction
4458
+ ------------------------------------------------------------
4459
+ BulkInsertWorkerTest: test_adapter_dependent_default_methods
4460
+ ------------------------------------------------------------
4461
+  (0.0ms) rollback transaction
4462
+  (0.1ms) begin transaction
4463
+ ----------------------------------------------------------------------------------
4464
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
4465
+ ----------------------------------------------------------------------------------
4466
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 15:38:27.615368','2017-09-28 15:38:27.615368','chartreuse')
4467
+  (0.1ms) SELECT COUNT(*) FROM "testings"
4468
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4469
+  (0.2ms) rollback transaction
4470
+  (0.0ms) begin transaction
4471
+ ------------------------------------------------------------------------------------------
4472
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_stylecase_adapter_name)
4473
+ ------------------------------------------------------------------------------------------
4474
+  (0.0ms) rollback transaction
4475
+  (0.0ms) begin transaction
4476
+ --------------------------------------------------------------
4477
+ BulkInsertWorkerTest: test_save!_calls_the_before_save_handler
4478
+ --------------------------------------------------------------
4479
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 15:38:27.618114','2017-09-28 15:38:27.618114','chartreuse'),('Hello',25,'t','2017-09-28 15:38:27.618114','2017-09-28 15:38:27.618114','chartreuse')
4480
+  (0.3ms) rollback transaction
4481
+  (0.0ms) begin transaction
4482
+ ------------------------------------------------------------------------------
4483
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
4484
+ ------------------------------------------------------------------------------
4485
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-09-28 15:38:27.619755','2017-09-28 15:38:27.619755','chartreuse')
4486
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4487
+  (0.2ms) rollback transaction
4488
+  (0.0ms) begin transaction
4489
+ -------------------------------------------------------------------------------
4490
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
4491
+ -------------------------------------------------------------------------------
4492
+  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 15:38:27.621263','2017-09-28 15:38:27.621263','chartreuse')
4493
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4494
+  (0.2ms) rollback transaction
4495
+  (0.0ms) begin transaction
4496
+ ----------------------------------------------------------------
4497
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
4498
+ ----------------------------------------------------------------
4499
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-09-28 15:38:27.622652','2017-09-28 15:38:27.622652',NULL)
4500
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4501
+  (0.6ms) rollback transaction
4502
+  (0.0ms) begin transaction
4503
+ ---------------------------------------------------------------
4504
+ BulkInsertWorkerTest: test_before_save_stores_a_block_as_a_proc
4505
+ ---------------------------------------------------------------
4506
+  (0.0ms) rollback transaction
4507
+  (0.0ms) begin transaction
4508
+ -------------------------------------------------------------------
4509
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
4510
+ -------------------------------------------------------------------
4511
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4512
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4513
+  (0.0ms) rollback transaction
4514
+  (0.0ms) begin transaction
4515
+ ---------------------------------------------------------------
4516
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
4517
+ ---------------------------------------------------------------
4518
+  (0.0ms) SAVEPOINT active_record_1
4519
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4520
+  (0.0ms) rollback transaction
4521
+  (0.0ms) begin transaction
4522
+ -------------------------------------------------------------------
4523
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
4524
+ -------------------------------------------------------------------
4525
+  (0.0ms) rollback transaction
4526
+  (0.1ms) begin transaction
4527
+ ---------------------------------------------------------------------
4528
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
4529
+ ---------------------------------------------------------------------
4530
+  (0.1ms) SELECT COUNT(*) FROM "testings"
4531
+  (0.0ms) SAVEPOINT active_record_1
4532
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2017-09-28 15:38:27.628291','2017-09-28 15:38:27.628291','chartreuse')
4533
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4534
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4535
+  (0.2ms) rollback transaction
4536
+  (0.1ms) begin transaction
4537
+ -----------------------------------------------------------------------------
4538
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
4539
+ -----------------------------------------------------------------------------
4540
+  (0.1ms) SELECT COUNT(*) FROM "testings"
4541
+  (0.0ms) SAVEPOINT active_record_1
4542
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2017-09-28 15:38:27.629965','chartreuse'),('Hey',20,'f','2017-09-28 15:38:27.629965','2017-09-28 15:38:27.629965','chartreuse')
4543
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4544
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4545
+  (0.3ms) rollback transaction
4546
+  (0.0ms) begin transaction
4547
+ ------------------------------------------------------------------------------
4548
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
4549
+ ------------------------------------------------------------------------------
4550
+  (0.0ms) rollback transaction
4551
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
4552
+  (0.1ms) begin transaction
4553
+ ------------------------------------------------------------------------------------------
4554
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_stylecase_adapter_name)
4555
+ ------------------------------------------------------------------------------------------
4556
+  (0.1ms) rollback transaction
4557
+  (0.0ms) begin transaction
4558
+ ------------------------------------------------------------------------------
4559
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
4560
+ ------------------------------------------------------------------------------
4561
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-09-28 15:45:11.341378','2017-09-28 15:45:11.341378','chartreuse')
4562
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4563
+  (2.2ms) rollback transaction
4564
+  (0.1ms) begin transaction
4565
+ --------------------------------------------------------------------------
4566
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods_work_for_mysql2
4567
+ --------------------------------------------------------------------------
4568
+  (0.0ms) rollback transaction
4569
+  (0.0ms) begin transaction
4570
+ ----------------------------------------------------------------
4571
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
4572
+ ----------------------------------------------------------------
4573
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-09-28 15:45:11.350956','2017-09-28 15:45:11.350956',NULL)
4574
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4575
+  (0.3ms) rollback transaction
4576
+  (0.0ms) begin transaction
4577
+ ------------------------------------------------------------------------------------------
4578
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_lowercase_adapter_name)
4579
+ ------------------------------------------------------------------------------------------
4580
+  (0.0ms) rollback transaction
4581
+  (0.0ms) begin transaction
4582
+ ---------------------------------------------------------
4583
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
4584
+ ---------------------------------------------------------
4585
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 15:45:11.353366','2017-09-28 15:45:11.353366','chartreuse')
4586
+  (0.3ms) rollback transaction
4587
+  (0.1ms) begin transaction
4588
+ ----------------------------------------------------------------------------------------------
4589
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
4590
+ ----------------------------------------------------------------------------------------------
4591
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 15:45:11.354679','2017-09-28 15:45:11.354679','chartreuse'),('Howdy',20,'f','2017-09-28 15:45:11.354679','2017-09-28 15:45:11.354679','chartreuse')
4592
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
4593
+  (0.3ms) rollback transaction
4594
+  (0.1ms) begin transaction
4595
+ ----------------------------------------------------------
4596
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods
4597
+ ----------------------------------------------------------
4598
+  (0.1ms) rollback transaction
4599
+  (0.1ms) begin transaction
4600
+ --------------------------------------------------------------------------------
4601
+ BulkInsertWorkerTest: test_save!_doesn't_blow_up_if_before_save_emptying_the_set
4602
+ --------------------------------------------------------------------------------
4603
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4604
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4605
+  (0.1ms) rollback transaction
4606
+  (0.0ms) begin transaction
4607
+ ------------------------------------------------------
4608
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
4609
+ ------------------------------------------------------
4610
+  (0.1ms) rollback transaction
4611
+  (0.1ms) begin transaction
4612
+ ----------------------------------------------------------------------------
4613
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
4614
+ ----------------------------------------------------------------------------
4615
+  (0.0ms) rollback transaction
4616
+  (0.1ms) begin transaction
4617
+ -------------------------------------------------------------------
4618
+ BulkInsertWorkerTest: test_after_save_callback_can_be_set_as_a_proc
4619
+ -------------------------------------------------------------------
4620
+  (0.0ms) rollback transaction
4621
+  (0.0ms) begin transaction
4622
+ ----------------------------------------------------------------------------------
4623
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
4624
+ ----------------------------------------------------------------------------------
4625
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 15:45:11.362790','2017-09-28 15:45:11.362790','chartreuse')
4626
+  (0.1ms) SELECT COUNT(*) FROM "testings"
4627
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4628
+  (0.2ms) rollback transaction
4629
+  (0.0ms) begin transaction
4630
+ -------------------------------------------------------------
4631
+ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
4632
+ -------------------------------------------------------------
4633
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 15:45:11.364743','2017-09-28 15:45:11.364743','chartreuse'),('Hello',25,'t','2017-09-28 15:45:11.364743','2017-09-28 15:45:11.364743','chartreuse')
4634
+  (0.2ms) rollback transaction
4635
+  (0.0ms) begin transaction
4636
+ --------------------------------------------------------------
4637
+ BulkInsertWorkerTest: test_mysql_adapter_can_update_duplicates
4638
+ --------------------------------------------------------------
4639
+  (0.0ms) rollback transaction
4640
+  (0.1ms) begin transaction
4641
+ ----------------------------------------------------------------
4642
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
4643
+ ----------------------------------------------------------------
4644
+  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2017-09-28 15:45:11.366345','2017-09-28 15:45:11.366345','chartreuse')
4645
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4646
+  (0.2ms) rollback transaction
4647
+  (0.0ms) begin transaction
4648
+ --------------------------------------------------------
4649
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
4650
+ --------------------------------------------------------
4651
+  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 15:45:11.367595','2017-09-28 15:45:11.367595','chartreuse'),('Hello',25,'t','2017-09-28 15:45:11.367595','2017-09-28 15:45:11.367595','chartreuse')
4652
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4653
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4654
+  (0.2ms) rollback transaction
4655
+  (0.0ms) begin transaction
4656
+ -------------------------------------------------------------------
4657
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
4658
+ -------------------------------------------------------------------
4659
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4660
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4661
+  (0.0ms) rollback transaction
4662
+  (0.0ms) begin transaction
4663
+ ---------------------------------------------------------------
4664
+ BulkInsertWorkerTest: test_adapter_dependent_postgresql_methods
4665
+ ---------------------------------------------------------------
4666
+  (0.0ms) rollback transaction
4667
+  (0.0ms) begin transaction
4668
+ ------------------------------------------------------------
4669
+ BulkInsertWorkerTest: test_adapter_dependent_default_methods
4670
+ ------------------------------------------------------------
4671
+  (0.0ms) rollback transaction
4672
+  (0.0ms) begin transaction
4673
+ --------------------------------------------------------------------
4674
+ BulkInsertWorkerTest: test_before_save_callback_can_be_set_as_a_proc
4675
+ --------------------------------------------------------------------
4676
+  (0.0ms) rollback transaction
4677
+  (0.1ms) begin transaction
4678
+ --------------------------------------------------------------------
4679
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
4680
+ --------------------------------------------------------------------
4681
+  (0.1ms) rollback transaction
4682
+  (0.0ms) begin transaction
4683
+ -------------------------------------------------------------
4684
+ BulkInsertWorkerTest: test_before_save_can_manipulate_the_set
4685
+ -------------------------------------------------------------
4686
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',25,'t','2017-09-28 15:45:11.372142','2017-09-28 15:45:11.372142','chartreuse')
4687
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4688
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4689
+  (0.2ms) rollback transaction
4690
+  (0.0ms) begin transaction
4691
+ --------------------------------------------------------------
4692
+ BulkInsertWorkerTest: test_save!_calls_the_before_save_handler
4693
+ --------------------------------------------------------------
4694
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 15:45:11.373457','2017-09-28 15:45:11.373457','chartreuse'),('Hello',25,'t','2017-09-28 15:45:11.373457','2017-09-28 15:45:11.373457','chartreuse')
4695
+  (0.2ms) rollback transaction
4696
+  (0.0ms) begin transaction
4697
+ -------------------------------------------
4698
+ BulkInsertWorkerTest: test_default_set_size
4699
+ -------------------------------------------
4700
+  (0.1ms) rollback transaction
4701
+  (0.0ms) begin transaction
4702
+ -------------------------------------------------------------------------------
4703
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
4704
+ -------------------------------------------------------------------------------
4705
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 15:45:11.375153','2017-09-28 15:45:11.375153','chartreuse')
4706
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4707
+  (0.2ms) rollback transaction
4708
+  (0.0ms) begin transaction
4709
+ ---------------------------------------------------------------
4710
+ BulkInsertWorkerTest: test_before_save_stores_a_block_as_a_proc
4711
+ ---------------------------------------------------------------
4712
+  (0.1ms) rollback transaction
4713
+  (0.0ms) begin transaction
4714
+ ---------------------------------------------------------------------
4715
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
4716
+ ---------------------------------------------------------------------
4717
+  (0.0ms) rollback transaction
4718
+  (0.0ms) begin transaction
4719
+ --------------------------------------------------------------
4720
+ BulkInsertWorkerTest: test_after_save_stores_a_block_as_a_proc
4721
+ --------------------------------------------------------------
4722
+  (0.0ms) rollback transaction
4723
+  (0.0ms) begin transaction
4724
+ -----------------------------------------------------------------------------
4725
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
4726
+ -----------------------------------------------------------------------------
4727
+  (0.1ms) SELECT COUNT(*) FROM "testings"
4728
+  (0.0ms) SAVEPOINT active_record_1
4729
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2017-09-28 15:45:11.379583','chartreuse'),('Hey',20,'f','2017-09-28 15:45:11.379583','2017-09-28 15:45:11.379583','chartreuse')
4730
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4731
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4732
+  (0.2ms) rollback transaction
4733
+  (0.0ms) begin transaction
4734
+ ---------------------------------------------------------------
4735
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
4736
+ ---------------------------------------------------------------
4737
+  (0.0ms) SAVEPOINT active_record_1
4738
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4739
+  (0.0ms) rollback transaction
4740
+  (0.0ms) begin transaction
4741
+ ------------------------------------------------------------------------------
4742
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
4743
+ ------------------------------------------------------------------------------
4744
+  (0.0ms) rollback transaction
4745
+  (0.0ms) begin transaction
4746
+ -------------------------------------------------------------------
4747
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
4748
+ -------------------------------------------------------------------
4749
+  (0.0ms) rollback transaction
4750
+  (0.0ms) begin transaction
4751
+ ---------------------------------------------------------------------
4752
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
4753
+ ---------------------------------------------------------------------
4754
+  (0.1ms) SELECT COUNT(*) FROM "testings"
4755
+  (0.0ms) SAVEPOINT active_record_1
4756
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2017-09-28 15:45:11.382531','2017-09-28 15:45:11.382531','chartreuse')
4757
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4758
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4759
+  (0.2ms) rollback transaction
4760
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
4761
+  (0.1ms) begin transaction
4762
+ -------------------------------------------------------------------
4763
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
4764
+ -------------------------------------------------------------------
4765
+  (0.1ms) SELECT COUNT(*) FROM "testings"
4766
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4767
+  (0.0ms) rollback transaction
4768
+  (0.0ms) begin transaction
4769
+ ----------------------------------------------------------------------------------------------
4770
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
4771
+ ----------------------------------------------------------------------------------------------
4772
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 15:59:34.799577','2017-09-28 15:59:34.799577','chartreuse'),('Howdy',20,'f','2017-09-28 15:59:34.799577','2017-09-28 15:59:34.799577','chartreuse')
4773
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
4774
+  (2.1ms) rollback transaction
4775
+  (0.0ms) begin transaction
4776
+ ----------------------------------------------------------------
4777
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
4778
+ ----------------------------------------------------------------
4779
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-09-28 15:59:34.807954','2017-09-28 15:59:34.807954',NULL)
4780
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4781
+  (0.3ms) rollback transaction
4782
+  (0.0ms) begin transaction
4783
+ --------------------------------------------------------------
4784
+ BulkInsertWorkerTest: test_save!_calls_the_before_save_handler
4785
+ --------------------------------------------------------------
4786
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 15:59:34.810463','2017-09-28 15:59:34.810463','chartreuse'),('Hello',25,'t','2017-09-28 15:59:34.810463','2017-09-28 15:59:34.810463','chartreuse')
4787
+  (0.3ms) rollback transaction
4788
+  (0.0ms) begin transaction
4789
+ --------------------------------------------------------------------
4790
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
4791
+ --------------------------------------------------------------------
4792
+  (0.0ms) rollback transaction
4793
+  (0.0ms) begin transaction
4794
+ --------------------------------------------------------
4795
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
4796
+ --------------------------------------------------------
4797
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 15:59:34.812092','2017-09-28 15:59:34.812092','chartreuse'),('Hello',25,'t','2017-09-28 15:59:34.812092','2017-09-28 15:59:34.812092','chartreuse')
4798
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4799
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4800
+  (0.2ms) rollback transaction
4801
+  (0.1ms) begin transaction
4802
+ ------------------------------------------------------------------------------------------
4803
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_lowercase_adapter_name)
4804
+ ------------------------------------------------------------------------------------------
4805
+  (0.0ms) rollback transaction
4806
+  (0.0ms) begin transaction
4807
+ ---------------------------------------------------------------------
4808
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
4809
+ ---------------------------------------------------------------------
4810
+  (0.0ms) rollback transaction
4811
+  (0.0ms) begin transaction
4812
+ ------------------------------------------------------------------------------------------
4813
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_stylecase_adapter_name)
4814
+ ------------------------------------------------------------------------------------------
4815
+  (0.1ms) rollback transaction
4816
+  (0.0ms) begin transaction
4817
+ -------------------------------------------------------------
4818
+ BulkInsertWorkerTest: test_before_save_can_manipulate_the_set
4819
+ -------------------------------------------------------------
4820
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',25,'t','2017-09-28 15:59:34.818691','2017-09-28 15:59:34.818691','chartreuse')
4821
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4822
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4823
+  (0.2ms) rollback transaction
4824
+  (0.1ms) begin transaction
4825
+ ------------------------------------------------------------
4826
+ BulkInsertWorkerTest: test_adapter_dependent_PostGIS_methods
4827
+ ------------------------------------------------------------
4828
+  (0.0ms) rollback transaction
4829
+  (0.0ms) begin transaction
4830
+ ------------------------------------------------------------
4831
+ BulkInsertWorkerTest: test_adapter_dependent_default_methods
4832
+ ------------------------------------------------------------
4833
+  (0.0ms) rollback transaction
4834
+  (0.1ms) begin transaction
4835
+ -------------------------------------------
4836
+ BulkInsertWorkerTest: test_default_set_size
4837
+ -------------------------------------------
4838
+  (0.0ms) rollback transaction
4839
+  (0.0ms) begin transaction
4840
+ --------------------------------------------------------------
4841
+ BulkInsertWorkerTest: test_mysql_adapter_can_update_duplicates
4842
+ --------------------------------------------------------------
4843
+  (0.0ms) rollback transaction
4844
+  (0.0ms) begin transaction
4845
+ ----------------------------------------------------------------------------
4846
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
4847
+ ----------------------------------------------------------------------------
4848
+  (0.0ms) rollback transaction
4849
+  (0.0ms) begin transaction
4850
+ ---------------------------------------------------------------
4851
+ BulkInsertWorkerTest: test_adapter_dependent_postgresql_methods
4852
+ ---------------------------------------------------------------
4853
+  (0.0ms) rollback transaction
4854
+  (0.0ms) begin transaction
4855
+ -------------------------------------------------------------
4856
+ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
4857
+ -------------------------------------------------------------
4858
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 15:59:34.823698','2017-09-28 15:59:34.823698','chartreuse'),('Hello',25,'t','2017-09-28 15:59:34.823698','2017-09-28 15:59:34.823698','chartreuse')
4859
+  (0.3ms) rollback transaction
4860
+  (0.0ms) begin transaction
4861
+ --------------------------------------------------------------
4862
+ BulkInsertWorkerTest: test_after_save_stores_a_block_as_a_proc
4863
+ --------------------------------------------------------------
4864
+  (0.0ms) rollback transaction
4865
+  (0.0ms) begin transaction
4866
+ --------------------------------------------------------------------------
4867
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods_work_for_mysql2
4868
+ --------------------------------------------------------------------------
4869
+  (0.0ms) rollback transaction
4870
+  (0.0ms) begin transaction
4871
+ ------------------------------------------------------
4872
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
4873
+ ------------------------------------------------------
4874
+  (0.0ms) rollback transaction
4875
+  (0.0ms) begin transaction
4876
+ --------------------------------------------------------------------
4877
+ BulkInsertWorkerTest: test_before_save_callback_can_be_set_as_a_proc
4878
+ --------------------------------------------------------------------
4879
+  (0.0ms) rollback transaction
4880
+  (0.0ms) begin transaction
4881
+ -------------------------------------------------------------------------------
4882
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
4883
+ -------------------------------------------------------------------------------
4884
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 15:59:34.827266','2017-09-28 15:59:34.827266','chartreuse')
4885
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4886
+  (0.3ms) rollback transaction
4887
+  (0.0ms) begin transaction
4888
+ ----------------------------------------------------------------
4889
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
4890
+ ----------------------------------------------------------------
4891
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2017-09-28 15:59:34.828850','2017-09-28 15:59:34.828850','chartreuse')
4892
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4893
+  (0.4ms) rollback transaction
4894
+  (0.1ms) begin transaction
4895
+ ---------------------------------------------------------
4896
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
4897
+ ---------------------------------------------------------
4898
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 15:59:34.830840','2017-09-28 15:59:34.830840','chartreuse')
4899
+  (0.3ms) rollback transaction
4900
+  (0.0ms) begin transaction
4901
+ ------------------------------------------------------------------------------
4902
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
4903
+ ------------------------------------------------------------------------------
4904
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-09-28 15:59:34.832172','2017-09-28 15:59:34.832172','chartreuse')
4905
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4906
+  (0.2ms) rollback transaction
4907
+  (0.0ms) begin transaction
4908
+ ----------------------------------------------------------
4909
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods
4910
+ ----------------------------------------------------------
4911
+  (0.1ms) rollback transaction
4912
+  (0.0ms) begin transaction
4913
+ -------------------------------------------------------------------
4914
+ BulkInsertWorkerTest: test_after_save_callback_can_be_set_as_a_proc
4915
+ -------------------------------------------------------------------
4916
+  (0.0ms) rollback transaction
4917
+  (0.0ms) begin transaction
4918
+ --------------------------------------------------------------------------------
4919
+ BulkInsertWorkerTest: test_save!_doesn't_blow_up_if_before_save_emptying_the_set
4920
+ --------------------------------------------------------------------------------
4921
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
4922
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
4923
+  (0.0ms) rollback transaction
4924
+  (0.1ms) begin transaction
4925
+ ---------------------------------------------------------------
4926
+ BulkInsertWorkerTest: test_before_save_stores_a_block_as_a_proc
4927
+ ---------------------------------------------------------------
4928
+  (0.0ms) rollback transaction
4929
+  (0.0ms) begin transaction
4930
+ ----------------------------------------------------------------------------------
4931
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
4932
+ ----------------------------------------------------------------------------------
4933
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 15:59:34.837173','2017-09-28 15:59:34.837173','chartreuse')
4934
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4935
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
4936
+  (0.2ms) rollback transaction
4937
+  (0.0ms) begin transaction
4938
+ ------------------------------------------------------------------
4939
+ BulkInsertWorkerTest: test_adapter_dependent_Mysql2Spatial_methods
4940
+ ------------------------------------------------------------------
4941
+  (0.0ms) rollback transaction
4942
+  (0.0ms) begin transaction
4943
+ ------------------------------------------------------------------------------
4944
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
4945
+ ------------------------------------------------------------------------------
4946
+  (0.0ms) rollback transaction
4947
+  (0.0ms) begin transaction
4948
+ -------------------------------------------------------------------
4949
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
4950
+ -------------------------------------------------------------------
4951
+  (0.0ms) rollback transaction
4952
+  (0.1ms) begin transaction
4953
+ ---------------------------------------------------------------------
4954
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
4955
+ ---------------------------------------------------------------------
4956
+  (0.1ms) SELECT COUNT(*) FROM "testings"
4957
+  (0.0ms) SAVEPOINT active_record_1
4958
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2017-09-28 15:59:34.842670','2017-09-28 15:59:34.842670','chartreuse')
4959
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4960
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4961
+  (0.2ms) rollback transaction
4962
+  (0.0ms) begin transaction
4963
+ ---------------------------------------------------------------
4964
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
4965
+ ---------------------------------------------------------------
4966
+  (0.0ms) SAVEPOINT active_record_1
4967
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4968
+  (0.0ms) rollback transaction
4969
+  (0.0ms) begin transaction
4970
+ -----------------------------------------------------------------------------
4971
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
4972
+ -----------------------------------------------------------------------------
4973
+  (0.1ms) SELECT COUNT(*) FROM "testings"
4974
+  (0.0ms) SAVEPOINT active_record_1
4975
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2017-09-28 15:59:34.844771','chartreuse'),('Hey',20,'f','2017-09-28 15:59:34.844771','2017-09-28 15:59:34.844771','chartreuse')
4976
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4977
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4978
+  (0.2ms) rollback transaction
4979
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
4980
+  (0.1ms) begin transaction
4981
+ ---------------------------------------------------------------------
4982
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
4983
+ ---------------------------------------------------------------------
4984
+  (0.1ms) SELECT COUNT(*) FROM "testings"
4985
+  (0.0ms) SAVEPOINT active_record_1
4986
+  (0.4ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2017-09-28 16:00:55.890337','2017-09-28 16:00:55.890337','chartreuse')
4987
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4988
+  (0.0ms) SELECT COUNT(*) FROM "testings"
4989
+  (2.1ms) rollback transaction
4990
+  (0.1ms) begin transaction
4991
+ ---------------------------------------------------------------
4992
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
4993
+ ---------------------------------------------------------------
4994
+  (0.0ms) SAVEPOINT active_record_1
4995
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4996
+  (0.0ms) rollback transaction
4997
+  (0.0ms) begin transaction
4998
+ ------------------------------------------------------------------------------
4999
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
5000
+ ------------------------------------------------------------------------------
5001
+  (0.0ms) rollback transaction
5002
+  (0.0ms) begin transaction
5003
+ -------------------------------------------------------------------
5004
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
5005
+ -------------------------------------------------------------------
5006
+  (0.0ms) rollback transaction
5007
+  (0.0ms) begin transaction
5008
+ -----------------------------------------------------------------------------
5009
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
5010
+ -----------------------------------------------------------------------------
5011
+  (0.1ms) SELECT COUNT(*) FROM "testings"
5012
+  (0.0ms) SAVEPOINT active_record_1
5013
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2017-09-28 16:00:55.897215','chartreuse'),('Hey',20,'f','2017-09-28 16:00:55.897215','2017-09-28 16:00:55.897215','chartreuse')
5014
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5015
+  (0.0ms) SELECT COUNT(*) FROM "testings"
5016
+  (0.2ms) rollback transaction
5017
+  (0.0ms) begin transaction
5018
+ --------------------------------------------------------------------
5019
+ BulkInsertWorkerTest: test_before_save_callback_can_be_set_as_a_proc
5020
+ --------------------------------------------------------------------
5021
+  (0.0ms) rollback transaction
5022
+  (0.0ms) begin transaction
5023
+ ------------------------------------------------------------
5024
+ BulkInsertWorkerTest: test_adapter_dependent_PostGIS_methods
5025
+ ------------------------------------------------------------
5026
+  (0.0ms) rollback transaction
5027
+  (0.0ms) begin transaction
5028
+ -------------------------------------------------------------
5029
+ BulkInsertWorkerTest: test_before_save_can_manipulate_the_set
5030
+ -------------------------------------------------------------
5031
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',25,'t','2017-09-28 16:00:55.900428','2017-09-28 16:00:55.900428','chartreuse')
5032
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
5033
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
5034
+  (0.4ms) rollback transaction
5035
+  (0.0ms) begin transaction
5036
+ --------------------------------------------------------------------------------
5037
+ BulkInsertWorkerTest: test_save!_doesn't_blow_up_if_before_save_emptying_the_set
5038
+ --------------------------------------------------------------------------------
5039
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
5040
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
5041
+  (0.0ms) rollback transaction
5042
+  (0.0ms) begin transaction
5043
+ ----------------------------------------------------------------------------
5044
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
5045
+ ----------------------------------------------------------------------------
5046
+  (0.1ms) rollback transaction
5047
+  (0.0ms) begin transaction
5048
+ --------------------------------------------------------------------------
5049
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods_work_for_mysql2
5050
+ --------------------------------------------------------------------------
5051
+  (0.0ms) rollback transaction
5052
+  (0.0ms) begin transaction
5053
+ ----------------------------------------------------------------
5054
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
5055
+ ----------------------------------------------------------------
5056
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-09-28 16:00:55.910943','2017-09-28 16:00:55.910943',NULL)
5057
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
5058
+  (0.3ms) rollback transaction
5059
+  (0.0ms) begin transaction
5060
+ -------------------------------------------------------------------
5061
+ BulkInsertWorkerTest: test_after_save_callback_can_be_set_as_a_proc
5062
+ -------------------------------------------------------------------
5063
+  (0.0ms) rollback transaction
5064
+  (0.0ms) begin transaction
5065
+ -------------------------------------------------------------
5066
+ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
5067
+ -------------------------------------------------------------
5068
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 16:00:55.913058','2017-09-28 16:00:55.913058','chartreuse'),('Hello',25,'t','2017-09-28 16:00:55.913058','2017-09-28 16:00:55.913058','chartreuse')
5069
+  (0.2ms) rollback transaction
5070
+  (0.0ms) begin transaction
5071
+ ----------------------------------------------------------------------------------
5072
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
5073
+ ----------------------------------------------------------------------------------
5074
+  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 16:00:55.914126','2017-09-28 16:00:55.914126','chartreuse')
5075
+  (0.0ms) SELECT COUNT(*) FROM "testings"
5076
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
5077
+  (0.2ms) rollback transaction
5078
+  (0.1ms) begin transaction
5079
+ --------------------------------------------------------
5080
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
5081
+ --------------------------------------------------------
5082
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 16:00:55.915611','2017-09-28 16:00:55.915611','chartreuse'),('Hello',25,'t','2017-09-28 16:00:55.915611','2017-09-28 16:00:55.915611','chartreuse')
5083
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
5084
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
5085
+  (0.2ms) rollback transaction
5086
+  (0.0ms) begin transaction
5087
+ --------------------------------------------------------------------
5088
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
5089
+ --------------------------------------------------------------------
5090
+  (0.0ms) rollback transaction
5091
+  (0.0ms) begin transaction
5092
+ --------------------------------------------------------------
5093
+ BulkInsertWorkerTest: test_after_save_stores_a_block_as_a_proc
5094
+ --------------------------------------------------------------
5095
+  (0.0ms) rollback transaction
5096
+  (0.0ms) begin transaction
5097
+ ---------------------------------------------------------------------
5098
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
5099
+ ---------------------------------------------------------------------
5100
+  (0.0ms) rollback transaction
5101
+  (0.0ms) begin transaction
5102
+ ------------------------------------------------------------------------------------------
5103
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_lowercase_adapter_name)
5104
+ ------------------------------------------------------------------------------------------
5105
+  (0.0ms) rollback transaction
5106
+  (0.0ms) begin transaction
5107
+ --------------------------------------------------------------
5108
+ BulkInsertWorkerTest: test_save!_calls_the_before_save_handler
5109
+ --------------------------------------------------------------
5110
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 16:00:55.918656','2017-09-28 16:00:55.918656','chartreuse'),('Hello',25,'t','2017-09-28 16:00:55.918656','2017-09-28 16:00:55.918656','chartreuse')
5111
+  (0.2ms) rollback transaction
5112
+  (0.0ms) begin transaction
5113
+ ---------------------------------------------------------
5114
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
5115
+ ---------------------------------------------------------
5116
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 16:00:55.919706','2017-09-28 16:00:55.919706','chartreuse')
5117
+  (0.2ms) rollback transaction
5118
+  (0.0ms) begin transaction
5119
+ -------------------------------------------------------------------
5120
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
5121
+ -------------------------------------------------------------------
5122
+  (0.0ms) SELECT COUNT(*) FROM "testings"
5123
+  (0.0ms) SELECT COUNT(*) FROM "testings"
5124
+  (0.0ms) rollback transaction
5125
+  (0.0ms) begin transaction
5126
+ ---------------------------------------------------------------
5127
+ BulkInsertWorkerTest: test_before_save_stores_a_block_as_a_proc
5128
+ ---------------------------------------------------------------
5129
+  (0.0ms) rollback transaction
5130
+  (0.0ms) begin transaction
5131
+ ----------------------------------------------------------
5132
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods
5133
+ ----------------------------------------------------------
5134
+  (0.0ms) rollback transaction
5135
+  (0.0ms) begin transaction
5136
+ ------------------------------------------------------------
5137
+ BulkInsertWorkerTest: test_adapter_dependent_default_methods
5138
+ ------------------------------------------------------------
5139
+  (0.0ms) rollback transaction
5140
+  (0.0ms) begin transaction
5141
+ ---------------------------------------------------------------
5142
+ BulkInsertWorkerTest: test_adapter_dependent_postgresql_methods
5143
+ ---------------------------------------------------------------
5144
+  (0.0ms) rollback transaction
5145
+  (0.0ms) begin transaction
5146
+ ----------------------------------------------------------------
5147
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
5148
+ ----------------------------------------------------------------
5149
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2017-09-28 16:00:55.924484','2017-09-28 16:00:55.924484','chartreuse')
5150
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
5151
+  (0.2ms) rollback transaction
5152
+  (0.0ms) begin transaction
5153
+ ------------------------------------------------------------------------------------------
5154
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_stylecase_adapter_name)
5155
+ ------------------------------------------------------------------------------------------
5156
+  (0.1ms) rollback transaction
5157
+  (0.0ms) begin transaction
5158
+ -------------------------------------------
5159
+ BulkInsertWorkerTest: test_default_set_size
5160
+ -------------------------------------------
5161
+  (0.0ms) rollback transaction
5162
+  (0.0ms) begin transaction
5163
+ ----------------------------------------------------------------------------------------------
5164
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
5165
+ ----------------------------------------------------------------------------------------------
5166
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 16:00:55.927649','2017-09-28 16:00:55.927649','chartreuse'),('Howdy',20,'f','2017-09-28 16:00:55.927649','2017-09-28 16:00:55.927649','chartreuse')
5167
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
5168
+  (0.3ms) rollback transaction
5169
+  (0.0ms) begin transaction
5170
+ ------------------------------------------------------------------------------
5171
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
5172
+ ------------------------------------------------------------------------------
5173
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-09-28 16:00:55.929821','2017-09-28 16:00:55.929821','chartreuse')
5174
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
5175
+  (0.2ms) rollback transaction
5176
+  (0.0ms) begin transaction
5177
+ --------------------------------------------------------------
5178
+ BulkInsertWorkerTest: test_mysql_adapter_can_update_duplicates
5179
+ --------------------------------------------------------------
5180
+  (0.0ms) rollback transaction
5181
+  (0.0ms) begin transaction
5182
+ ------------------------------------------------------------------
5183
+ BulkInsertWorkerTest: test_adapter_dependent_Mysql2Spatial_methods
5184
+ ------------------------------------------------------------------
5185
+  (0.0ms) rollback transaction
5186
+  (0.0ms) begin transaction
5187
+ -------------------------------------------------------------------------------
5188
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
5189
+ -------------------------------------------------------------------------------
5190
+  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 16:00:55.932311','2017-09-28 16:00:55.932311','chartreuse')
5191
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
5192
+  (0.2ms) rollback transaction
5193
+  (0.0ms) begin transaction
5194
+ ------------------------------------------------------
5195
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
5196
+ ------------------------------------------------------
5197
+  (0.0ms) rollback transaction
5198
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5199
+  (0.1ms) begin transaction
5200
+ --------------------------------------------------------------------------------
5201
+ BulkInsertWorkerTest: test_save!_doesn't_blow_up_if_before_save_emptying_the_set
5202
+ --------------------------------------------------------------------------------
5203
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
5204
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
5205
+  (0.0ms) rollback transaction
5206
+  (0.1ms) begin transaction
5207
+ ----------------------------------------------------------------------------
5208
+ BulkInsertWorkerTest: test_pending_count_should_describe_size_of_pending_set
5209
+ ----------------------------------------------------------------------------
5210
+  (0.0ms) rollback transaction
5211
+  (0.1ms) begin transaction
5212
+ ----------------------------------------------------------------------------------
5213
+ BulkInsertWorkerTest: test_add_should_save_automatically_when_overflowing_set_size
5214
+ ----------------------------------------------------------------------------------
5215
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 16:03:32.065361','2017-09-28 16:03:32.065361','chartreuse')
5216
+  (0.1ms) SELECT COUNT(*) FROM "testings"
5217
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
5218
+  (2.1ms) rollback transaction
5219
+  (0.1ms) begin transaction
5220
+ ---------------------------------------------------------------
5221
+ BulkInsertWorkerTest: test_before_save_stores_a_block_as_a_proc
5222
+ ---------------------------------------------------------------
5223
+  (0.0ms) rollback transaction
5224
+  (0.0ms) begin transaction
5225
+ ------------------------------------------------------------------------------
5226
+ BulkInsertWorkerTest: test_add_should_use_database_default_values_when_present
5227
+ ------------------------------------------------------------------------------
5228
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-09-28 16:03:32.073793','2017-09-28 16:03:32.073793','chartreuse')
5229
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
5230
+  (0.3ms) rollback transaction
5231
+  (0.0ms) begin transaction
5232
+ -------------------------------------------------------------------------------
5233
+ BulkInsertWorkerTest: test_add_should_default_timestamp_columns_to_current_time
5234
+ -------------------------------------------------------------------------------
5235
+  (0.1ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 16:03:32.075538','2017-09-28 16:03:32.075538','chartreuse')
5236
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
5237
+  (0.3ms) rollback transaction
5238
+  (0.0ms) begin transaction
5239
+ ---------------------------------------------------------------------
5240
+ BulkInsertWorkerTest: test_add_all_should_append_all_items_to_the_set
5241
+ ---------------------------------------------------------------------
5242
+  (0.0ms) rollback transaction
5243
+  (0.0ms) begin transaction
5244
+ ------------------------------------------------------------------
5245
+ BulkInsertWorkerTest: test_adapter_dependent_Mysql2Spatial_methods
5246
+ ------------------------------------------------------------------
5247
+  (0.0ms) rollback transaction
5248
+  (0.0ms) begin transaction
5249
+ ---------------------------------------------------------------
5250
+ BulkInsertWorkerTest: test_adapter_dependent_postgresql_methods
5251
+ ---------------------------------------------------------------
5252
+  (0.0ms) rollback transaction
5253
+  (0.1ms) begin transaction
5254
+ ------------------------------------------------------
5255
+ BulkInsertWorkerTest: test_empty_insert_is_not_pending
5256
+ ------------------------------------------------------
5257
+  (0.0ms) rollback transaction
5258
+  (0.0ms) begin transaction
5259
+ ------------------------------------------------------------
5260
+ BulkInsertWorkerTest: test_adapter_dependent_PostGIS_methods
5261
+ ------------------------------------------------------------
5262
+  (0.0ms) rollback transaction
5263
+  (0.0ms) begin transaction
5264
+ -------------------------------------------
5265
+ BulkInsertWorkerTest: test_default_set_size
5266
+ -------------------------------------------
5267
+  (0.0ms) rollback transaction
5268
+  (0.0ms) begin transaction
5269
+ --------------------------------------------------------------
5270
+ BulkInsertWorkerTest: test_after_save_stores_a_block_as_a_proc
5271
+ --------------------------------------------------------------
5272
+  (0.0ms) rollback transaction
5273
+  (0.0ms) begin transaction
5274
+ -------------------------------------------------------------------
5275
+ BulkInsertWorkerTest: test_save!_when_not_pending_should_do_nothing
5276
+ -------------------------------------------------------------------
5277
+  (0.0ms) SELECT COUNT(*) FROM "testings"
5278
+  (0.0ms) SELECT COUNT(*) FROM "testings"
5279
+  (0.0ms) rollback transaction
5280
+  (0.0ms) begin transaction
5281
+ --------------------------------------------------------------------
5282
+ BulkInsertWorkerTest: test_adding_row_to_insert_makes_insert_pending
5283
+ --------------------------------------------------------------------
5284
+  (0.0ms) rollback transaction
5285
+  (0.0ms) begin transaction
5286
+ -------------------------------------------------------------------
5287
+ BulkInsertWorkerTest: test_after_save_callback_can_be_set_as_a_proc
5288
+ -------------------------------------------------------------------
5289
+  (0.0ms) rollback transaction
5290
+  (0.0ms) begin transaction
5291
+ ------------------------------------------------------------------------------------------
5292
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_lowercase_adapter_name)
5293
+ ------------------------------------------------------------------------------------------
5294
+  (0.0ms) rollback transaction
5295
+  (0.0ms) begin transaction
5296
+ --------------------------------------------------------------
5297
+ BulkInsertWorkerTest: test_mysql_adapter_can_update_duplicates
5298
+ --------------------------------------------------------------
5299
+  (0.0ms) rollback transaction
5300
+  (0.0ms) begin transaction
5301
+ ------------------------------------------------------------
5302
+ BulkInsertWorkerTest: test_adapter_dependent_default_methods
5303
+ ------------------------------------------------------------
5304
+  (0.0ms) rollback transaction
5305
+  (0.0ms) begin transaction
5306
+ --------------------------------------------------------------------
5307
+ BulkInsertWorkerTest: test_before_save_callback_can_be_set_as_a_proc
5308
+ --------------------------------------------------------------------
5309
+  (0.0ms) rollback transaction
5310
+  (0.0ms) begin transaction
5311
+ --------------------------------------------------------------
5312
+ BulkInsertWorkerTest: test_save!_calls_the_before_save_handler
5313
+ --------------------------------------------------------------
5314
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 16:03:32.085230','2017-09-28 16:03:32.085230','chartreuse'),('Hello',25,'t','2017-09-28 16:03:32.085230','2017-09-28 16:03:32.085230','chartreuse')
5315
+  (0.3ms) rollback transaction
5316
+  (0.1ms) begin transaction
5317
+ ----------------------------------------------------------------
5318
+ BulkInsertWorkerTest: test_add_should_allow_values_given_as_Hash
5319
+ ----------------------------------------------------------------
5320
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',20,'f','2017-09-28 16:03:32.086539','2017-09-28 16:03:32.086539','chartreuse')
5321
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
5322
+  (0.3ms) rollback transaction
5323
+  (0.0ms) begin transaction
5324
+ ----------------------------------------------------------
5325
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods
5326
+ ----------------------------------------------------------
5327
+  (0.0ms) rollback transaction
5328
+  (0.0ms) begin transaction
5329
+ --------------------------------------------------------
5330
+ BulkInsertWorkerTest: test_save!_inserts_pending_records
5331
+ --------------------------------------------------------
5332
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 16:03:32.089028','2017-09-28 16:03:32.089028','chartreuse'),('Hello',25,'t','2017-09-28 16:03:32.089028','2017-09-28 16:03:32.089028','chartreuse')
5333
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
5334
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
5335
+  (0.2ms) rollback transaction
5336
+  (0.0ms) begin transaction
5337
+ ----------------------------------------------------------------
5338
+ BulkInsertWorkerTest: test_explicit_nil_should_override_defaults
5339
+ ----------------------------------------------------------------
5340
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',20,'f','2017-09-28 16:03:32.090606','2017-09-28 16:03:32.090606',NULL)
5341
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings" ORDER BY "testings"."id" ASC LIMIT 1
5342
+  (0.3ms) rollback transaction
5343
+  (0.0ms) begin transaction
5344
+ ----------------------------------------------------------------------------------------------
5345
+ BulkInsertWorkerTest: test_default_timestamp_columns_should_be_equivalent_for_the_entire_batch
5346
+ ----------------------------------------------------------------------------------------------
5347
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 16:03:32.092226','2017-09-28 16:03:32.092226','chartreuse'),('Howdy',20,'f','2017-09-28 16:03:32.092226','2017-09-28 16:03:32.092226','chartreuse')
5348
+ Testing Load (0.1ms) SELECT "testings".* FROM "testings"
5349
+  (0.3ms) rollback transaction
5350
+  (0.0ms) begin transaction
5351
+ ---------------------------------------------------------
5352
+ BulkInsertWorkerTest: test_save!_makes_insert_not_pending
5353
+ ---------------------------------------------------------
5354
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','2017-09-28 16:03:32.093951','2017-09-28 16:03:32.093951','chartreuse')
5355
+  (0.2ms) rollback transaction
5356
+  (0.0ms) begin transaction
5357
+ ------------------------------------------------------------------------------------------
5358
+ BulkInsertWorkerTest: test_adapter_dependent_sqlite3_methods_(with_stylecase_adapter_name)
5359
+ ------------------------------------------------------------------------------------------
5360
+  (0.1ms) rollback transaction
5361
+  (0.0ms) begin transaction
5362
+ -------------------------------------------------------------
5363
+ BulkInsertWorkerTest: test_save!_calls_the_after_save_handler
5364
+ -------------------------------------------------------------
5365
+  (0.3ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Yo',15,'f','2017-09-28 16:03:32.096017','2017-09-28 16:03:32.096017','chartreuse'),('Hello',25,'t','2017-09-28 16:03:32.096017','2017-09-28 16:03:32.096017','chartreuse')
5366
+  (0.3ms) rollback transaction
5367
+  (0.1ms) begin transaction
5368
+ --------------------------------------------------------------------------
5369
+ BulkInsertWorkerTest: test_adapter_dependent_mysql_methods_work_for_mysql2
5370
+ --------------------------------------------------------------------------
5371
+  (0.0ms) rollback transaction
5372
+  (0.1ms) begin transaction
5373
+ -------------------------------------------------------------
5374
+ BulkInsertWorkerTest: test_before_save_can_manipulate_the_set
5375
+ -------------------------------------------------------------
5376
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',25,'t','2017-09-28 16:03:32.098794','2017-09-28 16:03:32.098794','chartreuse')
5377
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Yo"]]
5378
+ Testing Load (0.0ms) SELECT "testings".* FROM "testings" WHERE "testings"."greeting" = ? LIMIT 1 [["greeting", "Hello"]]
5379
+  (0.2ms) rollback transaction
5380
+  (0.0ms) begin transaction
5381
+ -----------------------------------------------------------------------------
5382
+ BulkInsertTest: test_bulk_insert_with_array_should_save_the_array_immediately
5383
+ -----------------------------------------------------------------------------
5384
+  (0.1ms) SELECT COUNT(*) FROM "testings"
5385
+  (0.0ms) SAVEPOINT active_record_1
5386
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',15,'t','green','2017-09-28 16:03:32.101023','chartreuse'),('Hey',20,'f','2017-09-28 16:03:32.101023','2017-09-28 16:03:32.101023','chartreuse')
5387
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5388
+  (0.0ms) SELECT COUNT(*) FROM "testings"
5389
+  (0.2ms) rollback transaction
5390
+  (0.0ms) begin transaction
5391
+ ---------------------------------------------------------------------
5392
+ BulkInsertTest: test_bulk_insert_with_block_should_save_automatically
5393
+ ---------------------------------------------------------------------
5394
+  (0.1ms) SELECT COUNT(*) FROM "testings"
5395
+  (0.0ms) SAVEPOINT active_record_1
5396
+  (0.2ms) INSERT INTO "testings" ("greeting","age","happy","created_at","updated_at","color") VALUES ('Hello',NULL,NULL,'2017-09-28 16:03:32.102805','2017-09-28 16:03:32.102805','chartreuse')
5397
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5398
+  (0.1ms) SELECT COUNT(*) FROM "testings"
5399
+  (0.3ms) rollback transaction
5400
+  (0.0ms) begin transaction
5401
+ -------------------------------------------------------------------
5402
+ BulkInsertTest: test_bulk_insert_without_block_should_return_worker
5403
+ -------------------------------------------------------------------
5404
+  (0.0ms) rollback transaction
5405
+  (0.0ms) begin transaction
5406
+ ------------------------------------------------------------------------------
5407
+ BulkInsertTest: test_default_bulk_columns_should_return_all_columns_without_id
5408
+ ------------------------------------------------------------------------------
5409
+  (0.0ms) rollback transaction
5410
+  (0.1ms) begin transaction
5411
+ ---------------------------------------------------------------
5412
+ BulkInsertTest: test_bulk_insert_with_block_should_yield_worker
5413
+ ---------------------------------------------------------------
5414
+  (0.0ms) SAVEPOINT active_record_1
5415
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5416
+  (0.0ms) rollback transaction