mirror of
https://github.com/gnustep/libs-sqlclient.git
synced 2025-04-20 12:50:59 +00:00
Compare commits
262 commits
sqlclient-
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
db1ff663f6 | ||
|
9f90bdc755 | ||
|
1ec70f9323 | ||
|
f84f1f0487 | ||
|
78a66c1a75 | ||
|
2c9070cfd0 | ||
|
936410c7e6 | ||
|
848c1fa4ac | ||
|
aa3262a521 | ||
|
527735d95a | ||
|
c307374590 | ||
|
68678b864e | ||
|
3e35662803 | ||
|
16d56c5395 | ||
|
218578aa95 | ||
|
14dcbf5c7f | ||
|
465bcaa70d | ||
|
346f114fc6 | ||
|
36fe235dba | ||
|
4f622fb975 | ||
|
34aec94427 | ||
|
a8f405c563 | ||
|
267987d01c | ||
|
4c2a293640 | ||
|
ce149e7ee3 | ||
|
8335ce336a | ||
|
a496d0dd8e | ||
|
869cfda7d1 | ||
|
7a142e57c4 | ||
|
d7a3c06c8b | ||
|
cd7daff661 | ||
|
76fd64f7c3 | ||
|
76e72d3c0f | ||
|
76ea8d486e | ||
|
da1b900b92 | ||
|
dc7955472e | ||
|
1b44a32f31 | ||
|
7851639677 | ||
|
535914366a | ||
|
1a0d338a78 | ||
|
ca2f44a323 | ||
|
c3557e74be | ||
|
a9588e8073 | ||
|
fea9797591 | ||
|
94f644590a | ||
|
bb47241044 | ||
|
ec590a5253 | ||
|
5d099c8557 | ||
|
46cf998afc | ||
|
085c36c340 | ||
|
4fdcad1440 | ||
|
6c64e4cb9d | ||
|
0fa39b65e0 | ||
|
d6e4ccdb3e | ||
|
0bb38c5def | ||
|
97216727ff | ||
|
7b7d207f45 | ||
|
9ba41b6d5b | ||
|
b176015f28 | ||
|
048b1a76f8 | ||
|
92e2b06efc | ||
|
cfae0876cc | ||
|
e0fdb1ce9a | ||
|
debbd3c763 | ||
|
e8eeb75eca | ||
|
b9a45a2fc4 | ||
|
8302102928 | ||
|
1138287eb0 | ||
|
d82d973983 | ||
|
5201c42e01 | ||
|
d52ddbd2f3 | ||
|
aeb14dc493 | ||
|
43bf08a70f | ||
|
f570253b40 | ||
|
cdf753373f | ||
|
9c2fcd8816 | ||
|
a35a811727 | ||
|
14e6d5a928 | ||
|
9e68a4d102 | ||
|
1cc4f410e7 | ||
|
2900203c67 | ||
|
e23f3b66a5 | ||
|
2be5efdd46 | ||
|
d33b4b5114 | ||
|
174af22f97 | ||
|
d3a5c50890 | ||
|
9e722821c8 | ||
|
1dcbdc7226 | ||
|
8b5db03110 | ||
|
24cb65059f | ||
|
48c8018343 | ||
|
09526be014 | ||
|
017a6165ee | ||
|
396dcb0355 | ||
|
b4dd6312fe | ||
|
6102dddbcc | ||
|
c48ce0e78e | ||
|
086c59480d | ||
|
9c86e53072 | ||
|
9ba044c0ea | ||
|
85cc5451be | ||
|
2dc662177e | ||
|
e98ab6d200 | ||
|
48a6cc9419 | ||
|
bee12ae4ee | ||
|
5727f252d5 | ||
|
d75ff81bba | ||
|
b6cd1305b3 | ||
|
e7dc1e2dc2 | ||
|
549ba3d96a | ||
|
9174ee9ad7 | ||
|
0c3fd3449d | ||
|
013c068a52 | ||
|
311884bb4a | ||
|
9c2b980170 | ||
|
db5ac54036 | ||
|
c533e6e14c | ||
|
828c5e8ae5 | ||
|
c546062424 | ||
|
eb58bd0d78 | ||
|
8095873ae4 | ||
|
23d6fea4b1 | ||
|
e284891e92 | ||
|
8f6ed04196 | ||
|
db4f1f32cb | ||
|
823f329413 | ||
|
fe7d8e2d9e | ||
|
552d190f31 | ||
|
caebc38b3d | ||
|
7fa072df70 | ||
|
70be58d959 | ||
|
83d4873389 | ||
|
e5d3ea6f6b | ||
|
1ce3253a97 | ||
|
efd9f26947 | ||
|
8e12a18ec2 | ||
|
52bedc89b3 | ||
|
eac59b0d77 | ||
|
e1b855d2f2 | ||
|
a272f2cffa | ||
|
efa86d441e | ||
|
8735bd4ab8 | ||
|
5576e55028 | ||
|
3bb76c9230 | ||
|
88ece98e6c | ||
|
316dca8d3f | ||
|
7ab46148d9 | ||
|
905aa5c4a3 | ||
|
677a8e69d8 | ||
|
6f69ad8b20 | ||
|
88d8226d7b | ||
|
19a0effa92 | ||
|
a436122915 | ||
|
637653cd0c | ||
|
eecb706229 | ||
|
03eca5e288 | ||
|
ea01e0cb85 | ||
|
3fefb489fe | ||
|
50a8a2ca59 | ||
|
182fa71ff3 | ||
|
bd4f1bcf96 | ||
|
42839ca9f1 | ||
|
c391097b05 | ||
|
3c0f8a4840 | ||
|
14c31894a0 | ||
|
fb23a2d5fd | ||
|
39c084eb1c | ||
|
8939b86ba4 | ||
|
37447b55b9 | ||
|
896f6df0d6 | ||
|
4f374e0150 | ||
|
36533d3527 | ||
|
5a4d4f3fce | ||
|
88796e18bc | ||
|
3bde5e99a8 | ||
|
55e33d0f29 | ||
|
023cba96ea | ||
|
917150afd9 | ||
|
08376ad7b9 | ||
|
b949cbd9c8 | ||
|
ad45131796 | ||
|
a074b69395 | ||
|
097c71a9c9 | ||
|
2e27c77f1a | ||
|
53a51aa60a | ||
|
eba637c00e | ||
|
08808d55b8 | ||
|
e472d45d38 | ||
|
a2f7d330b9 | ||
|
97982d2d72 | ||
|
25a0a1220e | ||
|
11bf21a930 | ||
|
85d8389ba0 | ||
|
c47c323a7f | ||
|
9282a5134d | ||
|
6eee4f014a | ||
|
35ee61bad9 | ||
|
a5ce6c870e | ||
|
855171a26f | ||
|
23870a60a2 | ||
|
1fd4b0abe9 | ||
|
bffc581dc0 | ||
|
754b6547a9 | ||
|
b10c6c592d | ||
|
28f18d26a4 | ||
|
d70286f339 | ||
|
19a68d1abd | ||
|
fe1d368d66 | ||
|
17ce0ccf78 | ||
|
dcbcc92993 | ||
|
3d4c775f41 | ||
|
0836cc15ad | ||
|
950252a37f | ||
|
63ff9b2bfd | ||
|
a35f4cee92 | ||
|
f312d036d0 | ||
|
2db59e861c | ||
|
78764f0ce1 | ||
|
bd63d63d0f | ||
|
7aafa6f372 | ||
|
391b543e6c | ||
|
069b1b1e95 | ||
|
9d13495a8a | ||
|
3bdf2686b5 | ||
|
edc1a8310a | ||
|
19b900d172 | ||
|
7f64902d1f | ||
|
e3429d9079 | ||
|
6ae8df20b7 | ||
|
c035f9cf39 | ||
|
0f06c9b7fc | ||
|
c6fc158f34 | ||
|
e03ba02d29 | ||
|
9d1157b9c0 | ||
|
832e22bc45 | ||
|
f065c65fab | ||
|
e062fabf15 | ||
|
b1ccabeb7e | ||
|
90476078d5 | ||
|
0f84c574d5 | ||
|
3a502f17bf | ||
|
6ac6b7033f | ||
|
5f54b5fad3 | ||
|
39130494be | ||
|
e54378f320 | ||
|
698b359608 | ||
|
aa159b1455 | ||
|
3c56d1fa82 | ||
|
c46336e96c | ||
|
2c37086861 | ||
|
92b29b8ed0 | ||
|
c8c192c738 | ||
|
10478732e6 | ||
|
1a68bf02c2 | ||
|
ab9010db3b | ||
|
fd50180862 | ||
|
613de3c660 | ||
|
38bf6cbe72 | ||
|
3c49c76afe | ||
|
ac0e231c9a | ||
|
2c40163ef2 | ||
|
7f19e9e996 |
18 changed files with 9822 additions and 9219 deletions
610
ChangeLog
610
ChangeLog
|
@ -1,3 +1,613 @@
|
|||
2024-01-26 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: Fix error in parsing milliseconds in timestamp.
|
||||
|
||||
2023-11-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h: New instance variables for timing lock waits.
|
||||
* SQLClient.m: Record duration of waits for locks.
|
||||
* SQLClientPool.m: Tell client when pool was locked before query.
|
||||
Changes so that, the time spent waiting to obtain a lock to get a
|
||||
connection from a pool or to be able to execute a query on a
|
||||
connection used by another thread is recorded. When query duration
|
||||
logging is performed, report lock delays of over a millisecond.
|
||||
If debug is on or if the query logging duration is zero, then any
|
||||
lock delay (no matter how small) is reported.
|
||||
|
||||
2023-08-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: Implement support for connect_timeoout= option to
|
||||
control how long we allow for a connection attempt to a host.
|
||||
|
||||
2023-01-13 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* GNUmakefile: bumped version to 1.9.0.
|
||||
|
||||
2022-06-08 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h: Declare new (-committed) method.
|
||||
* SQLClient.m:
|
||||
* SQLClientPool.m:
|
||||
Implement -committed to return the count of transactions committed by
|
||||
a client or pool. Update -description to report that too.
|
||||
|
||||
2022-06-08 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h: Declare new (-setOptions:) method.
|
||||
* SQLClient.m: Implement stub for new method and add code to call it
|
||||
to register any optional configuration, passing the configuration
|
||||
dictionary as a parameter.
|
||||
* Postgres.m: Implement new method to store configuration information
|
||||
and use sslmode option if (and only if) it is set to require an
|
||||
encrypted connection.
|
||||
|
||||
2020-09-01 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* SQLClient.m (release): Reinstate fix to avoid deadlock while
|
||||
purging pool.
|
||||
|
||||
2020-04-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: Change notification code to de-duplicate notifications
|
||||
if/when postgres sends many copies of the same notification at the
|
||||
same time. Also change the code to queue notifications in the thread
|
||||
that received them (as documented) and only queue them in the main
|
||||
thread if the receiving thread does not have an active run loop.
|
||||
|
||||
2020-04-13 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* MySQL.m (backendQuery:recordType:listType:):
|
||||
Change argument types to match those of the overridden base class
|
||||
implementation to make the override work with the GNUstep
|
||||
Objective-C runtime.
|
||||
|
||||
2020-04-08 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* SQLClient.m (clientWithConfiguration:name:):
|
||||
* SQLClient.m (initWithConfiguration:name:pool:):
|
||||
Eventually reconfigure a client connection that gets reused.
|
||||
|
||||
2020-03-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: Don't attempt to establish connection before query or
|
||||
execute (the superclass should do it).
|
||||
* SQLClient.m: Ensure connection is established before calling backend
|
||||
methods where possible. Add timing to establishment of connection.
|
||||
|
||||
2020-02-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: Make the code aware of the tiny string class used by
|
||||
the gnustep base library. Treat tiny strings as literal strings
|
||||
because, unfortunately, we can't tell if they were created at
|
||||
compile time or at run time.
|
||||
|
||||
2020-02-25 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: Changes to -release to avoid deadlock purging pool.
|
||||
|
||||
2020-02-14 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: Re-implement SQLString as a true subclass rather than
|
||||
using trick depending on internals of gnustep-base (which change with
|
||||
the ObjC-2.0 ABI and would break).
|
||||
|
||||
2020-02-11 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h: Remove redundant -prepareQuery: method.
|
||||
* SQLClient.m: Remove redundant -prepareQuery: method and redundant
|
||||
code from query building methods.
|
||||
* SQLClientPool.m: Remove redundant -prepareQuery: method and redundant
|
||||
code from query building methods.
|
||||
|
||||
2020-01-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: Fix notification posting to refrain from coalescing.
|
||||
|
||||
2019-12-11 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Postgres.m: Hide database connection password from debug logs.
|
||||
|
||||
2019-08-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClientPool.m: Fix error specifying query string in exceptions
|
||||
|
||||
2019-07-29 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: Improve logging of cache queries to indicate that
|
||||
the query was from the cache and whether it was a it or a miss.
|
||||
|
||||
2019-07-14 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* SQLClient.h
|
||||
* SQLClientPool.m:
|
||||
Hide definition of SQLClientPoolItem from the public interface,
|
||||
as it is incompatible with automatic reference counting.
|
||||
|
||||
2019-05-03 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* SQLClient.m:
|
||||
Rewrite release method to work with version 1.9 of the GNUstep
|
||||
Objective-C runtime system and also Apple's runtime.
|
||||
|
||||
2019-03-07 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* SQLClient.m:
|
||||
Fix insertTransaction:atIndex: to work as advertised and insert at
|
||||
the specified index.
|
||||
|
||||
2019-03-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: fix to make the result of a prepare method contain
|
||||
'literal' strings.
|
||||
In -begin do not set the flag to say we are in a transaction until
|
||||
the statement has actually executed.
|
||||
|
||||
2019-02-28 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Postgres.m:
|
||||
Fix minor space leak in the Postgres backendConnect method.
|
||||
|
||||
2019-02-28 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* SQLClientPool.m:
|
||||
Add -prepareQuery:... method and make simpleQuery methods check that
|
||||
they are given a literal (or proxy);
|
||||
|
||||
2019-02-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
Remove transaction merging (deprecated in 2015).
|
||||
|
||||
2019-01-24 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Postgres.m (backendQuery:recordType:listType:):
|
||||
Fix optimization to reuse small data values in query results so
|
||||
that it actually works.
|
||||
|
||||
2018-11-23 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* SQLClientPool.m:
|
||||
Use a double for the argument of quoteFloat: and replace the
|
||||
inappropriate %f conversion by %.17g to avoid loss of precision
|
||||
when quoting floating-point numbers.
|
||||
|
||||
2018-07-27 Yavor Doganov <yavor@gnu.org>
|
||||
|
||||
* SQLClient.m: Fix some spelling errors.
|
||||
|
||||
2018-06-28 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
Make SQLTransaction thread-safe, also add -lock and -unlock methods
|
||||
to allow a sequence of other methods to be called without another
|
||||
thread interfering. Add -setResetOnExecute: method to configure a
|
||||
transaction to be automatically reset on successful execution.
|
||||
|
||||
2018-04-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: Fix error checking for nil values when preparing with
|
||||
a dictionary. This should make the {key?default} syntax work.
|
||||
|
||||
2017-09-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
Simplify observation of database notifications ... one observation per
|
||||
name per observing object.
|
||||
|
||||
2017-07-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
Temporarily restore earlier behavior ...
|
||||
Autoquote warnings off by default.
|
||||
Connection retries off by default.
|
||||
In future releases the plan is to
|
||||
a. have connection attempts retried forever by default
|
||||
b. first turn on warnings about autoquote issues by default
|
||||
c. later, rurn on autoquote by default
|
||||
|
||||
2017-07-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
Have connection attempts automatically retried (blocking
|
||||
indefinitely). Have queries and statements outside a transaction
|
||||
automatically retried if they fail due to loss of connection.
|
||||
|
||||
2017-08-25 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: Cache the file descriptor to fix problem in cleanup
|
||||
when postgres returns -1 from PQsocket() as we are trying to remove
|
||||
descriptor from run loop. Also fix error in unlisten where we would
|
||||
stop monitoring the descriptor prematurely.
|
||||
|
||||
2017-08-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: Add code so that if the database connection is lost
|
||||
while we are listening for notifications from it, we notice that
|
||||
and clean up properly rather than continuing to process/ignore a
|
||||
stream of end-of-file events on the dead descriptor.
|
||||
|
||||
2017-07-04 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* SQLClientPool.m:
|
||||
* Postgres.m:
|
||||
Lots of changes introducing new concept of a 'literal' as a string
|
||||
which does not need to be quoted (and must not be autoquoted).
|
||||
Quoting via the -quote: method now raises an exception if the
|
||||
argument is not supported, but we have a new method to allow
|
||||
classes to provide a mechanism for quoting themselves (ie to add
|
||||
support for them being using in SQL queries/statements).
|
||||
|
||||
2017-06-29 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
New method to control warnings (on by default) about strings which
|
||||
would automaticaly be quoted when autoquote is turned on.
|
||||
|
||||
2017-04-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m:
|
||||
Fix leak of SQLString instances caused by inheriting memory management
|
||||
methods from the literal string class.
|
||||
|
||||
2017-03-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* SQLClientPool.m:
|
||||
Add new +literal: and -literal: methods to make a normal string into
|
||||
one recognised as suitable for use literally (ie without quoting) in
|
||||
an SQL query/statement.
|
||||
Add +setAutoquote: method to turn on automatic quoting of non-literal
|
||||
strings as an aid to avoiding SQL injectiuon attacks.
|
||||
|
||||
2016-10-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: Wolfgang spotted that the asynchronous notification
|
||||
code is not thread safe ... we must not have one thread handle a
|
||||
notification at the same time that another is trying to use the
|
||||
database connectionto execute a query/statement.
|
||||
Use the client's lock to prevent that from happening.
|
||||
|
||||
2016-10-18 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
Make -addObserver:selector:name: raise if applied to a client in a
|
||||
pool. Improve documentation to make it clear that pool clients
|
||||
can't be used as observers of database notifications.
|
||||
|
||||
2016-06-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: Fixup to use case sensitive notification names.
|
||||
|
||||
2016-06-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* SQLClientPool.m:
|
||||
Allow easy removal of all database notification observers.
|
||||
Remove all observers when a client is returned to a pool.
|
||||
Postgres.m:
|
||||
Implement asynchronous notification by watching descriptor.
|
||||
|
||||
2016-05-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: Fix bug in initialisation ordering.
|
||||
* Postgres.m: Fix bug in array parsing.
|
||||
|
||||
2016-04-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
Add -isNull helper method for testing for null fields in records
|
||||
returned from the database.
|
||||
|
||||
2016-02-18 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* configure.ac: get host and cpu with more recent gnustep-make
|
||||
* configure: regenerate
|
||||
* JDBC.m: Update for connection pools (bug #47178)
|
||||
* testJDBC.m: get rid of compiler warnings
|
||||
|
||||
2015-07-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: disconnect on fatal error, so we don't keep trying to
|
||||
re-use the same connection when there's a problem with the server.
|
||||
|
||||
2015-07-23 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* SQLClient.m (initialize): Restore initialization of NSDateClass
|
||||
so that dates are quoted correctly irrespective of their current
|
||||
format.
|
||||
|
||||
2015-07-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClientPool.m:
|
||||
Change internal pool data to allow for storing reference counts and
|
||||
the threads which own each client connection.
|
||||
Support exclusive and non-exclusive clients in the pool, where an
|
||||
exclusive client is one which is only usable by the code which
|
||||
fetched it from the pool, but a non-exclusive client may be provided
|
||||
to other code in the same thread.
|
||||
Change behavior of -provideClient and -provideClientBeforeDate: to
|
||||
provide non-exclusive clients.
|
||||
Add -provideClientExclusive and -provideClientBeforeDate:exclusive:
|
||||
to support the old behavior.
|
||||
|
||||
2015-07-17 Niels Grewe <niels.grewe@halbordnung.de>
|
||||
|
||||
* Postgres.m: Support for "char"[] parsing.
|
||||
|
||||
2015-07-16 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Postgres.m (newDateFromBuffer): Use local time zone instead of
|
||||
GMT when parsing a date without a time zone.
|
||||
|
||||
2015-06-29 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* SQLClientPool.m:
|
||||
Implement another missing convenience method.
|
||||
Fix locking error when executing a batch.
|
||||
Add -prepare:with: method for use by transactions.
|
||||
Add -owner method to get a transaction's owner.
|
||||
|
||||
2015-06-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* SQLClientPool.m:
|
||||
Implement -batch: method for client pools.
|
||||
|
||||
2015-06-26 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* SQLClientPool.m:
|
||||
Implement -transaction method for client pools so that we can build
|
||||
a transaction which, when executed, will use any available client
|
||||
from the pool.
|
||||
Support setting of the client name for clients in a pool.
|
||||
|
||||
2015-06-25 Niels Grewe <niels.grewe@halbordnung.de>
|
||||
|
||||
* SQLClient.[hm]: Add an accessor method to obtain the SQLClientPool
|
||||
object owning a specific SQLClient.
|
||||
|
||||
2015-06-25 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h: Add -name method for pools.
|
||||
* SQLClient.m: Match documentation and use 'Database' as default name.
|
||||
* SQLClientPool.m: Add -name method and fix default name.
|
||||
|
||||
2015-06-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: Fix error parsing timezone in date.
|
||||
|
||||
2015-06-09 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: Fix race condition spotted by Wolfgang and change
|
||||
purge operation to avoid disconnecting clients while the class lock
|
||||
is locked.
|
||||
|
||||
2015-05-28 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h: Add pool purge control method.
|
||||
* SQLClient.m: Fix bug finding least recently used client.
|
||||
* SQLClientPool.m: Refine purging of pool. Fix autorelease bug.
|
||||
Improve diagnostics. Fix bug reporting time pool has blocked.
|
||||
|
||||
2015-05-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: bugfixes
|
||||
* SQLClient.m: bugfix for finding oldest idle connection
|
||||
* SQLClientPool.m: implement method to disconnect idle connections
|
||||
in pool. also check for clients being returned to pool while a
|
||||
transaction is still in progress.
|
||||
|
||||
2015-04-30 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m:
|
||||
* testPostgres.m:
|
||||
Fix error parsing timestamps in arrays when the server quoters them.
|
||||
Also optimise string allocation, and add some tests.
|
||||
|
||||
2015-04-28 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* Postgres.m:
|
||||
Deprecate transaction merging.
|
||||
Rewrite SQLRecord concrete class to use a new SQLRecordKeys object
|
||||
shared between all the records produced by a query (as a performance
|
||||
enhancement for large queries).
|
||||
|
||||
2015-04-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: notifications are posted in main thread.
|
||||
|
||||
2015-04-13 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClientPool.m:
|
||||
Make sure clients provided temporarily in convenience methods are
|
||||
swallowed by the pool again as soon as possible. Also trap and
|
||||
re-raise exceptions after swallowing provided client, to avoid
|
||||
the client being in use longer than necessary after an exception.
|
||||
Also, avoid taking clients from the pool in a few cases wehere we
|
||||
don't actually need to.
|
||||
Add -cache method for SQLClientPool.
|
||||
|
||||
2015-04-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
Expose method to add statement for insertion of data objects to
|
||||
transaction.
|
||||
|
||||
2015-04-09 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h: Add array quoting method for pool. Add pool ivar.
|
||||
* SQLClientPool.m: Implement array quoting and change other quoting
|
||||
to use new ivar rather than expensive provide/swallow sequence.
|
||||
|
||||
2015-04-01 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* Postgres.m:
|
||||
Fixup notification posting to be asynchronous using the default
|
||||
notification queue for the thread so that the notifications do
|
||||
not get delivered while the query/statement at which they were
|
||||
detected is still in progress.
|
||||
Add method to explicitly grab/release the client for the current
|
||||
thread.
|
||||
|
||||
2015-03-11 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClientPool.m: Fixup for exposing prepare method
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* Postgres.m:
|
||||
* testPostgres.m:
|
||||
Add simple array support for char/varchar/text, integer/real,
|
||||
timestamp, bool and bytea. When a query returns an array of
|
||||
one of these types, the resulting object is an NSArray containing
|
||||
the database array elements rather than an NSString containing the
|
||||
string literal representation of the database array.
|
||||
Also added a method to convert an NSArray to a string literal
|
||||
representation of a database array.
|
||||
|
||||
2015-03-02 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.h: Drop support for old versions of postgres which didn't
|
||||
support standard conforming strings. This allows us to always turn
|
||||
on standard conforming strings and be able to quote string and bytea
|
||||
objects whether the database connection has been established or not.
|
||||
* GNUmakefile:
|
||||
Bumped version to 1.8.4.
|
||||
|
||||
2014-12-11 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* GNUmakefile:
|
||||
Expose method to prepare a statement and a convenience method to
|
||||
check for an existing cached value (using a prepared statement
|
||||
as the cache key).
|
||||
Bumped version to 1.8.3.
|
||||
|
||||
2014-12-11 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: Fix minor thread safety issue.
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* SQLClientPool.m:
|
||||
Convenience methods to let a pool act as a client for any one-off op.
|
||||
|
||||
2014-11-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* GNUmakefile: bump version to 1.8.2 for bugfix release.
|
||||
* Postgres.m: Fix error handling TIME fields.
|
||||
|
||||
2014-11-04 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* GNUmakefile: bump version to 1.8.1 for connection pool tweaks.
|
||||
|
||||
2014-10-13 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
* SQLClientPool.m:
|
||||
Keep connections in pools outside the normal count of maximum number
|
||||
of concurrent connections. If we are using a pool then we must
|
||||
assume we want the pool to operate to its configured capacity.
|
||||
|
||||
2014-10-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: Add locking of the database client by SQLTransaction
|
||||
in case another thread tries to use the client whjile the transaction
|
||||
is using it (ie between an attempted transaction and a rollback if
|
||||
it fails).
|
||||
|
||||
2014-10-02 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: On exception during SQLTransaction -execute, roll back.
|
||||
|
||||
2014-09-24 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Postgres.m: An SQL exception/error should not automatically
|
||||
disconnect.
|
||||
|
||||
2014-09-10 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m:
|
||||
Fix error in [-setUser:] ... was checking wrong instance variable
|
||||
to see if the user changed.
|
||||
|
||||
2014-08-09 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
Redesign merging to give control over the number of statements
|
||||
merged and to make merging an attribute of the transaction
|
||||
rather than something done by a specific method.
|
||||
|
||||
2014-08-08 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h:
|
||||
* SQLClient.m:
|
||||
Add merging of insert/update statements in a transaction.
|
||||
|
||||
2014-07-17 Yavor Doganov <yavor@gnu.org>
|
||||
|
||||
Install bundles in a versioned directory.
|
||||
* GNUmakefile (BUNDLE_INSTALL_DIR): Append the interface version.
|
||||
* GNUmakefile.preamble (ADDITIONAL_CPPFLAGS): Define.
|
||||
* SQLClient.m (-_configure:): Load bundles from the versioned
|
||||
directory.
|
||||
|
||||
2014-07-11 Yavor Doganov <yavor@gnu.org>
|
||||
|
||||
* GNUmakefile (SQLClient_LIBRARIES_DEPEND_UPON): Add $(FND_LIBS)
|
||||
and $(OBJC_LIBS).
|
||||
|
||||
2014-06-20 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* GNUmakefile: bump version to 1.8.0 for next release (will break
|
||||
binary compatibility due to changes for pools adding ivars).
|
||||
|
||||
2014-06-20 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h: Add SQLClientPool, new method to check idle clients
|
||||
and new initialiser.
|
||||
* SQLClient.m: Changes to support pools of clients and permit a pool
|
||||
to contain multiple clients with the same config.
|
||||
* SQLClientPool.m: new class to provide a pool of clients with the
|
||||
same config.
|
||||
|
||||
2014-05-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.h: Warn about not using the database inside a
|
||||
notification handler.
|
||||
* Postgres.m: Add locking around database operations caused
|
||||
by asynchronous arrival of a notification.
|
||||
* GNUmakefile: new subminor version for bugfix release
|
||||
* Version 1.7.3: released
|
||||
|
||||
2014-05-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SQLClient.m: More locking to try to protect all access to the
|
||||
|
|
14
GNUmakefile
14
GNUmakefile
|
@ -18,10 +18,14 @@ endif
|
|||
|
||||
include $(GNUSTEP_MAKEFILES)/common.make
|
||||
|
||||
# Force sequential build to prevent different versions of the same
|
||||
# bundle overwriting each other's temporary files during building.
|
||||
GNUSTEP_MAKE_PARALLEL_BUILDING=no
|
||||
|
||||
-include config.make
|
||||
|
||||
PACKAGE_NAME = SQLClient
|
||||
PACKAGE_VERSION = 1.7.2
|
||||
PACKAGE_VERSION = 1.9.0
|
||||
CVS_MODULE_NAME = gnustep/dev-libs/SQLClient
|
||||
CVS_TAG_NAME = SQLClient
|
||||
SVN_BASE_URL=svn+ssh://svn.gna.org/svn/gnustep/libs
|
||||
|
@ -34,10 +38,10 @@ TEST_TOOL_NAME=
|
|||
LIBRARY_NAME=SQLClient
|
||||
DOCUMENT_NAME=SQLClient
|
||||
|
||||
SQLClient_INTERFACE_VERSION=1.7
|
||||
SQLClient_INTERFACE_VERSION=1.9
|
||||
|
||||
SQLClient_OBJC_FILES = SQLClient.m
|
||||
SQLClient_LIBRARIES_DEPEND_UPON = -lPerformance
|
||||
SQLClient_OBJC_FILES = SQLClient.m SQLClientPool.m
|
||||
SQLClient_LIBRARIES_DEPEND_UPON = -lPerformance $(FND_LIBS) $(OBJC_LIBS)
|
||||
SQLClient_HEADER_FILES = SQLClient.h
|
||||
SQLClient_AGSDOC_FILES = SQLClient.h
|
||||
SQLClient_AGSDOC_FLAGS = -WordMap '{SQLCLIENT_PRIVATE="";}'
|
||||
|
@ -49,7 +53,7 @@ SQLClient_HEADER_FILES_INSTALL_DIR = SQLClient
|
|||
|
||||
BUNDLE_NAME=
|
||||
|
||||
BUNDLE_INSTALL_DIR=$(GNUSTEP_BUNDLES)/SQLClient
|
||||
BUNDLE_INSTALL_DIR=$(GNUSTEP_BUNDLES)/SQLClient$(SQLClient_INTERFACE_VERSION)
|
||||
|
||||
# In some systems and situations the dynamic linker needs to haved the
|
||||
# SQLClient, gnustep-base, and objc libraries explicityly linked into
|
||||
|
|
|
@ -66,6 +66,10 @@ after-distclean::
|
|||
# Things to do after checking
|
||||
# after-check::
|
||||
|
||||
config.make: config.make.in
|
||||
./configure
|
||||
config.make: config.status
|
||||
if [ -x config.status ]; then \
|
||||
./config.status --recheck; \
|
||||
else \
|
||||
./configure; \
|
||||
fi
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#
|
||||
|
||||
# Additional flags to pass to the preprocessor
|
||||
# ADDITIONAL_CPPFLAGS +=
|
||||
ADDITIONAL_CPPFLAGS += -DSOVERSION=\"$(SQLClient_INTERFACE_VERSION)\"
|
||||
|
||||
# Additional flags to pass to the Objective-C compiler
|
||||
# ADDITIONAL_OBJCFLAGS +=
|
||||
|
|
56
JDBC.m
56
JDBC.m
|
@ -30,6 +30,7 @@
|
|||
#import <Foundation/NSCharacterSet.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#import <Foundation/NSDate.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSLock.h>
|
||||
#import <Foundation/NSMapTable.h>
|
||||
|
@ -1521,7 +1522,7 @@ static int JDBCVARCHAR = 0;
|
|||
transaction = (_JDBCTransaction*)NSAllocateObject([_JDBCTransaction class], 0,
|
||||
NSDefaultMallocZone());
|
||||
|
||||
transaction->_db = [self retain];
|
||||
transaction->_owner = [self retain];
|
||||
transaction->_info = [NSMutableArray new];
|
||||
transaction->_batch = YES;
|
||||
transaction->_stop = stopOnFailure;
|
||||
|
@ -1680,7 +1681,7 @@ static int JDBCVARCHAR = 0;
|
|||
transaction = (_JDBCTransaction*)NSAllocateObject([_JDBCTransaction class], 0,
|
||||
NSDefaultMallocZone());
|
||||
|
||||
transaction->_db = [self retain];
|
||||
transaction->_owner = [self retain];
|
||||
transaction->_info = [NSMutableArray new];
|
||||
return [(SQLTransaction*)transaction autorelease];
|
||||
}
|
||||
|
@ -1728,21 +1729,13 @@ static int JDBCVARCHAR = 0;
|
|||
if (_count > 0)
|
||||
{
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
SQLClientPool *pool;
|
||||
SQLClient *db;
|
||||
BOOL wrapped = NO;
|
||||
BOOL batched = NO;
|
||||
JNIEnv *env;
|
||||
JInfo *ji;
|
||||
|
||||
/*
|
||||
* Ensure we have a working connection.
|
||||
*/
|
||||
if ([_db connect] == NO)
|
||||
{
|
||||
[NSException raise: SQLException
|
||||
format: @"Unable to connect to '%@' to execute transaction %@",
|
||||
[_db name], self];
|
||||
}
|
||||
|
||||
env = SQLClientJNIEnv();
|
||||
if ((*env)->PushLocalFrame (env, 32) < 0)
|
||||
{
|
||||
|
@ -1752,16 +1745,38 @@ static int JDBCVARCHAR = 0;
|
|||
format: @"No java memory for execute"];
|
||||
}
|
||||
|
||||
ji = [(SQLClientJDBC*)_db _backendExtra];
|
||||
if ([_owner isKindOfClass: [SQLClientPool class]])
|
||||
{
|
||||
pool = (SQLClientPool*)_owner;
|
||||
db = [pool provideClient];
|
||||
}
|
||||
else
|
||||
{
|
||||
pool = nil;
|
||||
db = _owner;
|
||||
}
|
||||
|
||||
ji = [(SQLClientJDBC*)db _backendExtra];
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
NSMutableArray *statements;
|
||||
unsigned numberOfStatements;
|
||||
unsigned statement;
|
||||
NSTimeInterval _duration = [_db durationLogging];
|
||||
NSTimeInterval _duration;
|
||||
NSTimeInterval start = 0.0;
|
||||
|
||||
/*
|
||||
* Ensure we have a working connection.
|
||||
*/
|
||||
if ([db connect] == NO)
|
||||
{
|
||||
[NSException raise: SQLException
|
||||
format: @"Unable to connect to '%@' to execute transaction %@",
|
||||
[_owner name], self];
|
||||
}
|
||||
|
||||
_duration = [db durationLogging];
|
||||
statements = [NSMutableArray arrayWithCapacity: 100];
|
||||
[self _merge: statements];
|
||||
numberOfStatements = [statements count];
|
||||
|
@ -1771,7 +1786,7 @@ static int JDBCVARCHAR = 0;
|
|||
start = GSTickerTimeNow();
|
||||
}
|
||||
|
||||
if ([_db isInTransaction] == NO)
|
||||
if ([db isInTransaction] == NO)
|
||||
{
|
||||
wrapped = YES;
|
||||
}
|
||||
|
@ -1883,15 +1898,15 @@ static int JDBCVARCHAR = 0;
|
|||
|
||||
(*env)->PopLocalFrame (env, NULL);
|
||||
|
||||
_db->_lastOperation = GSTickerTimeNow();
|
||||
db->_lastOperation = GSTickerTimeNow();
|
||||
if (_duration >= 0)
|
||||
{
|
||||
NSTimeInterval d;
|
||||
|
||||
d = _db->_lastOperation - start;
|
||||
d = db->_lastOperation - start;
|
||||
if (d >= _duration)
|
||||
{
|
||||
[_db debug: @"Duration %g for transaction %@",
|
||||
[db debug: @"Duration %g for transaction %@",
|
||||
d, statements];
|
||||
}
|
||||
}
|
||||
|
@ -1913,6 +1928,11 @@ static int JDBCVARCHAR = 0;
|
|||
}
|
||||
NS_ENDHANDLER
|
||||
|
||||
if (nil != pool)
|
||||
{
|
||||
[pool swallowClient: db];
|
||||
}
|
||||
|
||||
[arp release];
|
||||
}
|
||||
}
|
||||
|
|
4
MySQL.m
4
MySQL.m
|
@ -290,8 +290,8 @@ static unsigned int trim(char *str)
|
|||
}
|
||||
|
||||
- (NSMutableArray*) backendQuery: (NSString*)stmt
|
||||
recordType: (Class)rtype
|
||||
listType: (Class)ltype
|
||||
recordType: (id)rtype
|
||||
listType: (id)ltype
|
||||
{
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSMutableArray *records = nil;
|
||||
|
|
1354
Postgres.m
1354
Postgres.m
File diff suppressed because it is too large
Load diff
1026
SQLClient.h
1026
SQLClient.h
File diff suppressed because it is too large
Load diff
|
@ -72,7 +72,7 @@
|
|||
"add:with:",
|
||||
"append:",
|
||||
"count",
|
||||
"db",
|
||||
"owner",
|
||||
"execute",
|
||||
"reset"
|
||||
);
|
||||
|
|
4631
SQLClient.m
4631
SQLClient.m
File diff suppressed because it is too large
Load diff
1526
SQLClientPool.m
Normal file
1526
SQLClientPool.m
Normal file
File diff suppressed because it is too large
Load diff
1326
config.guess
vendored
1326
config.guess
vendored
File diff suppressed because it is too large
Load diff
1451
config.sub
vendored
1451
config.sub
vendored
File diff suppressed because it is too large
Load diff
421
configure.ac
421
configure.ac
|
@ -14,6 +14,11 @@ else
|
|||
. $GNUSTEP_MAKEFILES/GNUstep.sh
|
||||
fi
|
||||
|
||||
if test "x$GNUSTEP_HOST_OS" = "x"; then
|
||||
GNUSTEP_HOST_OS=`gnustep-config --variable=GNUSTEP_HOST_OS`
|
||||
GNUSTEP_HOST_CPU=`gnustep-config --variable=GNUSTEP_HOST_CPU`
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
AC_ARG_WITH(additional-include, [
|
||||
--with-additional-include=flags
|
||||
|
@ -197,42 +202,41 @@ if test "$ac_cv_mysql_bundle" = "no"; then
|
|||
else
|
||||
AC_MSG_RESULT([no: build if possible])
|
||||
|
||||
AC_CHECK_HEADERS(mysql/mysql.h)
|
||||
if test "$ac_cv_header_mysql_mysql_h" = "yes"; then
|
||||
MYSQL=yes
|
||||
else
|
||||
MYSQL=
|
||||
echo "*********************************************************"
|
||||
echo "Unable to locate mysqlclient headers (are they installed)"
|
||||
echo "*********************************************************"
|
||||
fi
|
||||
if test "$MYSQL" = "yes"; then
|
||||
if test -d /usr/lib/mysql ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/lib/mysql"
|
||||
LIBD="$LIBD -L/usr/lib/mysql"
|
||||
AC_CHECK_HEADERS(mysql/mysql.h)
|
||||
if test "$ac_cv_header_mysql_mysql_h" = "yes"; then
|
||||
MYSQL=yes
|
||||
else
|
||||
if test -d /usr/local/lib/mysql ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/local/lib/mysql"
|
||||
LIBD="$LIBD -L/usr/local/lib/mysql"
|
||||
MYSQL=
|
||||
echo "*********************************************************"
|
||||
echo "Unable to locate mysqlclient headers (are they installed)"
|
||||
echo "*********************************************************"
|
||||
fi
|
||||
if test "$MYSQL" = "yes"; then
|
||||
if test -d /usr/lib/mysql ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/lib/mysql"
|
||||
LIBD="$LIBD -L/usr/lib/mysql"
|
||||
else
|
||||
if test -d /usr/local/mysql/lib ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/local/mysql/lib"
|
||||
LIBD="$LIBD -L/usr/local/mysql/lib"
|
||||
if test -d /usr/local/lib/mysql ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/local/lib/mysql"
|
||||
LIBD="$LIBD -L/usr/local/lib/mysql"
|
||||
else
|
||||
if test -d /usr/local/mysql/lib ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/local/mysql/lib"
|
||||
LIBD="$LIBD -L/usr/local/mysql/lib"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_CHECK_LIB(mysqlclient,mysql_init)
|
||||
if test "$ac_cv_lib_mysqlclient_mysql_init" != "yes"; then
|
||||
MYSQL=
|
||||
echo "******************************************************"
|
||||
echo "Unable to locate mysqlclient library (is it installed)"
|
||||
echo "******************************************************"
|
||||
AC_CHECK_LIB(mysqlclient,mysql_init)
|
||||
if test "$ac_cv_lib_mysqlclient_mysql_init" != "yes"; then
|
||||
MYSQL=
|
||||
echo "******************************************************"
|
||||
echo "Unable to locate mysqlclient library (is it installed)"
|
||||
echo "******************************************************"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(MYSQL)
|
||||
|
||||
fi
|
||||
|
||||
|
||||
AC_MSG_CHECKING([if Sqllite support was manually disabled])
|
||||
AC_ARG_ENABLE(sqllite-bundle, [
|
||||
|
@ -250,28 +254,27 @@ if test "$ac_cv_sqllite_bundle" = "no"; then
|
|||
else
|
||||
AC_MSG_RESULT([no: build if possible])
|
||||
|
||||
AC_CHECK_HEADERS(sqlite3.h)
|
||||
if test "$ac_cv_header_sqlite3_h" = "yes"; then
|
||||
SQLITE=yes
|
||||
else
|
||||
SQLITE=
|
||||
echo "*****************************************************"
|
||||
echo "Unable to locate sqlite3 headers (are they installed)"
|
||||
echo "*****************************************************"
|
||||
fi
|
||||
if test "$SQLITE" = "yes"; then
|
||||
AC_CHECK_LIB(sqlite3,sqlite3_open)
|
||||
if test "$ac_cv_lib_sqlite3_sqlite3_open" != "yes"; then
|
||||
AC_CHECK_HEADERS(sqlite3.h)
|
||||
if test "$ac_cv_header_sqlite3_h" = "yes"; then
|
||||
SQLITE=yes
|
||||
else
|
||||
SQLITE=
|
||||
echo "******************************************************"
|
||||
echo "Unable to locate sqlite3 library (is it installed)"
|
||||
echo "******************************************************"
|
||||
echo "*****************************************************"
|
||||
echo "Unable to locate sqlite3 headers (are they installed)"
|
||||
echo "*****************************************************"
|
||||
fi
|
||||
if test "$SQLITE" = "yes"; then
|
||||
AC_CHECK_LIB(sqlite3,sqlite3_open)
|
||||
if test "$ac_cv_lib_sqlite3_sqlite3_open" != "yes"; then
|
||||
SQLITE=
|
||||
echo "******************************************************"
|
||||
echo "Unable to locate sqlite3 library (is it installed)"
|
||||
echo "******************************************************"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(SQLITE)
|
||||
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if Postgres support was manually disabled])
|
||||
AC_ARG_ENABLE(postgres-bundle, [
|
||||
--disable-postgres-bundle
|
||||
|
@ -288,163 +291,211 @@ if test "$ac_cv_postgres_bundle" = "no"; then
|
|||
else
|
||||
AC_MSG_RESULT([no: build if possible])
|
||||
|
||||
# Start POSTGRES checks
|
||||
POSTGRES=
|
||||
# Start POSTGRES checks
|
||||
POSTGRES=
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
AC_CHECK_HEADERS(libpq-fe.h)
|
||||
if test "$ac_cv_header_libpq_fe_h" = "yes"; then
|
||||
POSTGRES=yes
|
||||
fi
|
||||
fi
|
||||
if test "$ECPG" = ""; then
|
||||
AC_CHECK_HEADERS(ecpglib.h)
|
||||
if test "$ac_cv_header_ecpglib_h" = "yes"; then
|
||||
ECPG=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/include/postgresql/libpq-fe.h)
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
if test "$ac_cv_header__usr_include_postgresql_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/include/postgresql"
|
||||
POSTGRES=yes
|
||||
fi
|
||||
fi
|
||||
if test "$ECPG" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/include/postgresql/ecpglib.h)
|
||||
if test "$ac_cv_header__usr_include_postgresql_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/include/postgresql"
|
||||
ECPG=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/include/postgresql/8.0/libpq-fe.h)
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
if test "$ac_cv_header__usr_include_postgresql_8_0_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/include/postgresql/8.0"
|
||||
POSTGRES=yes
|
||||
fi
|
||||
fi
|
||||
if test "$ECPG" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/include/postgresql/8.0/ecpglib.h)
|
||||
if test "$ac_cv_header__usr_include_postgresql_8_0_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/include/postgresql/8.0"
|
||||
ECPG=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/include/pgsql/libpq-fe.h)
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
if test "$ac_cv_header__usr_include_pgsql_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/include/pgsql"
|
||||
POSTGRES=yes
|
||||
fi
|
||||
fi
|
||||
if test "$ECPG" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/include/pgsql/ecpglib.h)
|
||||
if test "$ac_cv_header__usr_include_pgsql_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/include/pgsql"
|
||||
ECPG=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/local/include/pgsql/libpq-fe.h)
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
if test "$ac_cv_header__usr_local_include_pgsql_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/local/include/pgsql"
|
||||
POSTGRES=yes
|
||||
fi
|
||||
fi
|
||||
if test "$ECPG" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/local/include/pgsql/ecpglib.h)
|
||||
if test "$ac_cv_header__usr_local_include_pgsql_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/local/include/pgsql"
|
||||
ECPG=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/local/pgsql/include/libpq-fe.h)
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
if test "$ac_cv_header__usr_local_pgsql_include_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/local/pgsql/include"
|
||||
POSTGRES=yes
|
||||
fi
|
||||
fi
|
||||
if test "$ECPG" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/local/pgsql/include/ecpglib.h)
|
||||
if test "$ac_cv_header__usr_local_pgsql_include_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/local/pgsql/include"
|
||||
ECPG=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
echo "**************************************************************"
|
||||
echo "Unable to locate libpq (postgres) headers (are they installed)"
|
||||
echo "**************************************************************"
|
||||
fi
|
||||
if test "$ECPG" = ""; then
|
||||
echo "*************************************************************"
|
||||
echo "Unable to locate ecpg (postgres) headers (are they installed)"
|
||||
echo "*************************************************************"
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = "yes"; then
|
||||
# NICOLA - hack
|
||||
if test -d /usr/lib/pgsql ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/lib/pgsql"
|
||||
LIBD="$LIBD -L/usr/lib/pgsql"
|
||||
else
|
||||
if test -d /usr/local/lib/pgsql ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/local/lib/pgsql"
|
||||
LIBD="$LIBD -L/usr/local/lib/pgsql"
|
||||
else
|
||||
if test -d /usr/local/pgsql/lib ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/local/pgsql/lib"
|
||||
LIBD="$LIBD -L/usr/local/pgsql/lib"
|
||||
fi
|
||||
if test "$POSTGRES" = ""; then
|
||||
AC_CHECK_HEADERS(libpq-fe.h)
|
||||
if test "$ac_cv_header_libpq_fe_h" = "yes"; then
|
||||
POSTGRES=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(pq,PQfformat)
|
||||
if test "$ac_cv_lib_pq_PQfformat" != "yes"; then
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/include/postgresql/libpq-fe.h)
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
if test "$ac_cv_header__usr_include_postgresql_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/include/postgresql"
|
||||
POSTGRES=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/include/postgresql/8.0/libpq-fe.h)
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
if test "$ac_cv_header__usr_include_postgresql_8_0_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/include/postgresql/8.0"
|
||||
POSTGRES=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/include/pgsql/libpq-fe.h)
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
if test "$ac_cv_header__usr_include_pgsql_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/include/pgsql"
|
||||
POSTGRES=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/local/include/pgsql/libpq-fe.h)
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
if test "$ac_cv_header__usr_local_include_pgsql_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/local/include/pgsql"
|
||||
POSTGRES=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/local/pgsql/include/libpq-fe.h)
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
if test "$ac_cv_header__usr_local_pgsql_include_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/local/pgsql/include"
|
||||
POSTGRES=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = ""; then
|
||||
echo "**************************************************************"
|
||||
echo "Unable to locate libpq (postgres) headers (are they installed)"
|
||||
echo "**************************************************************"
|
||||
fi
|
||||
|
||||
if test "$POSTGRES" = "yes"; then
|
||||
# NICOLA - hack
|
||||
if test -d /usr/lib/pgsql ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/lib/pgsql"
|
||||
LIBD="$LIBD -L/usr/lib/pgsql"
|
||||
else
|
||||
if test -d /usr/local/lib/pgsql ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/local/lib/pgsql"
|
||||
LIBD="$LIBD -L/usr/local/lib/pgsql"
|
||||
else
|
||||
if test -d /usr/local/pgsql/lib ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/local/pgsql/lib"
|
||||
LIBD="$LIBD -L/usr/local/pgsql/lib"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(pq,PQfformat)
|
||||
if test "$ac_cv_lib_pq_PQfformat" != "yes"; then
|
||||
POSTGRES=
|
||||
AC_CHECK_LIB(pq,PQclear)
|
||||
echo "******************************************************"
|
||||
if test "$ac_cv_lib_pq_PQclear" != "yes"; then
|
||||
echo "Unable to locate postgres pq library (is it installed)"
|
||||
echo "Unable to locate postgres pq library (is it installed)"
|
||||
else
|
||||
echo "Located postgres pq library, but it is too old to use!"
|
||||
echo "Located postgres pq library, but it is too old to use!"
|
||||
fi
|
||||
echo "Perhaps you can try 'configure --with-postgres=dir=path'"
|
||||
echo "to point to the postgres version you wish to use."
|
||||
echo "******************************************************"
|
||||
else
|
||||
AC_CHECK_FUNCS(PQescapeStringConn)
|
||||
fi
|
||||
AC_CHECK_LIB(ecpg,ECPGconnect)
|
||||
if test "$ac_cv_lib_ecpg_ECPGconnect" != "yes"; then
|
||||
ECPG=
|
||||
echo "********************************************************"
|
||||
echo "Unable to locate postgres ecpg library (is it installed)"
|
||||
echo "Perhaps you can try 'configure --with-postgres=dir=path'"
|
||||
echo "to point to the postgres version you wish to use."
|
||||
echo "********************************************************"
|
||||
else
|
||||
AC_CHECK_FUNCS(PQescapeStringConn)
|
||||
fi
|
||||
fi
|
||||
# End POSTGRES checks
|
||||
fi
|
||||
|
||||
# End POSTGRES checks
|
||||
fi
|
||||
|
||||
AC_SUBST(POSTGRES)
|
||||
|
||||
AC_MSG_CHECKING([if ECPG (Old Postgres) support was manually disabled])
|
||||
AC_ARG_ENABLE(ecpg-bundle, [
|
||||
--disable-ecpg-bundle
|
||||
Disable creating the ECPG bundle.
|
||||
Use this option to force the ECPG bundle not to be built
|
||||
even if the Postgres libraries look like being present.
|
||||
],
|
||||
ac_cv_ecpg_bundle=$enableval,
|
||||
ac_cv_ecpg_bundle="yes")
|
||||
|
||||
if test "$ac_cv_ecpg_bundle" = "no"; then
|
||||
AC_MSG_RESULT([yes: disabled from the command-line])
|
||||
ECPG=
|
||||
else
|
||||
AC_MSG_RESULT([no: build if possible])
|
||||
|
||||
# Start ECPG checks
|
||||
ECPG=
|
||||
|
||||
if test "$ECPG" = ""; then
|
||||
AC_CHECK_HEADERS(ecpglib.h)
|
||||
if test "$ac_cv_header_ecpglib_h" = "yes"; then
|
||||
ECPG=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$ECPG" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/include/postgresql/ecpglib.h)
|
||||
if test "$ac_cv_header__usr_include_postgresql_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/include/postgresql"
|
||||
ECPG=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$ECPG" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/include/postgresql/8.0/ecpglib.h)
|
||||
if test "$ac_cv_header__usr_include_postgresql_8_0_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/include/postgresql/8.0"
|
||||
ECPG=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$ECPG" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/include/pgsql/ecpglib.h)
|
||||
if test "$ac_cv_header__usr_include_pgsql_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/include/pgsql"
|
||||
ECPG=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$ECPG" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/local/include/pgsql/ecpglib.h)
|
||||
if test "$ac_cv_header__usr_local_include_pgsql_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/local/include/pgsql"
|
||||
ECPG=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$ECPG" = ""; then
|
||||
AC_CHECK_HEADERS(/usr/local/pgsql/include/ecpglib.h)
|
||||
if test "$ac_cv_header__usr_local_pgsql_include_libpq_fe_h" = "yes"; then
|
||||
INCD="$INCD -I/usr/local/pgsql/include"
|
||||
ECPG=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$ECPG" = ""; then
|
||||
echo "*************************************************************"
|
||||
echo "Unable to locate ecpg (postgres) headers (are they installed)"
|
||||
echo "*************************************************************"
|
||||
fi
|
||||
|
||||
if test "$ECPG" = "yes"; then
|
||||
# NICOLA - hack
|
||||
if test -d /usr/lib/pgsql ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/lib/pgsql"
|
||||
LIBD="$LIBD -L/usr/lib/pgsql"
|
||||
else
|
||||
if test -d /usr/local/lib/pgsql ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/local/lib/pgsql"
|
||||
LIBD="$LIBD -L/usr/local/lib/pgsql"
|
||||
else
|
||||
if test -d /usr/local/pgsql/lib ; then
|
||||
CPPFLAGS="$CPPFLAGS -L/usr/local/pgsql/lib"
|
||||
LIBD="$LIBD -L/usr/local/pgsql/lib"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(pq,PQfformat)
|
||||
AC_CHECK_LIB(ecpg,ECPGconnect)
|
||||
if test "$ac_cv_lib_ecpg_ECPGconnect" != "yes"; then
|
||||
ECPG=
|
||||
echo "********************************************************"
|
||||
echo "Unable to locate postgres ecpg library (is it installed)"
|
||||
echo "Perhaps you can try 'configure --with-postgres=dir=path'"
|
||||
echo "to point to the postgres version you wish to use."
|
||||
echo "********************************************************"
|
||||
fi
|
||||
fi
|
||||
# End ECPG checks
|
||||
fi
|
||||
AC_SUBST(ECPG)
|
||||
|
||||
|
||||
|
||||
ORACLE_HOME=
|
||||
AC_SUBST(ORACLE_HOME)
|
||||
|
||||
|
|
250
install-sh
250
install-sh
|
@ -1,250 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
|
@ -125,7 +125,7 @@ main()
|
|||
if (count == 0)
|
||||
{
|
||||
[db commit];
|
||||
sleep(1);
|
||||
[NSThread sleepForTimeInterval: 1.0];
|
||||
[db begin];
|
||||
records = [db query: @"SELECT * FROM Queue WHERE Consumer = ",
|
||||
[db quote: name],
|
||||
|
@ -242,7 +242,7 @@ main()
|
|||
r0 = [db cache: 1 query: @"select * from xxx", nil];
|
||||
r1 = [db cache: 1 query: @"select * from xxx", nil];
|
||||
NSCAssert([r0 lastObject] == [r1 lastObject], @"Cache failed");
|
||||
sleep(2);
|
||||
[NSThread sleepForTimeInterval: 2.0];
|
||||
records = [db cache: 1 query: @"select * from xxx", nil];
|
||||
NSCAssert([r0 lastObject] != [records lastObject], @"Lifetime failed");
|
||||
|
||||
|
@ -250,7 +250,7 @@ main()
|
|||
|
||||
if ([records count] != 3)
|
||||
{
|
||||
NSLog(@"Expected 3 records but got %u", [records count]);
|
||||
NSLog(@"Expected 3 records but got %"PRIuPTR, [records count]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
242
testPostgres.m
242
testPostgres.m
|
@ -42,6 +42,7 @@ int
|
|||
main()
|
||||
{
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
SQLClientPool *sp;
|
||||
SQLClient *db;
|
||||
NSUserDefaults *defs;
|
||||
NSMutableArray *records;
|
||||
|
@ -68,7 +69,74 @@ main()
|
|||
nil]
|
||||
];
|
||||
|
||||
db = [SQLClient clientWithConfiguration: nil name: @"test"];
|
||||
sp = [[[SQLClientPool alloc] initWithConfiguration: nil
|
||||
name: @"test"
|
||||
max: 2
|
||||
min: 1] autorelease];
|
||||
#if 0
|
||||
{
|
||||
NSAutoreleasePool *p;
|
||||
NSAutoreleasePool *q;
|
||||
SQLClient *c0;
|
||||
SQLClient *c1;
|
||||
|
||||
[sp setDebugging: 4];
|
||||
p = [NSAutoreleasePool new];
|
||||
c0 = [sp provideClientExclusive];
|
||||
c1 = [sp provideClientExclusive];
|
||||
NSLog(@"Got two clients from pool");
|
||||
[c0 connect];
|
||||
[c1 connect];
|
||||
NSLog(@"Now putting clients back in pool again");
|
||||
[sp swallowClient: c0];
|
||||
[sp swallowClient: c1];
|
||||
NSLog(@"And emptying autorelease pool");
|
||||
[p release];
|
||||
p = [NSAutoreleasePool new];
|
||||
[sp setPurgeAll: 60 min: 1];
|
||||
[NSThread sleepForTimeInterval: 1.0];
|
||||
NSLog(@"Expecting purge to disconnect one client");
|
||||
[sp purge];
|
||||
c0 = [sp provideClientExclusive];
|
||||
c1 = [sp provideClientExclusive];
|
||||
NSLog(@"Expecting connected: %@", [c0 connected] ? @"YES" : @"NO");
|
||||
NSLog(@"Expecting not connected: %@", [c1 connected] ? @"NO" : @"YES");
|
||||
|
||||
NSLog(@"Pool has provided both it's clients ... now try for another with a 15 second timeout");
|
||||
[sp provideClientBeforeDate: [NSDate dateWithTimeIntervalSinceNow: 15.0]
|
||||
exclusive: YES];
|
||||
NSLog(@"Emptying autorelease pool ... clients should be put back in pool");
|
||||
[p release];
|
||||
p = [NSAutoreleasePool new];
|
||||
NSLog(@"Getting two clients again");
|
||||
c0 = [sp provideClientExclusive];
|
||||
c1 = [sp provideClientExclusive];
|
||||
NSLog(@"Pool has provided both it's clients ... now try for another with a 15 second timeout");
|
||||
[sp provideClientBeforeDate: [NSDate dateWithTimeIntervalSinceNow: 15.0]
|
||||
exclusive: YES];
|
||||
NSLog(@"Emptying autorelease pool again");
|
||||
[p release];
|
||||
p = [NSAutoreleasePool new];
|
||||
c0 = [sp provideClient];
|
||||
q = [NSAutoreleasePool new];
|
||||
c1 = [sp provideClient];
|
||||
if (c0 != c1)
|
||||
{
|
||||
NSLog(@"ERROR was expecting provideClient to give the same object");
|
||||
exit(1);
|
||||
}
|
||||
[q release];
|
||||
[c0 connect];
|
||||
[p release];
|
||||
|
||||
NSLog(@"Expect to get client immediately");
|
||||
}
|
||||
#endif
|
||||
db = [sp provideClientExclusive];
|
||||
[sp swallowClient: db];
|
||||
|
||||
[sp queryString: @"SELECT CURRENT_TIMESTAMP", nil];
|
||||
db = [sp provideClientExclusive];
|
||||
|
||||
l = [Logger new];
|
||||
[[NSNotificationCenter defaultCenter] addObserver: l
|
||||
|
@ -92,7 +160,7 @@ main()
|
|||
@"Delivery TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, "
|
||||
@"Reference CHAR(128), "
|
||||
@"Destination CHAR(15) NOT NULL, "
|
||||
@"Payload CHAR(250) DEFAULT '' NOT NULL"
|
||||
@"Payload CHAR(250) DEFAULT '' NOT NULL,"
|
||||
@")",
|
||||
nil];
|
||||
[db execute:
|
||||
|
@ -127,8 +195,11 @@ main()
|
|||
}
|
||||
[db execute: @"INSERT INTO Queue (Consumer, Destination,"
|
||||
@" ServiceID, Payload) VALUES (",
|
||||
[db quote: name], @", ", [db quote: destination], @", ", sid, @", ",
|
||||
@"'helo there'", @")", nil];
|
||||
[db quote: name], @", ",
|
||||
[db quote: destination], @", ",
|
||||
sid, @", ",
|
||||
@"'helo there'",
|
||||
@")", nil];
|
||||
[arp release];
|
||||
}
|
||||
NSLog(@"End producing");
|
||||
|
@ -197,11 +268,18 @@ main()
|
|||
else
|
||||
{
|
||||
NSString *oddChars;
|
||||
NSString *oddNoNul;
|
||||
NSString *nonLatin;
|
||||
id e1, e2, e3, e4, e5;
|
||||
id d;
|
||||
id d0;
|
||||
id d1;
|
||||
id d2;
|
||||
id r0;
|
||||
id r1;
|
||||
|
||||
oddChars = @"'a\\b'c\r\nd'\\ed\\";
|
||||
oddChars = @"'a\\b'c\0\r\nd'\\ed\\";
|
||||
oddNoNul = @"'a\\b'c\r\nd'\\ed\\";
|
||||
nonLatin = [[NSString stringWithCString: "\"\\U2A11\""] propertyList];
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
|
@ -218,34 +296,64 @@ main()
|
|||
|
||||
[db begin];
|
||||
[db execute: @"create table xxx ( "
|
||||
@"id int, "
|
||||
@"k char(40), "
|
||||
@"char1 char(1), "
|
||||
@"boolval BOOL, "
|
||||
@"intval int, "
|
||||
@"when1 timestamp with time zone, "
|
||||
@"when2 timestamp, "
|
||||
@"b bytea"
|
||||
@"b bytea,"
|
||||
@"extra1 int[],"
|
||||
@"extra2 varchar[],"
|
||||
@"extra3 bytea[],"
|
||||
@"extra4 boolean[],"
|
||||
@"extra5 timestamp with time zone[]"
|
||||
@")",
|
||||
nil];
|
||||
|
||||
if (1 != [db execute: @"insert into xxx "
|
||||
@"(k, char1, boolval, intval, when1, when2, b) "
|
||||
@"values ("
|
||||
@"'hello', "
|
||||
if (1 != [db execute: @"INSERT into xxx (id, k, char1, boolval, intval,"
|
||||
@" when1, when2, b, extra1, extra2, extra3, extra4, extra5) "
|
||||
@"values (1,"
|
||||
@"'{hello', "
|
||||
@"'X', "
|
||||
@"TRUE, "
|
||||
@"1, "
|
||||
@"CURRENT_TIMESTAMP, "
|
||||
@"CURRENT_TIMESTAMP, ",
|
||||
data,
|
||||
@")",
|
||||
data, @", ",
|
||||
[db quoteArray:
|
||||
(e1 = [NSArray arrayWithObjects: @"1", @"2", [NSNull null], nil])
|
||||
toString: nil
|
||||
quotingStrings: NO], @", ",
|
||||
[db quoteArray:
|
||||
(e2 = [NSArray arrayWithObjects: @"on,e", @"t'wo", @"many", nil])
|
||||
toString: nil
|
||||
quotingStrings: YES], @", ",
|
||||
[db quoteArray:
|
||||
(e3 = [NSArray arrayWithObjects: data, nil])
|
||||
toString: nil
|
||||
quotingStrings: YES], @", ",
|
||||
[db quoteArray:
|
||||
(e4 =[NSArray arrayWithObjects: @"TRUE", @"FALSE", nil])
|
||||
toString: nil
|
||||
quotingStrings: NO], @", ",
|
||||
[db quoteArray:
|
||||
(e5 = [NSArray arrayWithObjects: [NSDate date], nil])
|
||||
toString: nil
|
||||
quotingStrings: YES], @")",
|
||||
nil])
|
||||
{
|
||||
NSLog(@"Insert failed to return row count");
|
||||
}
|
||||
[db execute: @"insert into xxx "
|
||||
@"(k, char1, boolval, intval, when1, when2, b) "
|
||||
@"values ("
|
||||
|
||||
[db setDebugging: 0];
|
||||
[db query: @"select * from xxx", nil];
|
||||
[db setDebugging: 0];
|
||||
|
||||
[db execute: @"INSERT into xxx "
|
||||
@"(id, k, char1, boolval, intval, when1, when2, b) "
|
||||
@"values (2,"
|
||||
@"'hello', "
|
||||
@"'X', "
|
||||
@"TRUE, "
|
||||
|
@ -255,9 +363,9 @@ main()
|
|||
[NSData dataWithBytes: "" length: 0],
|
||||
@")",
|
||||
nil];
|
||||
[db execute: @"insert into xxx "
|
||||
@"(k, char1, boolval, intval, when1, when2, b) "
|
||||
@"values (",
|
||||
[db execute: @"INSERT into xxx "
|
||||
@"(id, k, char1, boolval, intval, when1, when2, b) "
|
||||
@"values (3,",
|
||||
[db quote: oddChars],
|
||||
@", ",
|
||||
[db quote: nonLatin],
|
||||
|
@ -270,13 +378,15 @@ main()
|
|||
nil];
|
||||
[db commit];
|
||||
|
||||
r0 = [db cache: 1 query: @"select * from xxx", nil];
|
||||
r1 = [db cache: 1 query: @"select * from xxx", nil];
|
||||
r0 = [db cache: 1 query: @"select * from xxx order by id", nil];
|
||||
r1 = [db cache: 1 query: @"select * from xxx order by id", nil];
|
||||
NSCAssert([r0 lastObject] == [r1 lastObject], @"Cache failed");
|
||||
[NSThread sleepForTimeInterval: 2.0];
|
||||
records = [db cache: 1 query: @"select * from xxx", nil];
|
||||
records = [db cache: 1 query: @"select * from xxx order by id", nil];
|
||||
NSCAssert([r0 lastObject] != [records lastObject], @"Lifetime failed");
|
||||
|
||||
db = [[[SQLClient alloc] initWithConfiguration: nil
|
||||
name: @"test"] autorelease];
|
||||
[db addObserver: l
|
||||
selector: @selector(notified:)
|
||||
name: @"foo"];
|
||||
|
@ -291,6 +401,8 @@ main()
|
|||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
|
||||
record = [records objectAtIndex: 0];
|
||||
if ([[record objectForKey: @"b"] isEqual: data] == NO)
|
||||
{
|
||||
|
@ -307,15 +419,99 @@ main()
|
|||
{
|
||||
NSLog(@"Retrieved non-latin does not match saved string");
|
||||
}
|
||||
if ([[record objectForKey: @"k"] isEqual: oddChars] == NO)
|
||||
id o = [[record objectForKey: @"k"] stringByTrimmingSpaces];
|
||||
if ([o isEqual: oddNoNul] == NO)
|
||||
{
|
||||
NSLog(@"Retrieved odd chars does not match saved string");
|
||||
NSLog(@"Retrieved odd chars (%@) does not match oddNoNul (%@)",
|
||||
o, oddNoNul);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Embedded nul correctly removed");
|
||||
}
|
||||
record = [records objectAtIndex: 0];
|
||||
o = [record objectForKey: @"extra1"];
|
||||
if ([o isEqual: e1] == NO)
|
||||
{
|
||||
NSLog(@"Retrieved extra1 (%@) does not match saved (%@)", o, e1);
|
||||
}
|
||||
o = [record objectForKey: @"extra2"];
|
||||
if ([o isEqual: e2] == NO)
|
||||
{
|
||||
NSLog(@"Retrieved extra2 (%@) does not match saved (%@)", o, e2);
|
||||
}
|
||||
o = [record objectForKey: @"extra3"];
|
||||
if ([o isEqual: e3] == NO)
|
||||
{
|
||||
NSLog(@"Retrieved extra3 (%@) does not match saved (%@)", o, e3);
|
||||
}
|
||||
o = [record objectForKey: @"extra4"];
|
||||
if ([o count] != [e4 count])
|
||||
{
|
||||
NSLog(@"Retrieved extra4 (%@) does not match saved (%@)", o, e4);
|
||||
}
|
||||
for (i = 0; i < [o count]; i++)
|
||||
{
|
||||
if ([[o objectAtIndex: i] boolValue]
|
||||
!= [[e4 objectAtIndex: i] boolValue])
|
||||
{
|
||||
NSLog(@"Retrieved extra4 (%@) does not match saved (%@)",
|
||||
o, e4);
|
||||
}
|
||||
}
|
||||
o = [record objectForKey: @"extra5"];
|
||||
if ([o count] != [e5 count])
|
||||
{
|
||||
NSLog(@"Retrieved extra5 (%@) does not match saved (%@)", o, e5);
|
||||
}
|
||||
for (i = 0; i < [o count]; i++)
|
||||
{
|
||||
if (floor([[o objectAtIndex: i] timeIntervalSinceReferenceDate])
|
||||
!= floor([[e5 objectAtIndex: i] timeIntervalSinceReferenceDate]))
|
||||
{
|
||||
NSLog(@"Retrieved extra5 (%@) does not match saved (%@)",
|
||||
o, e5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NSLog(@"Records - %@", [GSCache class]);
|
||||
|
||||
d = [NSCalendarDate date];
|
||||
[d setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 240]];
|
||||
[db begin];
|
||||
[db execute: @"create table xxx ( "
|
||||
@"id int, "
|
||||
@"when0 timestamp with time zone, "
|
||||
@"when1 timestamp with time zone, "
|
||||
@"when2 timestamp)",
|
||||
nil];
|
||||
[db execute: @"INSERT into xxx (id, when0, when1, when2) "
|
||||
@"values (99,",
|
||||
d, @", ",
|
||||
[NSDate distantPast], @", ",
|
||||
[NSDate distantFuture], @")",
|
||||
nil];
|
||||
r0 = [[db query: @"select * from xxx where id=99", nil] lastObject];
|
||||
[db execute: @"drop table xxx", nil];
|
||||
[db commit];
|
||||
|
||||
d0 = [r0 objectForKey:@"when0"];
|
||||
NSCAssert(floor([d0 timeIntervalSinceReferenceDate])
|
||||
== floor([d timeIntervalSinceReferenceDate]),
|
||||
NSInternalInconsistencyException);
|
||||
d1 = [r0 objectForKey:@"when1"];
|
||||
NSCAssert([d1 timeIntervalSinceReferenceDate]
|
||||
== [[NSDate distantPast] timeIntervalSinceReferenceDate],
|
||||
NSInternalInconsistencyException);
|
||||
d2 = [r0 objectForKey:@"when2"];
|
||||
NSCAssert([d2 timeIntervalSinceReferenceDate]
|
||||
== [[NSDate distantFuture] timeIntervalSinceReferenceDate],
|
||||
NSInternalInconsistencyException);
|
||||
}
|
||||
|
||||
NSLog(@"Pool stats:\n%@", [sp statistics]);
|
||||
|
||||
[pool release];
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue