Prepare and describe the Ingres statement in one line of embedded sql.
Added extra check when rowcount == -1 to see if there is were really any errors
because some queries give a negative rowcount when they are executed ok (e.g.
DECLARE GLOBAL TEMPORARY TABLE for instance.
Implement a different default locking mode for our queries initialized for each new
session opened. Not quite sure if this is the best option but it looks to be better
then the other defaults.
We need to fool the Ingres code a bit more to think we are in a transaction when doing an
insert followed by the retrieval of the currval of the id inserted. So we save the current
transaction status set it to true do all our work commit it if we are really not in a
transaction and restore the actual transaction status. Not the nicest but it should work.
Make sql_insert_id a atomic function which executes the insert query and when that succeeds
retrieves the id the database used for storing the inserted record. Some databases want
this to be atomic (e.g. without a COMMIT in between.) Coding wise this is also much cleaner.
Lets call it COMMIT and not END as that seems to be the counterpart of BEGIN for transactions.
Updated Ingres lock queries to only start a transaction as the current SQL is not valid Ingres SQL.
Add support for transactions. Normal operations for Ingres is to make things one big transaction.
The old code never commits anything and as such you loose all state on exit of the dird.
Now we always commit our work unless we are in a transaction.
First attempt at making things multi-threaded and make it possible to
have multiple connections to the database without having the dreaded
ERR=E_LQ002E The 'execute immediate' query has been issued outside of a DBMS session.
This compiles but seems to give some problems so into the debugger it is.
Use -lq.1 -lcompat.1 as shared libraries instead of linking with -lingres which is a static library.
Also need to change generated code of esqlcc a bit to get things to link with the IIsqlca function.
Creating a database as an other user and giving grants doesn't seem to work for Ingres.
Strange so for now create everything using the -u${db_user} option. This is something that
needs to be investigated as it should be possible to have an different owner of the database.
Do all Ingres operations as the user invoking the script just as for all
the other databases. The grant script will make sure the db_user will have
the proper access rights to the database tables and sequences.
Add header to both myingres.sc and myingres.sh
Lets include cats.h as we use the B_DB struct now in myingres.c
Fixed missing argument to INGgetDescriptor
Regenerate myingres.c and myingres.h
Added limit_filter which rewrites queries which use the LIMIT functions into
something Ingres can understand. Removed all static functions from the myingres.sh
file as they are no longer an exported interface (we can always put that back when
we have the need to export more functions). Some other rewrites of the code
to make it somewhat cleaner.
Name all function arguments query so we can use stmt as our internal variable everywhere.
Make some functions static which are not referenced anywhere else so we keep our namespace clean.
Change Ingres drop script so we can run any form of regression and a drop really drops the content of the database
so we can run make_ingres_tables again.
Lets not generate the ingres code automatically when the .sc or .sh files changes as it seems
these files get outdated on some systems and then this rule kicks in on systems that don't have
the esqlcc ingres compiler installed.
Dirk H Bartley [Fri, 5 Mar 2010 04:26:41 +0000 (23:26 -0500)]
This is a 1/2 fix of the issue. It allows for the sorting of the two non graphic columns, but still does not allow for sorting the graphic columns. The issue is with last. By setting the sort value, you are setting the value on the last. To experiment with what I mean, use the set background that I have commented out in this commit.