Wednesday, September 25, 2013

libfirstworks 0.2 is out

Quick on the heels of the most recent Rudiments and SQL Relay releases comes the 0.2 release of libfirstworks.  Basically since I added support for 64-bit builds on Windows to Rudiments and SQL Relay, I also had to update the build script in libfirstworks.  That's the only change.

SQL Relay - 0.52 is out

Yes.  SQL Relay 0.52 is now available for general consumption.

Usually when I make a release of SQL Relay there is at least one significant new features.  This release though, is mainly just for compatibility with all of the changes I recently made to Rudiments.  A side effect of those changes is platform compatibility, so arguably that's a new feature, but most of the platforms that it now runs on are old or obscure in one way or another.  There were some recent fixes for ARM platforms which are actually growing in popularity these days, but the fixes for SCO OSR6, NetBSD Vax or Linux libc4 aren't likely to get too many peoples' attention.

It is kind of neat though, to see screenshots of an Oracle 12c database being accessed from platforms that Oracle has probably never remotely considered supporting.

http://sqlrelay.sourceforge.net/sqlrelay/features/proxying.html

There were a few non-platform-compatibility-related updates to this release.  sqlr-export supports CSV output now.  I had a need for that so I added code for it.  sqlrsh now reports the correct version.  It had been stuck at 0.22 probably since release 0.22.  sqlrsh also supports multiple queries on the command line.  You can now do:

sqlrsh -id myinstance -command "select * from table1; select * from table2"

I'd long thought you could but apparently hadn't written it that way.

The rest of the changes are either bug fixes, platform-compatibility updates or changes under the hood.  If the version you're using is satisfying then there's probably no pressing need to upgrade.

Full ChangeLog:

  • sqlrsh has long reported the wrong version, fixed that
  • added csv support to sqlr-export and a -format xml|csv option
  • replaced snprintf calls with charstring::printf calls
  • added a test for sys/vnode.h to work around an issue with perl on SCO OSR6
  • added workarounds for old versions of sqlite without sqlite3_malloc and sqlite3_free with char * argument
  • fixed error with sqlserver where "describe " would return columns in alphabetical order rather than the order they are in the table
  • the code freetds uses to get column names from MS SQL Server works for temp tables now
  • added informix->mssqlserver translation for select into queries
  • added translation to convert ||'s to concat() calls or +'s
  • added a long-missing "delete clientsock" to sqlrlistener that could cause a crash after enough time
  • various documentation tweaks
  • added handling for "select into" queries to temptableslocalize/sybaseize translations
  • fixed various crashes that could occur when a query filter was used
  • updated the query routing and filtering doc
  • sqlrsh supports multiple commands on a single line or on the command-line now
  • exit/quit in a sqlrsh script aborts the script now
  • improved date/time parsing for translations and result-set conversions
  • fixed lots of cases where const char *'s were being deleted
  • added 64-bit build support for windows
  • combined sqlrclient files for faster compiling
  • converted \t to actual tab in regular expressions for posix-compatibility

Rudiments - 0.43 is out

As recently promised, Rudiments 0.43 is out.

This release of rudiments features some significant changes under the hood and a few visible ones.  Most of the changes center around fixing compatibility issues with older platforms and compilers.  Some are in the spirit of general code cleanup and decluttering.  Some were to make the code simpler and smaller.

The most earth shattering changes were the consolidation of the daemonprocess class into the process class, the renaming of the mutex class to threadmutex and the renaming of *clientsocket and *serversocket to *socketclient and *socketserver.  The daemonprocess class has long been quirky and needed an overhaul.  The mutex rename was to avoid namespace collisions and the socket class renames were to comply with a general client/server class naming scheme I've been meaning to do for years.

Some method names were changed to avoid namespace collisions as well.  There are surprisingly many platforms that use macros (#defines) to alias one function to another and it doesn't matter if you use C++ namespaces or not, on those platforms, you'll get collisions.  Terrible!

Speaking of namespaces, I'd long had goofy macros to use a rudiments namespace if the compiler supported them and not use them if the compiler didn't.  After fixing all the other name-related collisions, I eventually realized that the rudiments namespace wasn't necessary at all and removed it altogether.  This also helped with older platform compatibility.

Rudiments aims for compatibility.  Apps built on it might not be so compatible but Rudiments itself ought to be.  At least that's one of my goals for it.

Other semi-earth-shattering changes include the addition of printf-like methods in the charstring, filedescriptor and variablebuffer classes and inclusion of the proper header files high in the chain to make sure NULL is defined (correctly even, on older platforms).  Another goal that I've had for a long time is to be able to write programs that don't include any system header files.  Everything I need should be wrapped in Rudiments and platform-agnostic.  Ideally.  Well, I'm a lot closer.  I don't have to include stddef.h for NULL or stdio.h for any of the printf functions.  Yeah, I know it's C++ and by rights I ought to be using cout but that's a-whole-nother story.  At any rate, most of my programs, including most of SQL Relay, don't need to include any system headers.  Not all the way there yet, but getting much closer.

The rest of the changes are obscure, platform-specific fixes or workarounds.  You ought to see the hack I put in for platforms that don't provide a vsnprintf.  Terrible.  Definitely going to rewrite that someday.

Full ChangeLog:

  • added a workaround for platforms that don't support blocking/non-blocking modes for sockets
  • added *printf wrappers to charstring, filedescriptor and stringbuffer classes
  • added test/include for sys/signal.h for platforms that need it
  • added support for uadmin with int vs. char 3rd argument
  • added snooze and retry if fork fails with EAGAIN
  • moved safePrint and printBits methods into the filedescriptor class
  • added a test and handling for fsetxattr with non-const third parameter
  • "hid openssl" by abstracting SSL types and moving includes into .cpp files
  • fixed erroneous end-of-buffer address when creating a variablebufferis with initial contents
  • added option to disable string cache in xmldom class
  • added "data" member to xmldomnode class for attaching app-specific data
  • improved codetree speed
  • fixed a "char" on ARM issue
  • fixed a longstanding issue where variablebuffers could get extended too much sometimes
  • renamed system class to sys to avoid collisions
  • added -Werror to configure-time tests for older systems where g++ doesn't return an error for an implicitly defined function
  • removed the rudiments namespace for compatibility with older compilers
  • replaced a bunch of unsigned long and long with [u]int(32|64)_t
  • removed the timezonefile class
  • renamed mutex class to threadmutex to avoid collisions
  • wrapped setsid() function
  • refactored and simplified dictionary and linkedlist classes
  • if thread detection fails it just disables threads now rather than erroring out
  • thread support is displayed in configure summary
  • refactored xmldomnnode::print() methods, added one to write to a filedescriptor
  • renamed memorypool methods malloc, calloc and free to allocate, allocateAndClear and deallocate to avoid collisions on platforms that define malloc and calloc using macros
  • fixed lots of cases where const char *'s were being deleted
  • renamed *serversocket to *socketserver
  • renamed *clientsocket to *socketclient
  • added 64-bit build support for Windows
  • refactored daemonprocess class and moved its methods into the process class

Tuesday, September 24, 2013

Coming Soon...

The next release of SQL Relay is just about wrapped up.  There is testing and documentation left to do but not much of either really.

So what's going to be in this release?

No major visible changes but quite a few under the hood.  The Rudiments library upon which SQL Relay is based has had a major overhaul and SQL Relay has benefited somewhat from this in the platform compatibility department.  I've long had a goal of not having to include any native header files or call any native functions.  Everything should be wrapped and platform compatibility should be purely a function of porting Rudiments.  I'm really close to that now.  I think SQL Relay calls ceil() and popen() and one or two other native functions but that's about it.  Probably one or two more releases and they'll be out of there too.

Speaking of platform compatibility, the next release will support a 64-bit build on Windows.  It will also run on a long list of non-x86 NetBSD, OpenBSD and Debian GNU/Linux platforms, a couple of old Redhat platforms and SCO OpenServer 6.0.

Why?

I'm a bit of a retrocomputing nerd.  It's fun to run new systems on old (emulated) hardware and old systems on modern (emulated) hardware.  It's also fun to try to get my software running on those platforms.

There are a few legitimate benefits.  The first is exposure to lots of odd compilers.  I recently found all kinds of cases where I was deleting consts and returning values from functions that were supposed to return void just because an older compiler complained about those things.  There were a few cases where a comparison was always true because the variable on the left side was unsigned.  The cleaner the code is, the more likely the code is to compile on a platform that I don't have access to.

There are also platforms that are gaining popularity and it's good to support a version of them.  ARM chips are all over the place these days.  I don't have a Raspberry PI but I can run Debian-armhf in qemu.

I'm going to start chronicling  my adventures in emulation.  Someone might find them useful.

There are a few practical changes in this upcoming release.  sqlr-export will support CSV output, in case you need that.  I did.  sqlrsh's -command option will support running multiple queries.  It should have in the past, but apparently it didn't.  It will now.  A lot of the docs have been updated with little pictures and better examples.  Some of that should already be on the web actually.

Coming soon!