Commits on Source 12

  • cznic's avatar
    restore logo.png · 2942e462
    cznic authored
    2942e462
  • cznic's avatar
    CHANGELOG.md: fix formatting · c2c62726
    cznic authored
    c2c62726
  • Josh Bleecher Snyder's avatar
    add _timezone DSN query parameter · 18958226
    Josh Bleecher Snyder authored
    _timezone accepts an IANA timezone name, such as
    "UTC", and applies it to both reads and writes.
    
    For writes, time.Time values are converted to the
    target timezone before formatting.
    
    For reads, timezone-less strings are interpreted
    as being in the target timezone.
    
    Supporting configuration at the DB driver level
    helps avoid industrial accidents when working with
    SQLite datetime strings, which lack time zones.
    18958226
  • Josh Bleecher Snyder's avatar
    add _time_format=datetime support · 77706c14
    Josh Bleecher Snyder authored
    So that time.Times may be formatted identically to how SQLite
    does it natively with datetime and CURRENT_TIMESTAMP.
    77706c14
  • cznic's avatar
    Merge branch 'add-timezone' into 'master' · 2e045237
    cznic authored
    add _timezone DSN query parameter
    
    See merge request !94
    2e045237
  • cznic's avatar
    Merge branch 'datetime-format' into 'master' · 78ddab8b
    cznic authored
    add _time_format=datetime support
    
    See merge request !95
    78ddab8b
  • cznic's avatar
    update {CHANGELOG,README}.md · 19b84291
    cznic authored
    19b84291
  • Josh Bleecher Snyder's avatar
    add conn.freeAllocs · 2a97c686
    Josh Bleecher Snyder authored
    This particular loop occurs a lot.
    Give it a name and make it concise.
    No functional changes.
    The goal is to make upcoming changes a bit clearer.
    2a97c686
  • Josh Bleecher Snyder's avatar
    improve memory safety of allocs in stmt.query · ef93ba85
    Josh Bleecher Snyder authored
    The multi-statement path was subject to both double-frees and leaks.
    
    Having allocs declared once and re-used across loop iterations
    made it hard to manage correctly. Reduce its scope to within the
    inner closure and defer freeAllocs there.
    
    Even within a loop, it was easy to mismanage; force callers to deal
    with this consistently by passing a pointer to newRows and zeroing there.
    
    Take care to Close rows objects from previous iterations when
    a subsequent statement in a multi-statement query fails.
    
    The tests here demonstrate both double-frees and
    leaked memory without these changes.
    
    I noticed while in this code that in the optimized
    single-statement path, there are some unnecessary calls to
    reset/clearBindings after newRows. When newRows fails, its internal
    defer calls r.Close, which finalizes the prepared statement.
    The subsequent reset and clearBindings calls would then operate
    on an already-finalized handle. This would be bad, except that
    columnCount/columnName cannot fail on a valid pstmt.
    Therefore, the error path is dead code.
    I didn't touch it, even though pedantically it looks wrong.
    There might also be some dangling SQLITE_STATIC references.
    Again, this appears to be safe in practice, so I left it alone.
    A follow-up could make it conform to the docs
    and ensure extra safety.
    
    I don't plan to do any of this follow-up work;
    I am focused for now only on demonstrable, directly testable issues.
    ef93ba85
  • cznic's avatar
    Merge branch 'multi-stmt-double-free' into 'master' · 60500243
    cznic authored
    improve memory safety of allocs in stmt.query
    
    See merge request !96
    60500243
  • cznic's avatar
    CHANGELOG.md: document v1.48.1 · 50a8b7f6
    cznic authored
    50a8b7f6
  • cznic's avatar
    CHANGELOG.md: document v1.48.1... · 51d1f912
    cznic authored
    51d1f912
Loading
Loading