[cl-rdbms-devel] hu.dwim.rdbms.oracle-timestamp-with-timezone-local-time-bug

Marshall McLuhan marshall.mcluhan at gmx.net
Thu Nov 4 21:15:38 UTC 2010



How do I handle such thing most efficiently? Should I report them at all?

Did change the following in hu.dwim.rdbms/source/oracle/conversion.lisp
(dunno if this does more harm than good without unit tests but atleast the error is gone)


(def function make-timezone (hours minutes)
  (let ((offset-in-sec (* (+ (* 60 hours) minutes) 60)))
    (if (and (= minutes 0)
             (= hours 0))
        +utc-zone+
        (local-time::make-timezone
     :subzones `((,offset-in-sec nil "anonymous" nil nil))
     :name "anonymous"
     :loaded t))))

to     

(def function make-timezone-old (hours minutes)
  (let ((offset-in-sec (* (+ (* 60 hours) minutes) 60)))
    (if (and (= minutes 0)
             (= hours 0))
        +utc-zone+
    (local-time::make-timezone
     :subzones (make-array 1 :initial-contents
                   (list (local-time::make-subzone
                      :offset offset-in-sec)))
     :name "anonymous"
     :loaded t))))


to get rid of:     

SYMORA> (with-symdb (execute [select * symtag]))
--TIME MARK 2010-11-04--
21:34 0           RDBMS DEBUG   About to BEGIN transaction in database #<ORACLE {100DD2F9B1}>
21:34 0           RDBMS DEBUG   Executing "SELECT * FROM symtag"
STYLE-WARNING: Undefined alien: "OCIGetInstantClientPackageName"
21:34 0           RDBMS DEBUG   Connecting in transaction #<#<STANDARD-CLASS NIL {10033B8C31}> :begin-executed-p #t {1002DFA061}>
21:34 0           RDBMS DEBUG   Logging on in transaction #<#<STANDARD-CLASS NIL {10033B8C31}> :begin-executed-p #t {1002DFA061}>
21:34 0           RDBMS DEBUG   Preparing command: "SELECT * FROM symtag"
21:34 0           RDBMS DEBUG   Fetching "SYMTAG_KEY" from buffer at index 0
21:34 0           RDBMS DEBUG   Fetched: "foo"
21:34 0           RDBMS DEBUG   Fetching "SYMTAG_CREATION_DATE" from buffer at index 0
21:34 0           RDBMS DEBUG   Fetched: :NULL
21:34 0           RDBMS DEBUG   Fetching "SYMTAG_KEY" from buffer at index 0
21:34 0           RDBMS DEBUG   Fetched: "foobar"
21:34 0           RDBMS DEBUG   Fetching "SYMTAG_CREATION_DATE" from buffer at index 0
21:34 0           RDBMS DEBUG   Fetched: :NULL
21:34 0           RDBMS DEBUG   Fetching "SYMTAG_KEY" from buffer at index 0
21:34 0           RDBMS DEBUG   Fetched: "foo11"
21:34 0           RDBMS DEBUG   Fetching "SYMTAG_CREATION_DATE" from buffer at index 0


--- *sbcl debug buffer*

The value ((3600 NIL "anonymous" NIL NIL))
is not of type
  (SIMPLE-ARRAY T (*)).
   [Condition of type TYPE-ERROR]

Restarts:
 0: [TERMINATE-TRANSACTION] return (values) from the WITH-TRANSACTION block executing the current terminal action :COMMIT
 1: [COMMIT-TRANSACTION] mark transaction for commit only and return (values) from the WITH-TRANSACTION block
 2: [ROLLBACK-TRANSACTION] mark transaction for rollback only and return (values) from the WITH-TRANSACTION block
 3: [RESTART-TRANSACTION] rollback the transaction by unwinding the stack and restart the WITH-TRANSACTION block in a new database transaction
 4: [RETRY] Retry SLIME REPL evaluation request.
 5: [*ABORT] Return to SLIME's top level.
 --more--

Backtrace:
  0: (LOCAL-TIME::MAKE-TIMEZONE)[:EXTERNAL]
      Locals:
        SB-DEBUG::ARG-0 = 6
  1: (HU.DWIM.RDBMS.ORACLE::LOCAL-TIME-FROM-TIMESTAMP-TZ #.(SB-SYS:INT-SAP #X006918C0) #<unavailable argument>)
      Locals:
        SB-DEBUG::ARG-0 = #.(SB-SYS:INT-SAP #X006918C0)
        SB-DEBUG::ARG-1 = :<NOT-AVAILABLE>
  2: (HU.DWIM.RDBMS.ORACLE::FETCH-COLUMN-VALUE #<HU.DWIM.RDBMS.ORACLE::COLUMN-DESCRIPTOR {100B9E6761}> 0)
      Locals:
        SB-DEBUG::ARG-0 = #<HU.DWIM.RDBMS.ORACLE::COLUMN-DESCRIPTOR {100B9E6761}>
        SB-DEBUG::ARG-1 = 0
  3: (CURRENT-ROW #<HU.DWIM.RDBMS.ORACLE::ORACLE-SEQUENTIAL-ACCESS-CURSOR {100B9E6E71}>)[:EXTERNAL]
  4: (FOR-EACH-ROW #<CLOSURE (LAMBDA #) {100B9E8979}> #<HU.DWIM.RDBMS.ORACLE::ORACLE-SEQUENTIAL-ACCESS-CURSOR {100B9E6E71}>)[:EXTERNAL]
  5: (COLLECT-ROWS #<HU.DWIM.RDBMS.ORACLE::ORACLE-SEQUENTIAL-ACCESS-CURSOR {100B9E6E71}>)[:EXTERNAL]
  6: (HU.DWIM.RDBMS.ORACLE::EXECUTE-PREPARED-STATEMENT ..)[:EXTERNAL]
  7: ((SB-PCL::FAST-METHOD HU.DWIM.RDBMS::EXECUTE-COMMAND (ORACLE HU.DWIM.RDBMS.ORACLE::ORACLE-TRANSACTION STRING)) ..)[:EXTERNAL]
  8: ((LAMBDA (SB-PCL::.PV. SB-PCL::.NEXT-METHOD-CALL. SB-PCL::.ARG0. SB-PCL::.ARG1. SB-PCL::.ARG2. SB-INT:&MORE SB-PCL::.DFUN-MORE-CONTEXT. SB-PCL::.DFUN-MORE-COUNT.)) ..)
  9: (HU.DWIM.RDBMS::CALL-WITH-TRANSACTION* #<FUNCTION (LABELS HU.DWIM.RDBMS::WITH-TRANSACTION*-BODY) {10034E8619}>)[:EXTERNAL]
 10: ((LAMBDA ()))
 11: (SB-INT:SIMPLE-EVAL-IN-LEXENV (WITH-SYMDB (EXECUTE (SQL #))) #<NULL-LEXENV>)
 --more--
 


!DSPAM:4cd3227b48581611617599!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cl-rdbms-devel/attachments/20101104/76a167bf/attachment.html>


More information about the cl-rdbms-devel mailing list