transactd 2.1.0-x86-mswin32-100 → 2.2.0-x86-mswin32-100

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e576a8a726bb0070d5d48d21a5da9bfac4184ff
4
- data.tar.gz: 94a48a847199a3101971c09f56ad292f875e5064
3
+ metadata.gz: 209e47713082a6eb774dba9663551390dcc47b6f
4
+ data.tar.gz: afff49ef45ed57dbd67c6144e40ed76b3c0ced53
5
5
  SHA512:
6
- metadata.gz: 9fc8a5fb6d208a95768dc5b8cab768524eb75a546eb427a2f002a135fe1c6844c14dcfe6afaedca1ef170b25b7e2b347f5218e19c386ba2386cd67005a976723
7
- data.tar.gz: be559964e44fc28b2d2b93271fb162996c8db00a0f2019f556b0c205b4b0d4228cc49efb38c9c250c15a2a0776f3bb94d20e5e0c8b9f2f598fc753d7aa11f99d
6
+ metadata.gz: 30038416ba747451008e4157406d0b39b5e9ac37031ba61c15f03b884b608834f93fa81dab3070ced0da31cf31af970313b61bb5af08d9f7d313e8509b5288aa
7
+ data.tar.gz: f3db1d85f480a288ad171696ecd42e7b2fb8a2b7557d4f28eb6a212c048ced0c81b45de42a7b851767a3255541f16e3a6cfe9f96b8b74de31807321f7f75b743
data/bin/1.9/transactd.so CHANGED
Binary file
data/bin/2.0/transactd.so CHANGED
Binary file
data/bin/2.1/transactd.so CHANGED
Binary file
Binary file
@@ -194,8 +194,9 @@ def testVersion()
194
194
  expect(client_ver.majorVersion.to_s).to eq Transactd::CPP_INTERFACE_VER_MAJOR.to_s
195
195
  expect(client_ver.minorVersion.to_s).to eq Transactd::CPP_INTERFACE_VER_MINOR.to_s
196
196
  expect(client_ver.type.chr).to eq 'N'
197
- expect(server_ver.majorVersion).to be >= 5
198
- expect(server_ver.minorVersion).to be >= 5
197
+ my5x = (server_ver.majorVersion == 5) && (server_ver.minorVersion >= 5)
198
+ maria10 = (server_ver.majorVersion == 10) && (server_ver.minorVersion == 0)
199
+ expect(my5x || maria10).to be true
199
200
  expect(server_ver.type.chr).to eq 'M'
200
201
  expect(engine_ver.majorVersion.to_s).to eq Transactd::TRANSACTD_VER_MAJOR.to_s
201
202
  expect(engine_ver.minorVersion.to_s).to eq Transactd::TRANSACTD_VER_MINOR.to_s
@@ -688,6 +689,9 @@ def testSnapshot()
688
689
  expect(tb.stat()).to eq Transactd::STATUS_NOT_FOUND_TI
689
690
 
690
691
  # clean up
692
+ tb2.setFV(FDI_ID, 29999)
693
+ tb2.seek()
694
+ expect(tb2.stat()).to eq 0
691
695
  tb2.del()
692
696
  expect(tb2.stat()).to eq 0
693
697
 
@@ -716,6 +720,25 @@ def testSnapshot()
716
720
  expect(tb2.stat()).to eq Transactd::STATUS_LOCK_ERROR
717
721
 
718
722
  db.endSnapshot()
723
+
724
+ # gap lock
725
+ db.beginSnapshot(Transactd::MULTILOCK_NOGAP_SHARE)
726
+ tb.seekLast() # id = 30000
727
+ expect(tb.stat()).to eq 0
728
+ tb.seekPrev() # id = 20002
729
+ expect(tb.stat()).to eq 0
730
+ tb.seekPrev() # id = 20001
731
+ expect(tb.stat()).to eq 0
732
+
733
+ tb2.setFV(FDI_ID, 20002)
734
+ tb2.seek(Transactd::ROW_LOCK_X)
735
+ expect(tb2.stat()).to eq Transactd::STATUS_LOCK_ERROR
736
+
737
+ tb2.seekLast(Transactd::ROW_LOCK_X)
738
+ expect(tb2.stat()).to eq Transactd::STATUS_LOCK_ERROR
739
+
740
+ db.endSnapshot()
741
+
719
742
  tbg2.close()
720
743
  tbg.close()
721
744
  tb2.close()
@@ -873,6 +896,37 @@ def testTransactionLockRepeatable()
873
896
  db2.endTrn()
874
897
  db.endTrn()
875
898
 
899
+ # ----------------------------------------------------
900
+ # Test use shared lock option
901
+ # ----------------------------------------------------
902
+ db.beginTrn(Transactd::MULTILOCK_REPEATABLE_READ)
903
+ expect(0).to eq db.stat()
904
+
905
+ db2.beginTrn(Transactd::MULTILOCK_REPEATABLE_READ)
906
+ expect(0).to eq db2.stat()
907
+
908
+ tb.seekLast(Transactd::ROW_LOCK_S)
909
+ expect(0).to eq tb.stat()
910
+ tb2.seekLast(Transactd::ROW_LOCK_S)
911
+ expect(0).to eq tb2.stat()
912
+
913
+ tb.seekPrev() # Lock(X)
914
+ expect(0).to eq tb.stat()
915
+
916
+ tb2.seekPrev(Transactd::ROW_LOCK_S)
917
+ expect(Transactd::STATUS_LOCK_ERROR).to eq tb2.stat()
918
+
919
+ tb.seekPrev(Transactd::ROW_LOCK_S)
920
+ expect(0).to eq tb.stat()
921
+ id = tb.getFVint(FDI_ID)
922
+
923
+ tb2.setFV(FDI_ID, id)
924
+ tb2.seek(Transactd::ROW_LOCK_S)
925
+ expect(0).to eq tb2.stat()
926
+
927
+ db2.endTrn()
928
+ db.endTrn()
929
+
876
930
  # ----------------------------------------------------
877
931
  # Test Abort
878
932
  # ----------------------------------------------------
@@ -1151,6 +1205,9 @@ def testTransactionLockReadCommited()
1151
1205
  tb2.setFV(FDI_ID, 100)
1152
1206
  tb2.seek(Transactd::ROW_LOCK_X)
1153
1207
  expect(tb2.stat()).to eq 0
1208
+ tb2.setFV(FDI_ID, 101)
1209
+ tb2.seek(Transactd::ROW_LOCK_X)
1210
+ expect(tb2.stat()).to eq 0
1154
1211
  tb2.unlock()
1155
1212
  db.endTrn()
1156
1213
 
@@ -1219,8 +1276,12 @@ def testRecordLock()
1219
1276
  tb2.seekNext(Transactd::ROW_LOCK_X) # lock(X) third, second lock freed
1220
1277
  expect(tb2.stat()).to eq 0
1221
1278
 
1222
- tb.seekNext() # nobody lock second.
1223
- expect(tb.stat()).to eq 0
1279
+ tb.seekNext() # nobody lock second. But REPEATABLE_READ tb2 lock all(no unlock)
1280
+ if (db.trxIsolationServer() == Transactd::SRV_ISO_REPEATABLE_READ)
1281
+ expect(tb.stat()).to eq Transactd::STATUS_LOCK_ERROR
1282
+ else
1283
+ expect(tb.stat()).to eq 0
1284
+ end
1224
1285
  tb.seekNext(Transactd::ROW_LOCK_X) # Try lock(X) third
1225
1286
  expect(tb.stat()).to eq Transactd::STATUS_LOCK_ERROR
1226
1287
 
@@ -1246,10 +1307,13 @@ def testRecordLock()
1246
1307
  tb.setFV(FDI_ID, 21000)
1247
1308
  tb.insert()
1248
1309
  expect(tb.stat()).to eq 0
1310
+ tb.setFV(FDI_ID, 21000)
1311
+ tb.seek()
1312
+ expect(tb.stat()).to eq 0
1249
1313
  tb.del()
1250
1314
  expect(tb.stat()).to eq 0
1251
1315
 
1252
- # --------- Unlock test ----------------------------
1316
+ # --------- Unlock test ------------------------------
1253
1317
  # 1 unlock()
1254
1318
  tb.seekFirst(Transactd::ROW_LOCK_X)
1255
1319
  expect(tb.stat()).to eq 0
@@ -1305,7 +1369,12 @@ def testRecordLock()
1305
1369
  tb2.seekFirst(Transactd::ROW_LOCK_X)
1306
1370
  expect(tb2.stat()).to eq 0
1307
1371
  tb2.unlock()
1308
- # --------- End Unlock test ----------------------------
1372
+ # --------- End Unlock test --------------------------
1373
+
1374
+ # --------- Invalid lock type test ----------------
1375
+ tb2.seekFirst(Transactd::ROW_LOCK_S)
1376
+ expect(tb2.stat()).to eq Transactd::STATUS_INVALID_LOCKTYPE
1377
+
1309
1378
  tb3.close()
1310
1379
  tb2.close()
1311
1380
  db2.close()
@@ -1378,23 +1447,21 @@ def testExclusive()
1378
1447
  db2.connect(PROTOCOL + HOSTNAME + DBNAME, true)
1379
1448
  expect(db2.stat()).to eq 0
1380
1449
  db2.open(URL, Transactd::TYPE_SCHEMA_BDF)
1450
+ # database open error. Check database::stat()
1381
1451
  expect(db2.stat()).to eq Transactd::STATUS_CANNOT_LOCK_TABLE
1382
1452
  tb.close()
1383
1453
  db.close()
1384
1454
  db2.close()
1385
1455
 
1386
1456
  # ------------------------------------------------------
1387
- # database WRITE EXCLUSIVE
1457
+ # database READ EXCLUSIVE
1388
1458
  # ------------------------------------------------------
1389
- # table mode exclusive
1390
- db = Transactd::Database.new()
1391
1459
  db.open(URL, Transactd::TYPE_SCHEMA_BDF, Transactd::TD_OPEN_READONLY_EXCLUSIVE)
1392
1460
  expect(db.stat()).to eq 0
1393
1461
  tb = db.openTable(TABLENAME, Transactd::TD_OPEN_READONLY_EXCLUSIVE)
1394
1462
  expect(db.stat()).to eq 0
1395
1463
 
1396
1464
  # Read only open
1397
- db2 = Transactd::Database.new()
1398
1465
  db2.open(URL, Transactd::TYPE_SCHEMA_BDF)
1399
1466
  expect(db2.stat()).to eq 0
1400
1467
  db2.close()
@@ -1429,10 +1496,10 @@ def testExclusive()
1429
1496
 
1430
1497
  tb2 = db.openTable('group', Transactd::TD_OPEN_EXCLUSIVE)
1431
1498
  expect(db.stat()).to eq 0
1499
+
1432
1500
  # Check tb2 Exclusive
1433
1501
  tb3 = db2.openTable('group', Transactd::TD_OPEN_NORMAL)
1434
1502
  expect(db2.stat()).to eq Transactd::STATUS_CANNOT_LOCK_TABLE
1435
-
1436
1503
  for i in 1..4 do
1437
1504
  tb2.setFV(FDI_ID, i + 1)
1438
1505
  tb2.setFV(FDI_NAME, i + 1)
@@ -1474,10 +1541,10 @@ def testExclusive()
1474
1541
  tb2.close()
1475
1542
 
1476
1543
  # ------------------------------------------------------
1477
- # Normal and Exclusive opend tables mix transaction
1544
+ # Normal and Exclusive open tables mix transaction
1478
1545
  # ------------------------------------------------------
1479
1546
  tb2 = db.openTable('group', Transactd::TD_OPEN_EXCLUSIVE)
1480
- expect(tb2.stat()).to eq 0
1547
+ expect(db.stat()).to eq 0
1481
1548
  # Check tb2 Exclusive
1482
1549
  tb3 = db2.openTable('group', Transactd::TD_OPEN_NORMAL)
1483
1550
  expect(db2.stat()).to eq Transactd::STATUS_CANNOT_LOCK_TABLE
@@ -1552,6 +1619,86 @@ def testMultiDatabase()
1552
1619
  db.close()
1553
1620
  end
1554
1621
 
1622
+ def testMissingUpdate()
1623
+ db = Transactd::Database.new()
1624
+ tb = testOpenTable(db)
1625
+ # Lock last record and insert to next of it
1626
+ tb.setFV(FDI_ID, 300000)
1627
+ tb.seekLessThan(false, Transactd::ROW_LOCK_X)
1628
+ if (tb.stat() == 0) then
1629
+ # Get lock(X) same record in parallel.
1630
+ w = Thread.new {
1631
+ db2 = Transactd::Database.new()
1632
+ db2.connect(PROTOCOL + HOSTNAME + DBNAME, true)
1633
+ expect(db2.stat()).to eq 0
1634
+ db2.open(URL, Transactd::TYPE_SCHEMA_BDF, Transactd::TD_OPEN_NORMAL)
1635
+ expect(db2.stat()).to eq 0
1636
+ tb2 = db2.openTable('user')
1637
+ expect(db2.stat()).to eq 0
1638
+ tb2.setFV(FDI_ID, 300000)
1639
+ tb2.seekLessThan(false, Transactd::ROW_LOCK_X)
1640
+ v2 = tb2.getFVint(FDI_ID)
1641
+ tb2.unlock()
1642
+ tb2.close()
1643
+ db2.close()
1644
+ v2
1645
+ }
1646
+ sleep(0.05)
1647
+ v = tb.getFVint(FDI_ID)
1648
+ v = v + 1
1649
+ tb.setFV(FDI_ID, v)
1650
+ tb.insert()
1651
+ v2 = w.join().value
1652
+ if (db.trxIsolationServer() == Transactd::SRV_ISO_REPEATABLE_READ)
1653
+ # $tb can not insert because $tb2 got gap lock with SRV_ISO_REPEATABLE_READ.
1654
+ # It is deadlock!
1655
+ expect(tb.stat()).to eq Transactd::STATUS_LOCK_ERROR
1656
+ else
1657
+ # When SRV_ISO_READ_COMMITED set, $tb2 get lock after $tb->insert.
1658
+ # But this is not READ_COMMITED !
1659
+ expect(tb.stat()).to eq 0
1660
+ expect(v2).to eq (v - 1);
1661
+ # cleanup
1662
+ tb.setFV(FDI_ID, v)
1663
+ tb.seek()
1664
+ expect(tb.stat()).to eq 0
1665
+ tb.del()
1666
+ expect(tb.stat()).to eq 0
1667
+ end
1668
+ end
1669
+ # Lock last record and delete it
1670
+ tb.setFV(FDI_ID, 300000)
1671
+ tb.seekLessThan(false, Transactd::ROW_LOCK_X)
1672
+ if (tb.stat() == 0) then
1673
+ # Get lock(X) same record in parallel.
1674
+ w = Thread.new {
1675
+ db2 = Transactd::Database.new()
1676
+ db2.connect(PROTOCOL + HOSTNAME + DBNAME, true)
1677
+ expect(db2.stat()).to eq 0
1678
+ db2.open(URL, Transactd::TYPE_SCHEMA_BDF, Transactd::TD_OPEN_NORMAL)
1679
+ expect(db2.stat()).to eq 0
1680
+ tb2 = db2.openTable('user')
1681
+ expect(db2.stat()).to eq 0
1682
+ tb2.setFV(FDI_ID, 300000)
1683
+ tb2.seekLessThan(false, Transactd::ROW_LOCK_X)
1684
+ expect(tb2.stat()).to eq 0
1685
+ v2 = tb2.getFVint(FDI_ID)
1686
+ tb2.unlock()
1687
+ tb2.close()
1688
+ db2.close()
1689
+ v2
1690
+ }
1691
+ sleep(0.05)
1692
+ v = tb.getFVint(FDI_ID)
1693
+ tb.del()
1694
+ v2 = w.join().value
1695
+ expect(tb.stat()).to eq 0
1696
+ expect(v).not_to eq v2
1697
+ end
1698
+ tb.close()
1699
+ db.close()
1700
+ end
1701
+
1555
1702
  def testInsert2()
1556
1703
  db = Transactd::Database.new()
1557
1704
  tb = testOpenTable(db)
@@ -1574,16 +1721,17 @@ def testInsert2()
1574
1721
  end
1575
1722
 
1576
1723
  def testDelete()
1724
+ expected_count = 20003
1577
1725
  db = Transactd::Database.new()
1578
1726
  tb = testOpenTable(db)
1579
1727
  # estimate count
1580
1728
  count = tb.recordCount(true)
1581
- is_valid_count = ((count - TEST_COUNT).abs < ALLOWABLE_ERROR_DISTANCE_IN_ESTIMATE_COUNT)
1729
+ is_valid_count = ((count - expected_count).abs < 5000)
1582
1730
  expect(is_valid_count).to be true
1583
1731
  if !is_valid_count
1584
- puts "true record count = #{(TEST_COUNT + 3).to_s} and estimate recordCount count = #{count.to_s}"
1732
+ puts "true record count = #{expected_count.to_s} and estimate recordCount count = #{count.to_s}"
1585
1733
  end
1586
- expect(tb.recordCount(false)).to eq TEST_COUNT + 3 # true count
1734
+ expect(tb.recordCount(false)).to eq expected_count # true count
1587
1735
  vv = TEST_COUNT * 3 / 4 + 1
1588
1736
  tb.clearBuffer()
1589
1737
  tb.setFV(FDI_ID, vv)
@@ -1646,8 +1794,8 @@ def testLogin()
1646
1794
  db2 = Transactd::Database.new()
1647
1795
  db2.connect(PROTOCOL + HOSTNAME, true)
1648
1796
  expect(db2.stat()).to eq 0
1649
- db2.disconnect(PROTOCOL + HOSTNAME)
1650
- db.disconnect(PROTOCOL + HOSTNAME)
1797
+ db2.disconnect()
1798
+ db.disconnect()
1651
1799
  expect(db.stat()).to eq 0
1652
1800
  end
1653
1801
  # invalid host name
@@ -1660,23 +1808,23 @@ def testLogin()
1660
1808
  end
1661
1809
  testCreateDatabase(db)
1662
1810
  testCreateTable(db)
1663
- db.disconnect(PROTOCOL + HOSTNAME + DBNAME)
1811
+ db.close()
1664
1812
  expect(db.stat()).to eq 0
1665
1813
  # true database name
1666
1814
  db.connect(PROTOCOL + HOSTNAME + DBNAME)
1667
1815
  expect(db.stat()).to eq 0
1668
1816
  if (db.stat() == 0)
1669
- db.disconnect(PROTOCOL + HOSTNAME + DBNAME)
1817
+ db.disconnect()
1670
1818
  expect(db.stat()).to eq 0
1671
1819
  end
1672
1820
  # invalid database name
1673
1821
  testDropDatabase(db)
1674
- db.disconnect(PROTOCOL + HOSTNAME + DBNAME)
1822
+ db.disconnect()
1675
1823
  expect(db.stat()).to eq 0
1676
1824
  db.connect(PROTOCOL + HOSTNAME + DBNAME)
1677
- expect(db.stat()).to eq (25000 + 1049)
1678
- db.disconnect(PROTOCOL + HOSTNAME + DBNAME)
1679
- expect(db.stat()).to eq 0
1825
+ expect(db.stat()).to eq (Transactd::ERROR_NO_DATABASE)
1826
+ db.disconnect()
1827
+ expect(db.stat()).to eq 1
1680
1828
  db.close()
1681
1829
  end
1682
1830
 
@@ -2741,6 +2889,8 @@ def testCreateQueryTest()
2741
2889
  if (td != nil && td.fieldCount == 3) then
2742
2890
  tb = db.openTable('extention')
2743
2891
  if (db.stat() == 0 && tb.recordCount(false) == TEST_COUNT)
2892
+ tb.close()
2893
+ db.close()
2744
2894
  return
2745
2895
  end
2746
2896
  tb.close()
@@ -3034,20 +3184,6 @@ def testServerPrepareJoin()
3034
3184
  # rs[0]
3035
3185
  expect(rs[0]['group_name']).to eq '1 group'
3036
3186
 
3037
- =begin
3038
- sortFields orderRv
3039
- orderRv.add('group_name', false)
3040
- rs.orderBy(orderRv)
3041
-
3042
- sortFields order
3043
- order.add('group_name', true)
3044
- rs.orderBy(order)
3045
- BOOST_CHECK_MESSAGE(_tstring(rs[(size_t)0]['group_name'].c_str()) ==
3046
- _tstring('1 group'),
3047
- "group_name = 1 group "
3048
- << string(rs[(size_t)0]['group_name'].a_str()))
3049
- =end
3050
-
3051
3187
  # All fields
3052
3188
  rs.clear()
3053
3189
  q.reset().all()
@@ -3140,7 +3276,12 @@ BOOST_CHECK_MESSAGE(_tstring(rs[(size_t)0]['group_name'].c_str()) ==
3140
3276
  tb.setFV('blob', '5 blob')
3141
3277
  tb.insert()
3142
3278
  expect(tb.stat()).to eq 0
3143
- db.drop() unless (tb.stat() == 0)
3279
+ status = tb.stat()
3280
+ atu.release()
3281
+ atg.release()
3282
+ ate.release()
3283
+ db.drop() unless (status == 0)
3284
+ db.close()
3144
3285
  end
3145
3286
 
3146
3287
  def testWirtableRecord()
@@ -3292,6 +3433,9 @@ describe Transactd do
3292
3433
  it 'multi database' do
3293
3434
  testMultiDatabase()
3294
3435
  end
3436
+ it 'missing update' do
3437
+ testMissingUpdate()
3438
+ end
3295
3439
  it 'insert2' do
3296
3440
  testInsert2()
3297
3441
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transactd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: x86-mswin32-100
6
6
  authors:
7
7
  - BizStation Corp.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-24 00:00:00.000000000 Z
11
+ date: 2015-01-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Transactd client for ruby gem
14
14
  email: transactd@bizstation.jp
@@ -21,8 +21,8 @@ files:
21
21
  - bin/2.0/transactd.so
22
22
  - bin/2.1/transactd.so
23
23
  - build/tdclrb/bldgem/extconf.rb
24
- - bin/common/tdclcpp_vc100_32mr_2_1.dll
25
- - bin/common/tdclc_32_2_1.dll
24
+ - bin/common/tdclcpp_vc100_32mr_2_2.dll
25
+ - bin/common/tdclc_32_2_2.dll
26
26
  - build/tdclrb/gem/detect.rb
27
27
  - build/tdclrb/gem/helper.rb
28
28
  - build/tdclrb/gem/INSTALLLOG.win32
Binary file
Binary file