Commit Graph

228 Commits

Author SHA1 Message Date
Anthony Tuininga 54dcf8642b Added test cases for recent ODPI-C bug fixes. 2018-02-15 11:18:15 -07:00
Anthony Tuininga 99c019d6c5 Restore support for binding a date value to datetime variable. 2018-02-02 15:44:45 -07:00
Anthony Tuininga 65580226cd Added test cases for AQ visibility and delivery modes. 2018-01-30 15:25:56 -07:00
Anthony Tuininga 6a998604ce The attribute connection.dbop is only valid with Oracle 12.1 and higher. 2018-01-11 16:24:42 -07:00
Anthony Tuininga ef60884570 Additional test cases to improve code coverage. 2018-01-11 16:24:08 -07:00
Anthony Tuininga ab4cde01b7 Use "wait" mode for acquiring connections from the pool in order to avoid
potential errors under certain circumstances.
2017-12-12 12:09:32 -07:00
Anthony Tuininga 0b408253f6 Added test for creating a connection using an existing connection's handle. 2017-12-07 15:55:13 -07:00
Anthony Tuininga a8d9b74c3a Added preliminary test cases for subscriptions. 2017-12-07 15:54:11 -07:00
Anthony Tuininga 1fe14c66dc Use safer queries for verifying connection properties. 2017-12-07 15:52:34 -07:00
Anthony Tuininga fb71f1126b Additional test cases for AQ. 2017-11-27 10:38:27 -07:00
Anthony Tuininga 011e062aa1 Added test cases for autocommit, changing passwords and the end-to-end tracing
attributes.
2017-11-27 10:37:46 -07:00
Anthony Tuininga 9377175715 Added test cases for validating object types and for preventing an attempt to
set a LOB variable at an array position that doesn't exist.
2017-11-14 11:03:11 -07:00
Anthony Tuininga 02c5f5eb5d Correct test suite when CHAR encoding is not capable of handling unicode data. 2017-11-14 11:02:41 -07:00
Anthony Tuininga d4b13eb584 Added test cases for rowids. 2017-10-24 22:03:47 -06:00
Anthony Tuininga ef201bde74 Added additional LOB function tests; skip supplemental characters test if
database character set is not AL32UTF8.
2017-10-13 19:13:42 -06:00
Anthony Tuininga 3d8b74e77f Ensure that a call to setinputsizes() with an invalid type prior to a call to
executemany() does not result in a type error, but instead gracefully ignores
the call to setinputsizes() as required by the DB API
(https://github.com/oracle/python-cx_Oracle/issues/75).
2017-09-01 16:21:28 -06:00
Anthony Tuininga 7b484bce70 Eliminate segfault when attempting to reuse a REF cursor that has been closed. 2017-08-30 11:54:33 -06:00
Anthony Tuininga 0111431430 Update ODPI-C (improve performance, correct handling of objects when dynamic
binding is being used).
2017-08-24 21:50:29 -06:00
Anthony Tuininga c2c8d541bf On Windows, sizeof(long) = 4 which means that integers between 10 and 18 digits
were not converted to Python correctly
(https://github.com/oracle/python-cx_Oracle/issues/70).
2017-08-22 21:40:21 -06:00
Anthony Tuininga 7b6276f5eb Added missing type check to prevent coercion of decimal to float
(https://github.com/oracle/python-cx_Oracle/issues/68).
2017-08-18 14:15:50 -06:00
Anthony Tuininga d1b5428879 Add information on how to run the test suite
(https://github.com/oracle/python-cx_Oracle/issues/33).
2017-08-08 15:40:05 -06:00
Anthony Tuininga 3e2dd725ad Change default connectstring to localhost/orclpdb to be consistent with the
default value used in the Oracle Database installer.
2017-08-08 15:39:02 -06:00
Anthony Tuininga 16bc500c73 All cursors and LOBs must be closed before a connection can be closed
explicitly.
2017-07-31 21:20:30 -06:00
Anthony Tuininga 1f917aafbb In certain cases where non-long values follow LOB values in the list of bind
variables, the error "ORA-24816: Expanded non LONG bind data supplied after
actual LONG or LOB column" is raised; this occurs if the length of the supplied
value, when expanded, might exceed 4000 bytes
(https://github.com/oracle/python-cx_Oracle/issues/50).
2017-07-25 12:16:54 -06:00
Anthony Tuininga 852aed3b58 Ensure that the array position passed to var.getvalue() does not exceed the
number of elements allocated in the array!
2017-07-21 15:36:31 -06:00
Anthony Tuininga 1eba9d55be Use dpiData_*() functions to simplify setting data; correct handling of
timestamp with time zone attributes.
2017-07-21 15:35:49 -06:00
Anthony Tuininga df102db935 Correct handling of CLOB/NCLOB when using different encodings. 2017-07-21 15:34:48 -06:00
Anthony Tuininga 8cc4d8607f Remove unnecessary Unicode specific tests for Python 2.7 since Python 3 now
also supports the "u" prefix; merge them instead into the main tests.
2017-07-21 15:16:24 -06:00
Anthony Tuininga 340dcb7195 Rework test suite and samples so that they are independent of each other and
so that the SQL scripts used to create/drop schemas are easily adjusted to
use different schema names, if desired. Improve documentation for test suite
and samples.
2017-07-14 16:50:41 -06:00
Anthony Tuininga 628d1717f5 Corrected support for binding boolean values with Oracle client 11.2. 2017-07-14 11:31:59 -06:00
Anthony Tuininga c1005ddcac Added test cases for AQ enqueue/dequeue options and message properties
(https://github.com/oracle/odpi/issues/16).
2017-07-13 13:57:29 -06:00
Anthony Tuininga 1d768706ab Python 2.7 requires the "u" prefix. 2017-07-08 21:23:27 -06:00
Anthony Tuininga 49b0afd7a5 Ensure the correct encoding is used for setting variable values. 2017-07-07 07:38:44 -07:00
Anthony Tuininga 18e06bf14a Corrected support for binding decimal values in object attribute values and
collection element values.
2017-07-07 07:38:15 -07:00
Anthony Tuininga 888fd89fce Update DB API test stub to match latest version of test suite and cx_Oracle. 2017-07-05 13:19:07 -06:00
Anthony Tuininga f555a10f36 Add support for Python 3 in DB API test suite stub. 2017-07-05 13:17:50 -06:00
Anthony Tuininga d008553dc1 Add script for dropping the test schemas; add copyright and information on how
to execute to the SetupTest.sql script.
2017-06-16 16:48:15 -06:00
Anthony Tuininga b543850f9a The method cursor.setoutputsize() no longer needs to do anything (since ODPI-C
automatically manages buffer sizes of LONG and LONG RAW columns).
2017-06-16 16:47:21 -06:00
Anthony Tuininga fa4faa2718 Update ODPI-C which has added an optimization to reduce buffer size when both
the client and server character sets are identical and corrected support for
BFILE LOBs.
2017-06-16 16:43:41 -06:00
Anthony Tuininga 465da44482 Permit use of both string and unicode for Python 2.7 for creating session pools
and for changing passwords
(https://github.com/oracle/python-cx_Oracle/issues/23).
2017-06-10 13:54:10 -06:00
Anthony Tuininga f4009ebabd Add tests for specifying only the encoding or only the nencoding. 2017-06-10 11:32:25 -06:00
Anthony Tuininga e783a33926 Handle case when both precision and scale are zero, as occurs when retrieving
numeric expressions (https://github.com/oracle/python-cx_Oracle/issues/34).
2017-06-09 14:21:24 -06:00
Anthony Tuininga 52e1960bfb Correct determination of the names of the bind variables in prepared SQL
tatements (which behaves a little differently from PL/SQL statements).
2017-05-19 21:47:46 -06:00
Anthony Tuininga 2e240bc154 Prevent attempts from binding the cursor being executed to itself. 2017-05-16 13:23:20 -06:00
Anthony Tuininga 51f1815167 Added support for getting/setting attributes of objects or element values in
collections that contain LOBs, BINARY_FLOAT values, BINARY_DOUBLE values and
NCHAR and NVARCHAR2 values; improve error message for any other types that are
not supported.
2017-05-09 11:46:30 -06:00
Anthony Tuininga 53f8902446 Correct handling of long Python integers that cannot fit inside a 64-bit C
integer (https://github.com/oracle/python-cx_Oracle/issues/18).
2017-05-03 13:31:13 -06:00
Anthony Tuininga c946e86384 Correct support for executemany() when strings that are found later in the
array are larger than strings found earlier in the array.
2017-04-26 17:11:58 -06:00
Anthony Tuininga 8d7c828b89 Use an object type that is supported in both 11.2 and 12.1. 2017-04-18 13:04:23 -06:00
Anthony Tuininga b429041a3e Add support for getting an empty list from an empty collection instead of the
error "OCI-22166: collection is empty".
2017-04-17 10:34:14 -06:00
Anthony Tuininga 3bc9bd2303 Added sample and test case to demonstrate use of universal rowids. 2017-04-11 16:12:06 -06:00
Anthony Tuininga 0b01d96404 Added support for smallint and float data types in Oracle objects, as requested
(https://github.com/oracle/python-cx_Oracle/issues/4).
2017-04-11 14:37:38 -06:00
Anthony Tuininga d37669fbdc Create a new variable, rather than call dpiVar_resize(), so that the variable
will be bound properly when the variable needs to be resized.
2017-04-11 14:36:47 -06:00
Anthony Tuininga 0c82e0faa0 Added support for getting the number of actual elements in a variable as well
as getting all of the values corresponding to the number of actual elements in
a variable -- primarily to improve the use of DML returning of multiple rows.
2017-04-11 14:17:55 -06:00
Anthony Tuininga 7f70d189b2 Added support for smallint and float data types in Oracle objects, as requested
(https://github.com/oracle/python-cx_Oracle/issues/4).
2017-04-04 21:17:24 -06:00
Anthony Tuininga b614a47ef2 Added copyright notices to the top of all tests and samples as requested. 2017-03-09 10:21:22 -07:00
Anthony Tuininga b28e04e901 Rework to use the ODPI-C library instead of direct OCI calls. 2017-03-07 13:21:49 -07:00
Anthony Tuininga 73f61d8a07 Raise cx_Oracle.DatabaseError, not IndexError for a scroll operation that
would position the cursor outside of the result set.
2017-02-03 09:01:47 -07:00
Anthony Tuininga 0bcbd072a8 Use None instead of 0 for items in the cursor.description attribute that do not
have any validity.
2017-01-25 15:17:20 -07:00
Anthony Tuininga 7bf8ae65ca Correct execution of test suite on Windows which doesn't support UTF-8 by
default.
2017-01-16 15:20:14 -07:00
Anthony Tuininga 8fda704186 Adjusted test cases to make use of encoding and nencoding parameters to both
standalone connection and session pool creation; added test cases for binding
and fetching supplemental characters as well as fetching temporary LOBs; tidied
up a few test cases as well.
2017-01-13 18:14:45 -07:00
Anthony Tuininga 678476f5f0 Remove unnecessary section of TNS naming string (ADDRESS_LIST). 2017-01-13 11:37:52 -07:00
Anthony Tuininga 4185d96682 Adjusted samples to be clearer and to match the tables used in the test suite;
added new samples for DRCP and input/output type handlers.
2017-01-13 10:47:20 -07:00
Anthony Tuininga c238f63b58 Tidy up documentation and remove unnecessary "tablespace users" clauses since
the default tablespace is defined anyway!
2017-01-12 15:29:31 -07:00
Anthony Tuininga ab42359f26 Fix cursor.scroll() to calculate row count correctly in all situations and
add test cases to verify that it does in fact work.
2017-01-12 15:22:29 -07:00
Anthony Tuininga 0e50be2a08 Renamed table TestExecuteMany to TestTempTable to be more in keeping with its
actual uses (not just testing executemany()).
2017-01-12 15:20:44 -07:00
Anthony Tuininga 92ec23930b Added support for initializing a collection upon creation; provided a synonym
for newobject() in simply calling the type directly (as a convenience).
2016-02-24 14:16:40 -07:00
Anthony Tuininga 9aa9de0526 Return value is not an integer -- some versions of the Oracle client use
native integers and others will use regular numbers so specify that the return
value is in fact a regular number so that the test works correctly in all
cases.
2016-02-24 10:08:43 -07:00
Anthony Tuininga 238981860c Unicode test case needs to match the normal test case! 2016-02-23 17:08:54 -07:00
Anthony Tuininga 29e5529bf9 Added setup for the test records case. 2016-02-23 16:52:06 -07:00
Anthony Tuininga d03854ccfe Added support for testing binding records in/out. Note that records must be
initialized before being bound as they are not initialized internally.
2016-02-22 09:38:34 -07:00
Anthony Tuininga f4a24f3930 Added support for PL/SQL collections of booleans (available only in 12.1). 2016-02-16 16:32:00 -07:00
Anthony Tuininga 6f52f6ce39 Added support for manipluating PL/SQL collections (both ordered and unordered). 2016-02-16 15:51:01 -07:00
Anthony Tuininga e9d5a70e25 Added preliminary support for binding collections (both SQL typed and PL/SQL
typed in Oracle 12.1).
2016-02-15 18:57:17 -07:00
Anthony Tuininga 39805c66d7 Added support for binding objects with sub objects attached to them; ensured
that instances are created when an empty object variable is created; enhanced
test cases for binding objects.
2016-02-11 11:47:46 -07:00
Anthony Tuininga cd9fced3e6 Remove deprecated variable attributes maxlength and allocelems. 2016-02-09 17:11:06 -07:00
Anthony Tuininga 3f701549c7 Correct variable references. 2016-02-05 19:37:51 -07:00
Anthony Tuininga 3eeff96403 Added support for scrollable cursors. 2016-02-05 17:19:40 -07:00
Anthony Tuininga 84cd718977 Added support for Transaction Guard by including the attributes
connection.ltxid and error.isrecoverable as well as a sample that indicates
how it could be used.
2016-01-26 14:19:45 -07:00
Anthony Tuininga ead5831ccb Added test case for the new feature getimplicitresults(). 2016-01-22 11:48:46 -07:00
Anthony Tuininga 8584a5d5f8 Simplify test suite by combining Python 2 and 3 scripts into one script that
runs on both without changes; rename ArrayDMLBatchError to Features12_1 in
preparation for adding additional 12.1 features.
2016-01-22 11:18:31 -07:00
Anthony Tuininga 2ba419ebd6 Updated test cases to use the correct names for the various assertions instead
of the deprecated names.
2016-01-21 09:59:03 -07:00
Anthony Tuininga 0e35397616 Added test case for pickling/unpickling error objects. 2016-01-21 09:43:00 -07:00
Anthony Tuininga 39e078eaf8 Display the file that is being used for the test run (useful when multiple
environments are being used).
2016-01-18 21:00:19 -07:00
Anthony Tuininga 8c1e6f68e4 Added support for binding boolean values to PL/SQL booleans -- a feature that
is only available in Oracle 12.1 and higher.
2016-01-14 21:41:36 -07:00
Anthony Tuininga 168d61670e Removed password attribute from connection and session pool objects in order
to promote best security practices (if stored in RAM in cleartext it can be
read in process dumps, for example). For those who would like to retain this
feature, a subclass of Connection could be used to store the password.
2015-07-31 14:31:13 -06:00
Anthony Tuininga 3c36e8cde3 Added support for NCHAR, FIXED_NCHAR and LONG_NCHAR, which are the same as the
types UNICODE, FIXED_UNICODE and LONG_UNICODE (now deprecated).
2015-06-06 21:01:37 -06:00
Anthony Tuininga 98886fe3bc Correct execution of tests with Oracle 11g client. 2015-04-03 22:50:31 -06:00
Anthony Tuininga 709d43b642 Added tests for Array DML and Batch Error features. 2015-02-25 22:46:11 -07:00
Anthony Tuininga c326ef1133 If NLS_LANG is not set, ensure it is set to a value that works. 2015-02-25 21:29:50 -07:00
Anthony Tuininga 2e78bc36b5 Display the build time when running tests in order to make clear what version
is actually being tested.
2015-02-25 21:28:34 -07:00
Shai Berger 991ffd6266 Added a test to expose the problem with intervals, and a fix that makes it pass 2014-12-22 00:25:21 +02:00
tchaumeny 2ea3b9d37a Made test suite Python3 compatible 2014-11-18 23:15:36 +01:00
Anthony Tuininga faadbe4730 Remove code specific to strings being 4000 characters now that Oracle 12c has
the ability to have strings up to 32k characters. This implies that using
setinputsizes() is necessary if a long string type is desired as this will not
occur automatically when the string exceeds 4000 characters. Tests are tidied
up to remove the "p_" prefix from all bind variables.
2014-09-04 22:33:08 -06:00
Anthony Tuininga 1358f1833f Avoid spurious error. 2014-05-13 13:33:15 -06:00
Anthony Tuininga 27361c5a23 Remove tabs in favor of spaces in order to be consistent with all of the other
files.
2013-10-19 22:10:23 -06:00
Anthony Tuininga d72e31ff7e Change line endings to canonical type (using eol extension). 2012-03-03 20:01:45 -07:00
Anthony Tuininga b745877709 Fix cursor description to take into account the number of bytes per character. 2011-09-28 01:17:45 +00:00
Anthony Tuininga dadf62cb9d Added tests for NCLOBs to the test suite. 2011-09-02 03:44:48 +00:00
Anthony Tuininga 0715624156 Added tests for NCLOBs to the test suite. 2011-09-02 03:27:55 +00:00
Anthony Tuininga 04f1904a7d Remove "unicode" mode and simply permit unicode to be used everywhere within
cx_Oracle; stop using "unicode" mode in the OCI as well since that appears to
have bugs in some places and doesn't really solve any problems anyway.
2011-02-19 03:50:16 +00:00
Anthony Tuininga 2a27248c94 Ensure that the data is stored as Unicode data as the original code stored the
byte string exactly as shown in Oracle 11g Release 2.
2010-01-29 05:01:08 +00:00
Anthony Tuininga 3c66a01739 Force termination with an error code if some tests fail. 2009-10-22 04:24:46 +00:00
Anthony Tuininga 4b63f554a5 Added support for running the test suite by running python setup.py test. 2009-10-21 01:24:52 +00:00
Anthony Tuininga c9c5f2316b Eliminate the spurious errors that take place because of the change in how
numbers without any constraints are represented in Oracle 11g.
2009-10-18 03:34:36 +00:00
Anthony Tuininga c6603b324d Add new attributes size, bufferSize and numElements to variable objects,
deprecating allocelems (replaced by numElements) and maxlength (replaced by
bufferSize); avoid increasing memory allocation for strings when using variable
width character sets and increasing the number of elements in a variable during
executemany(). Thanks to Don Reid for pointing out this issue.
2009-01-06 20:58:34 +00:00
Anthony Tuininga 231377127e Added support for interval day to second in Oracle, represented as Python
datetime.timedelta objects.
2008-11-25 15:59:16 +00:00
Anthony Tuininga c0aada7534 Use native line endings on all Python files. 2008-11-24 23:48:44 +00:00
Anthony Tuininga 39333aa7d4 Added additional test for errors taking place in connections acquired from a
session pool.
2008-11-11 21:21:31 +00:00
Anthony Tuininga 79f1483a28 Make the bind variables and fetch variables accessible although they need to be
treated carefully since they are used internally; return the cursor from
the execute() method as a convenience.
2008-10-24 13:56:33 +00:00
Anthony Tuininga 324a4a8824 Use struct.calcsize('P') to determine the size of a pointer rather than
depend on the value of sys.maxint which differs on 64-bit platforms.
2008-10-22 18:31:31 +00:00
Anthony Tuininga ebc2437935 Make the bind variables and fetch variables accessible although they need to be
treated carefully since they are used internally; return the cursor from
the execute() method as a convenience.
2008-10-17 16:39:30 +00:00
Anthony Tuininga 6b8ab25684 Tweak test cases to run properly under Python 3.x. 2008-10-17 04:46:26 +00:00
Anthony Tuininga 9f0125410b Cleaned up the test cases for long variables thanks to some closer looks after
they failed with Python 3.x initially.
2008-10-17 04:09:35 +00:00
Anthony Tuininga 8854fdde7d Set up test cases for Python 3.x. 2008-10-17 03:51:38 +00:00
Anthony Tuininga 4d2a8c57de Dropped support for Python 2.3. 2008-10-16 04:19:14 +00:00
Anthony Tuininga 83346b8975 Restore commented out code. 2008-10-16 03:58:53 +00:00
Anthony Tuininga d50847e92b Convert object type handling to use new cxString functions and add test case
to ensure that it was done correctly.
2008-10-16 03:25:30 +00:00
Anthony Tuininga 515bca0f96 All test cases now run correctly in Unicode mode. There are still additional
things that need to be dealt with but the majority of the code has now been
transformed to use either Unicode or encoded strings with Oracle.
2008-10-15 22:45:29 +00:00
Anthony Tuininga cee9021d81 Added support for additional test cases for full unicode support in Python 2.x;
added support for specifying on the command line a list of modules to test.
2008-10-14 22:37:38 +00:00
Anthony Tuininga 3d6a346932 Added new test case for full unicode support in Python 2.x. 2008-10-14 16:54:00 +00:00
Anthony Tuininga eae705cef1 Rename additional macro as suggested by Amaury Forgeot d'Arc; added additional
support for full Unicode; in Python 2.x allow for keyword arguments which use
strings and simply convert them to Unicode on the way through.
2008-10-14 16:53:05 +00:00
Anthony Tuininga 2e26d0beb8 Continued work on Unicode support; added new test cases for full unicode
support within Python 2.x; move away from character semantics which Oracle is
deprecating anyway to byte semantics which should hopefully eliminate the
problem with a backend character set of UTF-8.
2008-10-14 04:51:43 +00:00
Anthony Tuininga ea3def86c5 Added support for returning unicode values for nchar and nvarchar data and
for binding unicode. Thanks to Amaury Forgeot d'Arc for the initial patch.
2008-09-30 18:11:45 +00:00
Anthony Tuininga 337ae2998f Added support for proxy authentication in session pools as requested by Michal
Wegrzynek (and thanks for the initial patch as well).
2008-09-15 19:41:54 +00:00
Anthony Tuininga 8072d8971f Added support for timestamp attributes in objects. 2008-09-12 22:46:08 +00:00
Anthony Tuininga 96f7decdce Merged 9i specific setup into standard setup since Oracle 8i support is no
longer required; change tabs to spaces; add test for fixed char data types.
2008-09-12 18:37:16 +00:00
Anthony Tuininga 93490d971d Removed support for Oracle 8i since Oracle support for it was dropped long
ago and adding support for Oracle 11g features would be very difficult
while attempting to retain Oracle 8i support.
2008-06-28 04:44:04 +00:00
Anthony Tuininga 104e11b67a Last public release from Computronix. 2007-06-13 21:15:16 +00:00