Monday, December 31, 2012

SQL Relay - 0.49 is out

SQL Relay 0.49 is now available.

This release features the addition of extension modules for password encryption and logging. Logging was actually added in the previous release but it has been expanded and documented in this release.

See Password Encryption Modules and Logger Modules for more information.

The build process has been improved as well.

Lots of code was reorganized to be easier to maintain and to compile faster. For many years the configure script would erroneously include "-pthread" in the compile commands on platforms that don't support it. That has been fixed.

-Werror has been added to default build for most components as well and various issues revealed by it have been fixed.

The windows make.bat script has been refactored too and now supports both regular and CLR builds.

The client-server protocol has been refactored to improve performance. Two client-server round trips have been removed. One after authentication and another after the listener-connection handoff. All client-server commands can run in a single round trip now.

The handoff="reconnect" parameter has been replaced with handoff="proxy". In the past, if handoff="reconnect" then the client was told to disconnect from the listener and reconnect to an available connection daemon. Now, if handoff="pass" is unsupported, the listener just proxies the client, ferrying data back and forth between it and the server. This causes the listener/connection relationship to be completely transparent to the client and removes a client-server round-trip.

An very primitive ODBC driver has long been included in the source tree. It has been improved significantly in this release and can now be used with the isql program included with unixODBC and iODBC and with the henplus JDBC client using the JDBC-ODBC bridge. The driver still lacks many features, hasn't been tested much beyond those clients, and doesn't work on Windows without manually adding registry entries, but it is usable and should eventually make it possible to use SQL Relay with a much wider range of applications.

A few bugs were fixed as well including a bug that could cause problems when fetching from an output bind cursor under a very specific set of circumstances and a bug that could cause a hang if the database login failed.

Client API methods for getting the database's host name and IP address have been added as well.

This version of SQL Relay requires Rudiments - 0.40. Both are available from the SQL Relay web site.

Rudiments - 0.40 is out

Rudiments 0.40 is now available.

This release fixes several obscure bugs and problems with the build process.

For many years the configure script would erroneously include "-pthread" in the compile commands on platforms that don't support it. That has been fixed.

-Werror has been added to default build as well and various issues revealed by it have been fixed.

The windows make.bat script has been refactored too and now supports both regular and CLR builds.

The following bugs have been fixed:

  • fixed hostentry::getAddressString() for numbers greater than 127
  • fixed bugs that could lead to a crash when using the hostentry class with NULL hostnames
  • fixed charstring::safeCopy to copy the NULL terminator
  • made charstring::copy NULL-safe
  • made crypt class salt NULL-safe
  • reads that error out with EAGAIN are treated as successful reads of 0 bytes now

It appears that some platforms (OpenBSD 4.9 for i386 at least) create sockets in non-blocking mode. This is not what a developer would generally expect, so some changes have been made to standardize this behavior.

  • all sockets are manually set to blocking mode after creation now
  • sockets created by accept() are set to the blocking/non-blocking mode of the socket that was accepted on

Monday, December 17, 2012

SQL Relay - 0.48.1 is out

SQL Relay version 0.48.1 has just been released.

This release fixes an obscure bug that can occur with output bind cursors.

Basically if a server-side cursor is used with a query that returns a bind variable, and then later that same cursor ends up being used AS an output bind cursor, the bind variables from the previous use of that cursor end up getting sent back to the client and this wreaks all kinds of havoc.

This bug has been fixed.

If your app doesn't use output bind cursors then there's no need to update.

Saturday, December 8, 2012

SQL Relay - 0.48 is out

SQL Relay version 0.48 is now available.

This release features some major internal reorganization of the server-side software and integration of a bunch of contributed code.

Outwardly, not much has changed. The most noticeable change is that the sqlr-connection-XXX programs have been replaced with a single sqlr-connection program which now loads a plugin for whichever database it needs to connect to. So, if you have monitoring programs that look for that process, you may need to update them.

The next-most noticeable change is the addition of a stmtcachesize parameter to the connectstring when configuring an instance of SQL Relay to talk to Oracle. Setting this parameter to a value other than 0 enables use of Oracle's Statement Cache which can improve performance significantly. See Configuring SQL Relay for more info on this parameter and Google "Oracle Statement Cache" for more info on that.

Two changes that should improve performance somewhat have been made.

There were cases where the client would tell the server to abort the result set, then wait for a response, unnecessarily, incurring the cost of an additional client-server round-trip. It no longer does this.

The code for talking to Oracle used to re-prepare the query before each execution, if the bind variables had been modified. This was done to work around an issue that could come up when using OCI 8.0 or when running against 8.0 or 8i databases. Oracle has long resolved the issue though, and now the re-prepare is only done in those specific cases.

Other updates and fixes include:

  • Integrated patches from Neowiz for:
    • handling for oracle errors ora-01033, ora-02067 and ora-04068
    • bind validation when using the statement cache
    • optionally rejecting oracle queries with duplicate bind variables
    • sqlrconnecton::setClientInfo/getClientInfo
    • query logging
    • separate authentication and response timeouts on the client-side
    • environment variables for setting timeouts
    • sqlrelay-level errors for exceeding various bounds
    • improved statistics gathering
  • created a query logging framework
  • implemented the current slow query log as a plugin
  • implemented the neowiz query log format as a plugin
  • created a custom query framework
  • implemented the neowiz statistics gathering commands as custom queries
  • added a test program for triggers, translations and other extensions and obscure features
  • fixed several bugs in the informixtooracledates translation
  • added a droplocalizedtemptables trigger
  • added support for "global temporary" to temptableslocalize translation
  • removed oracletemptablespreserverowsbydefault translation - temptableslocalize is much more effective
  • fixed a bug that caused a "no server-side cursors" error to occur when a new session is started if cursors="0" in sqlrelay.conf

Rudiments - 0.39 is out

Rudiments Version 0.39 is now available.

This release features a few bug fixes and a few new methods that I'm not sure how I ever managed to live without:

Bug Fixes:

  • filedescriptor::getPeerAddress returns NULL now for non-inet sockets
  • regularexpression::getSubstring* methods return const char *'s now
  • calling xmldomnode::deleteAttribute() on a non-existent attribute name no longer crashes
  • fixed a long standing memory leak in dictionary::clear()

New Features:

  • added charstring::safeCopy methods
  • added xmldomnode::getTree and xmldomnode::print methods