Wednesday, April 28, 2021

SQL Relay 1.9.0 Release

Version 1.9.0 of SQL Relay, the powerful connection pool, load balancer, query router, and database proxy, is now available.

The main features of this release are:

Support for TLS Encryption in the MySQL and PostgreSQL Protocol Modules

SQL Relay has long supported the MySQL and PostgreSQL protocols, on the front-end, allowing SQL Relay to be dropped-in, transparently between many MySQL or PostgreSQL applications and the database. However, SQL Relay's implementation of the MySQL and PostgreSQL protocols has lacked support for TLS encryption, until now. It is now possible to do end-to-end encryption (without a tunnel) from a MySQL or PostgreSQL application, through SQL Relay, and into the database.

Support for UTF-16 Characters in SQL Server nchar/nvarchar Fields

SQL Server 2012 introduced the ability to store UTF-16 characters in nchar/nvarchar fields in addition to the standard UCS-2 that they traditionally supported. However, SQL Relay has traditionally forced a UCS-2 encoding when using nchar/nvarchar fields, preventing SQL Server users from being able to take advantage of this feature. Starting with this release, when using ODBC to connect SQL Relay to a SQL Server database, you can now specify ncharencoding=UCS-2 or ncharencoding=UTF-16 in the connect string to instruct SQL Relay how to deal with nchar/nvarchar fields.

PHP 8 Support

SQL Relay should now compile against, and work seamlessly with PHP 8.

NodeJS 14+ Support

SQL Relay should now compile against, and work seamlessly with NodeJS 14+.

Of course, there are many other subtle new features, improvements, and bug fixes. Full ChangeLog follows:

  • added missing inequality operators to end-of-bind detection
  • fixed commit/begin without commitcount error in sqlrimportcsv
  • fetch errors aren't returned if sqlrclient protocol version < 2
  • query-intercept catches "begin transaction" now
  • query-intercept doesn't intercept various begin-type statements if the query is actually a block of sql containing commit or rollback
  • added ncharencoding option to odbc connection to enable UTF-16 values in SQL Server nchars/nvarchars
  • fixed a bug that caused output binds of length 8000+ to fail on SQL Server
  • begin() runs "begin transaction" instead of just "begin" on SQL Server
  • fixed a column-count reset bug in odbc, db2, informix, and postgresql that could cause begin queries to fail when fake transaction blocks are used
  • object lists have correct column names for mysql, odbc, and jdbc now
  • fixed a bug that caused rollback to be called insted of commit when endofsession="commit" and faketransactionblocks=yes are used
  • commit/rollback is now called at the end of session when faketransactoinblocks=yes is used, whether or not the server believes it's in a transaction block, to catch cases where the begin-interceptor is intentionally bypassed
  • sqlrimportcsv handles dates without centuries now
  • fixed crash in replay module when table name is quoted
  • mysql explain statements work now
  • fixed node-gyp.js detection on ubuntu 20.04
  • added configure options for PHP 8.x
  • added php/pdo module tweaks for PHP 8
  • mysql and postgresql protocol modules support TLS now
  • pushed most of tls/gss code up into sqlrprotocol parent class
  • fixed subtle issues in mysql/postgresql database modules that could sometimes cause reexecutes of the same query with the same bind variables to return no results the second time
  • the configure script specifically looks for liberl_interface.a now
  • updated nodejs macros for node 14+
  • fixed subtle bugs in Python getField, getFieldLength, and getRowLengthsDictionary functions
  • added GVL management to the Ruby API
  • applied patch from Igor to fix configure.vbs VC++ version detection for non-US versions

Rudiments 1.4.0 Release

Version 1.4.0 of Rudiments, the C++ class library for developing systems and applications, is now available.

Though this release does include some new classes, additions to existing classes, this release mainly features changes to improve consistency between classes, as well as some under-the-hood improvements.

ChangeLog follows:

  • added wcharacter, wcharstring, and wstringbuffer classes
  • memorymap::getLength() -> getSize()
  • added various *IgnoringCase methods to charstring/wcharstring
  • removed length()/isNullOrEmpty() with const unsigned char * arguments
  • now size="number of bytes" and length="number of characters/elements", updated comments, parameters, and some method names
  • added datetime::getCentury()
  • added datetime::getShortYear()
  • fixed jsondom::write() of non-existent string values
  • fixed datetime::parse() crash when NULL parameters are passed in
  • added commandline::toDictionary()
  • added parameterstring::getDictionary()
  • fixed potential null dereference in jsondom::write()
  • fixed potential null dereference in templateengine::replaceVariable()
  • added error reporting to templateengine class
  • fixed potentially uninitialized optimum block size in sax class
  • optimized domnode::insertNode() for empty, append, and prepend cases
  • added quoted-printable encodings to charstring
  • added lots of row/column manipulation methods to csvdom class
  • tls::setProtocolVersion() supports "v" format: SSLv3, TLSv1.3, etc.
  • applied patch from Igor to fix configure.vbs VC++ version detection for non-US versions

Tuesday, September 15, 2020

Rudiments 1.3.1 Release Announcement

Version 1.3.1 of Rudiments, the C++ class library for developing systems and applications, is now available.

This patch release fixes a bug in the rpm spec file and a missing library dependency in the link command for librudiments-apache.

Tuesday, August 25, 2020

SQL Relay 1.8.0 Release Announcement

Version 1.8.0 of SQL Relay, the powerful connection pool, load balancer, query router, and database proxy, is now available.

This release mainly lays the groundwork for some future features, including a generic import/export framework. Some notable progress was also made on the JDBC driver, though it's still not finished. The most significant (finshed) new feature is an aes128 password encryption module.

There are some bugfixes as well. A long-standing issue with postgresql that could cause results from multiple open cursors to get confused has been resolved. A subtle error that could cause counting of bind variables on the client-side to hang has been fixed. A long-standing, but apparently obscure, issue that could cause tables from other MySQL schemas to be included in a "show tables" command has been fixed. As well as various other issues.

Full ChangeLog follows:

  • unattended tests
  • added sqlrresultsetdomnode class to c++ client API
  • fixed datedelimiters parameter
  • added support for SQLParamOptions with SQLUINTEGER arguments
  • sqlr-import detects uppercase .CSV suffix now
  • fixed a csv number-detection but in sqlr-import
  • fixed a delete[] of a const in sqlr-import
  • it's possible to specify a commitcount of 0 with sqlr-import now
  • moved sqlrimportxml/csv classes into libsqlrclient
  • moved sqlrexportxml/csv classes into libsqlrclient
  • csv import/export is consistent now
  • added some event methods to sqlrexport
  • migrated parsedatetime functions to rudiments datetime class
  • different postgresql cursors use different stmtNames now
  • sqlrimportcsv can create a primary key that's not in the CSV now
  • sqlrexportcsv quotes 12+ digit numbers now
  • fixed subtle, count-related issues when validating bind variables on the client side, that could cause a hang
  • added an aes128 pwdenc module
  • applied a patch to fix a crash in the debug logger (missing "%s")
  • added a tweak to getsitearchdir.rb to fix incorrect lib/lib64 reporting on some centos x64 systems
  • fixed mysql getColumnList to distinquish proper db/schema

Rudiments 1.3.0 Release Announcement

Version 1.3.0 of Rudiments, the C++ class library for developing systems and applications, is now available.

This release mainly featured integration of code from other projects. The remnants of the old firstworks project "stencil" have been merged in, as well as some MVC base classes from other projects. Some date-time parsing code from SQL Relay has been pushed down into the datetime class.

There are some new features as well - most notably an encryption framework and aes128 class. There are also sax/dom parsers for CSV, ini, and java-style properties files as well, similar to the xml/json sax/dom classes.

The logger classes have been refactored a bit, in back-incompatible ways. Thus the minor version bump.

Full ChangeLog follows:

  • unattended tests
  • added support for escaping single/double-quotes to templateengine
  • migrated in clasess from stencil project
  • added librudiments-apache
  • added \r\n support when parsing CSVs
  • integrated MVC base classes from other projects
  • added inisax/inidom and propsax/propdom classes
  • added cronschedule class
  • added logger start/end methods
  • logger string-write works like printf now
  • logger indent uses uint32_t now
  • removed some unused logger::write() methods
  • added a log level to the logger class
  • process::spawn()'s forked child exits if exec() fails now
  • charstring::replace() methods are null-safe now
  • migrated datetime::parse() and datetime::formatAs() from sqlrelay
  • csvsax accepts empty (or all whitespace) files now
  • logger::write() is null-safe now
  • base64encode is whitespace-safe now
  • added support for 5-part dates and day-month-year 4-part dates
  • added datetime::getWeekOfYear
  • added file::extension
  • added directory::createTemporaryDirectory
  • added directory::removeTree
  • added encryption interface
  • added aes128 encryption
  • added charstring::startsWith/endsWith

Monday, January 6, 2020

SQL Relay 1.7.0 Release Announcement

Version 1.7.0 of SQL Relay, the powerful connection pool, load balancer, query router, and database proxy, is now available.

This release adds 2 significant features: support for the PostgreSQL client-server protocol, and a "replay" module to help automatically recover from deadlocks and lock-timeouts, but also has the usual assortment of minor bugfixes and internal changes.



PostgreSQL Client-Server Protocol

SQL Relay has supported the MySQL client-server protocol for several minor releases, enabling MySQL applications to take advantage of SQL Relay's features by aiming SQL Relay at the database(s) and aiming the application at SQL Relay. It has been a server-only solution requiring no modification of the client application or even any installation of software on the client system.

Release 1.7.0 features similar support for the PostgreSQL client-server protocol. PostgreSQL applications can now take advantage of SQL Relay's features by aiming SQL Relay at the database(s) and aiming the application at SQL Relay. It is also a server-only solution requiring no modification of the client application or even any installation of software on the client system.

See the SQL Relay Configuration Guide for configuration details.


Replay Module

"How do I handle database deadlocks!?"

The answer is usually: figure out which queries are deadlocking and rewrite them to be less likely to deadlock. When that fails, the prescribed solution is to rewrite your application to detect the deadlock and either rerun the previous query (eg. with Oracle) or rerun all queries in the current transaction (eg. with MySQL).

While rewriting queries to be less likely to deadlock might be possible in some cases, rewriting applications to record queries and be able to replay entire transactions is unrealistic. It is especially unrealistic if you consider the trouble involved with doing an insert into a table with an auto-increment column, followed by updates that use the generated id.

But, while it might be unrealistic for applications, it's not terribly unrealistic for a database proxy like SQL Relay.

This release of SQL Relay provides a "replay" module, which can be configured to record and replay either the previous query, or previous transactions-worth of queries upon detecting a deadlock, lock timeout, or other condition. It even correctly rewrites the inserts that it records to handle auto-increment columns.

See the SQL Relay Configuration Guide for configuration details.



Full ChangeLog follows:

  • added postgresql protocol module
  • updated postgresql connection module to get column info pre-execute
  • fixed postgresql connection module type oid bug
  • added tag filter/moduledata
  • added moduledata(s)::closeResultSet()/endTransaction()/endSession()
  • mysql protocol returns empty lobs correctly now (not as nulls)
  • configure replaces -lfbclient with -lgds on freebsd/firebird-2.0.3
  • fixed a bug that could cause sqlr-stop to try to kill pid 0
  • fixed unixodbc detection on solaris 11.4
  • added configure test for PQdescribePrepared
  • test improvements
  • documentation improvements
  • split sqlrelay-crash directive into its own module
  • deprecated drop-in replacement libraries in favor of protocol support
  • fixed various mysql 4.x bugs
  • sqlr-status creates statistics on heap now instead of stack, to work on platforms with a small default ulimit stack
  • mysql stored procedure test is bypassed for older mysql
  • tls test is bypassed for older openssl
  • added NULL handoff socket workaround
  • improved shutdown/crash handlers for sqlr-listener/connection
  • fixed hang when more-than-one address was specified in the instance:addresses attribute
  • *_null used instead of *_unset on PHP 7.4

Rudiments 1.2.2 Release Announcement

Version 1.2.2 of Rudiments, the C++ class library for developing systems and applications, is now available.

This is a minor bug-fix release. ChangeLog follows:

  • fixed another long-standing charstring::httpEscape bug
  • -Wno-deprecated-declarations is now included if possible
  • added configure tests for RB_HALT/AUTOBOOT (enums on solaris 11.4)
  • certificate tests use sha1 if sha256 is unavailable
  • filedescriptor::pvt->_lstnr is initialzed to NULL in clone operation now
  • listener::listen() safely handles non pollin/out events now
  • removed waitForChildren() from shutdown/crash handlers
  • sigsuspend() fails if errno!=EINTR now instead of whether it returns -1
  • filtered out -Wl,-Bsymbolic-functions -Wl,-z,relro from krb5-config