Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-4346

DML and PHP PDO: double field is converted to bigdecimal

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8
    • Component/s: None
    • Labels:
      None

      Description

      I've set up PHP PDO and ODBC environment according to the following documentation
      https://apacheignite-mix.readme.io/docs/php-pdo

      In particular:

      • The ODBC driver was built from the latest 1.8 sources located in ignite-1.8 branch.
      • The DSN configuration is shown in the attached screenshot name "dsn_configuration"
      • Ignite's cluster configuration is attached as well.

      To reproduce the issue do the following:

      • start a node using attached default-config.xml
      • execute insert.php. There won't be any error.
      • execute update.php and you'll get the error with the stack trace below
      Caused by: class org.apache.ignite.IgniteCheckedException: Failed to execute DML
       statement [qry=UPDATE Person SET salary = 42000.0 WHERE salary > 50000.0, param
      s=[]]
              at org.apache.ignite.internal.processors.query.GridQueryProcessor.execut
      eQuery(GridQueryProcessor.java:1800)
              at org.apache.ignite.internal.processors.query.GridQueryProcessor.queryT
      woStep(GridQueryProcessor.java:810)
              ... 13 more
      Caused by: class org.apache.ignite.internal.processors.query.IgniteSQLException:
       Failed to execute DML statement [qry=UPDATE Person SET salary = 42000.0 WHERE s
      alary > 50000.0, params=[]]
              at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.query
      TwoStep(IgniteH2Indexing.java:1270)
              at org.apache.ignite.internal.processors.query.GridQueryProcessor$4.appl
      yx(GridQueryProcessor.java:812)
              at org.apache.ignite.internal.processors.query.GridQueryProcessor$4.appl
      yx(GridQueryProcessor.java:810)
              at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOu
      tClosureX.java:36)
              at org.apache.ignite.internal.processors.query.GridQueryProcessor.execut
      eQuery(GridQueryProcessor.java:1777)
              ... 14 more
      Caused by: class org.apache.ignite.internal.transactions.IgniteTxHeuristicChecke
      dException: Failed to locally write to cache (all transaction entries will be in
      validated, however there was a window when entries for this transaction were vis
      ible to others): GridNearTxLocal [mappings=IgniteTxMappingsSingleImpl [mapping=G
      ridDistributedTxMapping [entries=[IgniteTxEntry [key=KeyCacheObjectImpl [val=777
      , hasValBytes=false], cacheId=1215863053, partId=-1, txKey=IgniteTxKey [key=KeyC
      acheObjectImpl [val=777, hasValBytes=false], cacheId=1215863053], val=[op=TRANSF
      ORM, val=null], prevVal=[op=NOOP, val=null], oldVal=[op=NOOP, val=null], entryPr
      ocessorsCol=[IgniteBiTuple [val1=org.apache.ignite.internal.processors.query.h2.
      DmlStatementsProcessor$ModifyingEntryProcessor@1f2f10da, val2=[Ljava.lang.Object
      ;@2bfa5294]], ttl=-1, conflictExpireTime=-1, conflictVer=null, explicitVer=null,
       dhtVer=GridCacheVersion [topVer=92027384, time=1480547401695, order=14805473813
      93, nodeOrder=1], filters=[], filtersPassed=false, filtersSet=true, entry=GridDh
      tColocatedCacheEntry [super=GridDhtCacheEntry [rdrs=[], locPart=GridDhtLocalPart
      ition [id=777, map=org.apache.ignite.internal.processors.cache.GridCacheConcurre
      ntMapImpl@24c94530, rmvQueue=GridCircularBuffer [sizeMask=255, idxGen=0], cntr=1
      , shouldBeRenting=false, state=OWNING, reservations=0, empty=false, createTime=1
      1/30/2016 15:09:45], super=GridDistributedCacheEntry [super=GridCacheMapEntry [k
      ey=KeyCacheObjectImpl [val=777, hasValBytes=false], val=Person [idHash=659295625
      , hash=-322179972, resume=Secret Service agent, firstName=James, lastName=Bond,
      salary=65000.0], startVer=1480547381389, ver=GridCacheVersion [topVer=92027384,
      time=1480547394518, order=1480547381390, nodeOrder=1], hash=777, extras=GridCach
      eMvccEntryExtras [mvcc=GridCacheMvcc [locs=[GridCacheMvccCandidate [nodeId=08b20
      b4b-3ca6-4c05-aa9d-4219cbc3f3f5, ver=GridCacheVersion [topVer=92027384, time=148
      0547401693, order=1480547381392, nodeOrder=1], timeout=0, ts=1480547401693, thre
      adId=57, id=3, topVer=AffinityTopologyVersion [topVer=1, minorTopVer=0], reentry
      =null, otherNodeId=08b20b4b-3ca6-4c05-aa9d-4219cbc3f3f5, otherVer=GridCacheVersi
      on [topVer=92027384, time=1480547401693, order=1480547381392, nodeOrder=1], mapp
      edDhtNodes=null, mappedNearNodes=null, ownerVer=null, serOrder=null, key=KeyCach
      eObjectImpl [val=777, hasValBytes=false], masks=local=1|owner=1|ready=1|reentry=
      0|used=0|tx=1|single_implicit=1|dht_local=1|near_local=0|removed=0, prevVer=null
      , nextVer=null]], rmts=null]], flags=0]]]], prepared=1, locked=false, nodeId=08b
      20b4b-3ca6-4c05-aa9d-4219cbc3f3f5, locMapped=false, expiryPlc=null, transferExpi
      ryPlc=false, flags=6, partUpdateCntr=0, serReadVer=null, xidVer=GridCacheVersion
       [topVer=92027384, time=1480547401693, order=1480547381392, nodeOrder=1]]], expl
      icitLock=false, dhtVer=GridCacheVersion [topVer=92027384, time=1480547401693, or
      der=1480547381392, nodeOrder=1], last=false, near=false, clientFirst=false, node
      =08b20b4b-3ca6-4c05-aa9d-4219cbc3f3f5]], nearLocallyMapped=false, colocatedLocal
      lyMapped=true, needCheckBackup=null, hasRemoteLocks=false, thread=odbc-#27%null%
      , mappings=IgniteTxMappingsSingleImpl [mapping=GridDistributedTxMapping [entries
      =[IgniteTxEntry [key=KeyCacheObjectImpl [val=777, hasValBytes=false], cacheId=12
      15863053, partId=-1, txKey=IgniteTxKey [key=KeyCacheObjectImpl [val=777, hasValB
      ytes=false], cacheId=1215863053], val=[op=TRANSFORM, val=null], prevVal=[op=NOOP
      , val=null], oldVal=[op=NOOP, val=null], entryProcessorsCol=[IgniteBiTuple [val1
      =org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor$Modifying
      EntryProcessor@1f2f10da, val2=[Ljava.lang.Object;@2bfa5294]], ttl=-1, conflictEx
      pireTime=-1, conflictVer=null, explicitVer=null, dhtVer=GridCacheVersion [topVer
      =92027384, time=1480547401695, order=1480547381393, nodeOrder=1], filters=[], fi
      ltersPassed=false, filtersSet=true, entry=GridDhtColocatedCacheEntry [super=Grid
      DhtCacheEntry [rdrs=[], locPart=GridDhtLocalPartition [id=777, map=org.apache.ig
      nite.internal.processors.cache.GridCacheConcurrentMapImpl@24c94530, rmvQueue=Gri
      dCircularBuffer [sizeMask=255, idxGen=0], cntr=1, shouldBeRenting=false, state=O
      WNING, reservations=0, empty=false, createTime=11/30/2016 15:09:45], super=GridD
      istributedCacheEntry [super=GridCacheMapEntry [key=KeyCacheObjectImpl [val=777,
      hasValBytes=false], val=Person [idHash=659295625, hash=-322179972, resume=Secret
       Service agent, firstName=James, lastName=Bond, salary=65000.0], startVer=148054
      7381389, ver=GridCacheVersion [topVer=92027384, time=1480547394518, order=148054
      7381390, nodeOrder=1], hash=777, extras=GridCacheMvccEntryExtras [mvcc=GridCache
      Mvcc [locs=[GridCacheMvccCandidate [nodeId=08b20b4b-3ca6-4c05-aa9d-4219cbc3f3f5,
       ver=GridCacheVersion [topVer=92027384, time=1480547401693, order=1480547381392,
       nodeOrder=1], timeout=0, ts=1480547401693, threadId=57, id=3, topVer=AffinityTo
      pologyVersion [topVer=1, minorTopVer=0], reentry=null, otherNodeId=08b20b4b-3ca6
      -4c05-aa9d-4219cbc3f3f5, otherVer=GridCacheVersion [topVer=92027384, time=148054
      7401693, order=1480547381392, nodeOrder=1], mappedDhtNodes=null, mappedNearNodes
      =null, ownerVer=null, serOrder=null, key=KeyCacheObjectImpl [val=777, hasValByte
      s=false], masks=local=1|owner=1|ready=1|reentry=0|used=0|tx=1|single_implicit=1|
      dht_local=1|near_local=0|removed=0, prevVer=null, nextVer=null]], rmts=null]], f
      lags=0]]]], prepared=1, locked=false, nodeId=08b20b4b-3ca6-4c05-aa9d-4219cbc3f3f
      5, locMapped=false, expiryPlc=null, transferExpiryPlc=false, flags=6, partUpdate
      Cntr=0, serReadVer=null, xidVer=GridCacheVersion [topVer=92027384, time=14805474
      01693, order=1480547381392, nodeOrder=1]]], explicitLock=false, dhtVer=GridCache
      Version [topVer=92027384, time=1480547401693, order=1480547381392, nodeOrder=1],
       last=false, near=false, clientFirst=false, node=08b20b4b-3ca6-4c05-aa9d-4219cbc
      3f3f5]], super=GridDhtTxLocalAdapter [nearOnOriginatingNode=false, nearNodes=[],
       dhtNodes=[], explicitLock=false, super=IgniteTxLocalAdapter [completedBase=null
      , sndTransformedVals=false, depEnabled=false, txState=IgniteTxImplicitSingleStat
      eImpl [init=true], super=IgniteTxAdapter [xidVer=GridCacheVersion [topVer=920273
      84, time=1480547401693, order=1480547381392, nodeOrder=1], writeVer=GridCacheVer
      sion [topVer=92027384, time=1480547401695, order=1480547381393, nodeOrder=1], im
      plicit=true, loc=true, threadId=57, startTime=1480547401693, nodeId=08b20b4b-3ca
      6-4c05-aa9d-4219cbc3f3f5, startVer=GridCacheVersion [topVer=92027384, time=14805
      47401693, order=1480547381392, nodeOrder=1], endVer=null, isolation=READ_COMMITT
      ED, concurrency=OPTIMISTIC, timeout=0, sysInvalidate=false, sys=false, plc=2, co
      mmitVer=GridCacheVersion [topVer=92027384, time=1480547401693, order=14805473813
      92, nodeOrder=1], finalizing=NONE, preparing=false, invalidParts=null, state=COM
      MITTING, timedOut=false, topVer=AffinityTopologyVersion [topVer=1, minorTopVer=0
      ], duration=0ms, onePhaseCommit=true], size=1]]]
              at org.apache.ignite.internal.processors.cache.transactions.IgniteTxLoca
      lAdapter.userCommit(IgniteTxLocalAdapter.java:950)
              at org.apache.ignite.internal.processors.cache.distributed.near.GridNear
      TxLocal.finish(GridNearTxLocal.java:747)
              at org.apache.ignite.internal.processors.cache.distributed.near.GridNear
      TxFinishFuture.finish(GridNearTxFinishFuture.java:418)
              at org.apache.ignite.internal.processors.cache.distributed.near.GridNear
      TxLocal$4.apply(GridNearTxLocal.java:868)
              at org.apache.ignite.internal.processors.cache.distributed.near.GridNear
      TxLocal$4.apply(GridNearTxLocal.java:860)
              at org.apache.ignite.internal.util.future.GridFutureAdapter.notifyListen
      er(GridFutureAdapter.java:264)
              at org.apache.ignite.internal.util.future.GridFutureAdapter.listen(GridF
      utureAdapter.java:227)
              at org.apache.ignite.internal.processors.cache.distributed.near.GridNear
      TxLocal.commitAsync(GridNearTxLocal.java:860)
              at org.apache.ignite.internal.processors.cache.transactions.IgniteTxLoca
      lAdapter.optimisticPutFuture(IgniteTxLocalAdapter.java:3219)
              at org.apache.ignite.internal.processors.cache.transactions.IgniteTxLoca
      lAdapter.putAllAsync0(IgniteTxLocalAdapter.java:3185)
              at org.apache.ignite.internal.processors.cache.transactions.IgniteTxLoca
      lAdapter.invokeAsync(IgniteTxLocalAdapter.java:1907)
              at org.apache.ignite.internal.processors.cache.GridCacheAdapter$33.op(Gr
      idCacheAdapter.java:2518)
              at org.apache.ignite.internal.processors.cache.GridCacheAdapter$33.op(Gr
      idCacheAdapter.java:2514)
              at org.apache.ignite.internal.processors.cache.GridCacheAdapter.syncOp(G
      ridCacheAdapter.java:4351)
              at org.apache.ignite.internal.processors.cache.GridCacheAdapter.invokeAl
      l(GridCacheAdapter.java:2514)
              at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor
      .processPage(DmlStatementsProcessor.java:758)
              at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor
      .doUpdate(DmlStatementsProcessor.java:535)
              at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor
      .executeUpdateStatement(DmlStatementsProcessor.java:285)
              at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor
      .updateSqlFields(DmlStatementsProcessor.java:155)
              at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor
      .updateSqlFieldsTwoStep(DmlStatementsProcessor.java:185)
              at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.query
      TwoStep(IgniteH2Indexing.java:1266)
              ... 18 more
      Caused by: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to
      java.lang.Double
              at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$RowDe
      scriptor.wrap(IgniteH2Indexing.java:2962)
              at org.apache.ignite.internal.processors.query.h2.opt.GridH2AbstractKeyV
      alueRow.getValue(GridH2AbstractKeyValueRow.java:316)
              at org.h2.index.BaseIndex.compareRows(BaseIndex.java:294)
              at org.apache.ignite.internal.processors.query.h2.opt.GridH2TreeIndex$2.
      compare(GridH2TreeIndex.java:103)
              at org.apache.ignite.internal.processors.query.h2.opt.GridH2TreeIndex$2.
      compare(GridH2TreeIndex.java:95)
              at java.util.concurrent.ConcurrentSkipListMap.cpr(ConcurrentSkipListMap.
      java:655)
              at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMa
      p.java:835)
              at java.util.concurrent.ConcurrentSkipListMap.put(ConcurrentSkipListMap.
      java:1581)
              at org.apache.ignite.internal.processors.query.h2.opt.GridH2TreeIndex.pu
      t(GridH2TreeIndex.java:362)
              at org.apache.ignite.internal.processors.query.h2.opt.GridH2Table.doUpda
      te(GridH2Table.java:566)
              at org.apache.ignite.internal.processors.query.h2.opt.GridH2Table.update
      (GridH2Table.java:495)
              at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.store
      (IgniteH2Indexing.java:603)
              at org.apache.ignite.internal.processors.query.GridQueryProcessor.store(
      GridQueryProcessor.java:737)
              at org.apache.ignite.internal.processors.cache.query.GridCacheQueryManag
      er.store(GridCacheQueryManager.java:431)
              at org.apache.ignite.internal.processors.cache.GridCacheMapEntry.updateI
      ndex(GridCacheMapEntry.java:4019)
              at org.apache.ignite.internal.processors.cache.GridCacheMapEntry.innerSe
      t(GridCacheMapEntry.java:1253)
              at org.apache.ignite.internal.processors.cache.transactions.IgniteTxLoca
      lAdapter.userCommit(IgniteTxLocalAdapter.java:784)
              ... 38 more
      

        Attachments

        1. default-config.xml
          2 kB
          Denis A. Magda
        2. dsn_configuration.png
          40 kB
          Denis A. Magda
        3. insert.php
          0.9 kB
          Denis A. Magda
        4. update.php
          0.5 kB
          Denis A. Magda

          Issue Links

            Activity

              People

              • Assignee:
                al.psc Alexander Paschenko
                Reporter:
                dmagda Denis A. Magda
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: