Skip to content

Commit

Permalink
Fix whitespace issues (ibmdb#344)
Browse files Browse the repository at this point in the history
* Fix whitespace issues

- Remove tabs and re-indent to 4 spaces to comply with PEP-8
- Remove trailing whitespace
- Use Unix line endings. Users on Windows should set core.autocrlf:
  https://help.github.com/articles/dealing-with-line-endings/#platform-windows

Signed-off-by: Kevin Adler <[email protected]>

* Remove unneded continuation markers

Signed-off-by: Kevin Adler <[email protected]>
  • Loading branch information
kadler authored and SabaKauser committed Mar 7, 2019
1 parent c715071 commit 8dacbb0
Show file tree
Hide file tree
Showing 168 changed files with 14,745 additions and 14,746 deletions.
22 changes: 11 additions & 11 deletions IBM_DB/.project
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>IBM_DB</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>IBM_DB</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
62 changes: 31 additions & 31 deletions IBM_DB/ibm_db/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ Change Log
=============

2007/12/04 (setup.py 0.2.0):
- added the ability to create Python Eggs by running:
- added the ability to create Python Eggs by running:
$ python setup.py bdist_egg

2008/02/08 (setup.py 0.2.5, ibm_db-0.2.5, ibm_db_dbi-0.2.5):
- added support for ibm_db_sa-0.1.0 SQLAlchemy-0.4 adapter release

2008/02/15 (setup.py 0.2.6, ibm_db-0.2.5, ibm_db_dbi-0.2.5):
- fixed .egg setup loading issue #1 (defect #154259)
- fixed .egg setup loading issue #1 (defect #154259)

2008/03/06 (setup.py 0.2.7, ibm_db-0.2.7, ibm_db_dbi-0.2.7):
- fixed error handling for execute when connection handle is invalid (defect #151164)

Expand All @@ -27,10 +27,10 @@ only optimize for N rows issue #2 (defect #154260)

2008/07/16 (setup.py 0.2.9.1, ibm_db-0.2.9.1, ibm_db_dbi-0.2.9.1):
- fixed Compilation fail on DB2 versions < 9 due to SQL_DECFLOAT declaration ( defect #162728)

2008/08/24 (setup.py 0.3.0, ibm_db-0.3.0, ibm_db_dbi-0.3.0):
- Added trusted context support in driver.

2008/10/08 (setup.py 0.4.0, ibm_db-0.4.0, ibm_db_dbi-0.4.0):
- fixed memory leak in fetch_assoc issue #13 (defect #165205)
- fixed reference counting errors in _python_ibm_db_bind_fetch_helper issue #14 (defect #167122)
Expand All @@ -39,7 +39,7 @@ only optimize for N rows issue #2 (defect #154260)

2008/11/05 (setup.py 0.4.1, ibm_db-0.4.1, ibm_db_dbi-0.4.1):
- Added zOS and iSeries(System i) support.

2009/02/16 (setup.py 0.6.0, ibm_db-0.6.0, ibm_db_dbi-0.6.0):
- New feature - Unicode support for driver and wrapper (defect #166036)
- New Feature - DB2 on MacOS support (both Client and Server)
Expand All @@ -49,24 +49,24 @@ only optimize for N rows issue #2 (defect #154260)
- decfloat support (defect #95795)
- Code clean up and formatting.
- Test cases renamed to reflect their functions.

2009/03/16 (setup.py 0.7.0, ibm_db-0.7.0, ibm_db_dbi-0.7.0):
- Fixed Graphic column returning nil problem (defect #172150)
- Removed warnings while building driver (defect #163787)
- Fixed ibm_db.set_option() failing if unicode is passed to dictionary. (defect #172432)
- Code clean up and formatting.
- Code clean up and formatting.

2009/05/11 (setup.py 0.7.2, ibm_db-0.7.2, ibm_db_dbi-0.7.2):
- Memory cleanup - Fixed a lot of issues leading to memory leaks.
- New Feature - Added support for SQLRowCount to return correct results on select queries.
DB2 supports this from DB2 V95FP3 onwards. See test cases 17,18,19 for samples. (defect #173237)

2009/05/27 (setup.py 0.7.2.1, ibm_db-0.7.2.1, ibm_db_dbi-0.7.2.1):
- Fixed Backward Compatibility issue with SQLROWCOUNT (defect #185120)

2009/06/25 (setup.py 0.7.2.5, ibm_db-0.7.2.5, ibm_db_dbi-0.7.2.5):
- Support for inserting BigInt numbers in bigInt type column with prepare statement (defect #184705)

2009/09/03 (setup.py 0.8.0, ibm_db-0.8.0, ibm_db_dbi-0.8.0):
- Added new API "callproc" to support stored procedure (defect#183022)- Refer test cases for samples and "http://code.google.com/p/ibm-db/wiki/APIs" for API Usage
- support OUT variable in stored procedure
Expand All @@ -89,7 +89,7 @@ only optimize for N rows issue #2 (defect #154260)

2010/04/28 (setup.py 1.0.2, ibm_db-1.0.2, ibm_db_dbi-1.0.2)
- Fixed issues with Integer argument in AIX (defect #197018)
- Fixed Performance issues with dbi wrapper (defect #206854)
- Fixed Performance issues with dbi wrapper (defect #206854)

2010/08/06 (setup.py 1.0.3, ibm_db-1.0.3, ibm_db_dbi-1.0.3)
- Added Decimal object support in ibm_db Driver (defect #212225)
Expand All @@ -102,13 +102,13 @@ only optimize for N rows issue #2 (defect #154260)
- Modified executemany function of ibm_db_dbi adaptor to use ibm_db's execute_many API(defect #225894)
- Fixed cursor.description for fetching multiple resultset(defect #225938)
- Fixed error handling for insertion of clob data in ibm_db Driver(defect #225892)

2011/09/06 (setup.py 1.0.5, ibm_db-1.0.5, ibm_db_dbi-1.0.5)
- Added new API's createdb, dropdb, recreatedb, createdbNX in ibm_db Driver and ibm_db_dbi wrapper (defect #231289 & #231293)
- Added new test cases for createdb, dropdb, recreatedb, createdbNX APIs (defect #231289)
- Fixed execute_many API doesn't gives relevent error message when non homogeneous array value arguments passed(defect #231294)
- Modified test_execute_many.py test case to test ERROR message also. (defect #231294)

2012/05/24 (setup.py 1.0.6, ibm_db-1.0.6, ibm_db_dbi-1.0.6)
- Fixed: Python crashed instead of raising Error message when trying to insert non numeric string to Integer Field on executemany of dbi wrapper ( issue #86)
- Added an option in connect and pconnect API to turned OFF CLI numeric literal feature. (issue #87)
Expand All @@ -124,35 +124,35 @@ only optimize for N rows issue #2 (defect #154260)
- Fixed: OverflowError on Long Integer in Decimal-Field (defect #240445)
- Fixed: Stored procedure truncates string-parameter (defect #240445)
- Added a environment variable IBM_DB_HOME to make the installation process easy (defect #240445)

2012/09/21 (setup.py 2.0.0, ibm_db-2.0.0, ibm_db_dbi-2.0.0)
- New Feature - Added Python-3.x support for driver and wrapper (defect #243457)
- Fixed: Resource leak over the lifetime of connection objects in wrapper (issue #120)
- Enhanced: Strict type checking for connection and statement object.
- Fixed: Allow trial license to connect ZOS/i5(defect #243556)

2013/02/03 (setup.py 2.0.1, ibm_db-2.0.1, ibm_db_dbi-2.0.1)
- Fixed: Retrieving NULL CLOB/XML/BLOB values(issue #121, #125)
- Fixed: free_stmt() not able to free stmt resources(issue #124)

2013/03/04 (setup.py 2.0.2, ibm_db-2.0.2, ibm_db_dbi-2.0.2)
- Fixed: Memory leak with LONGVARCHAR (defect #248442)
- Fixed: Handling of CLOB datatype in execute_many function (defect #248442)
- Enhanced: Keeps weakref of open cursor in connection's _cursor_list (defect #248442)
- Enhanced: dbi cursor is now compatible to the iteration protocol (defect #248442)

2013/06/17 (setup.py 2.0.3, ibm_db-2.0.3, ibm_db_dbi-2.0.3)
- Fixed: Performance issue due to datetime, date, time conversion inside dbi wrapper. ibm_db driver now returns datetime, date, time object for TIMESTAMP, DATE, TIME field type correspondingly instead of string object
- Enhanced: ibm_db driver are now capable to handle datetime, date, time object
- Fixed: Now quoted literal replacement off by default
- Enhanced: Added a new method in ibm_db to check indicated column in result set is nullable or not, cursor's description of ibm_db_dbi now keep the nullable column info also
- Fixed: callproc api now return long type object instead of string for BIGINT field type
- Added: New test case test_InsertRetrieveDateTimeTypeColumn.py for handling of datetime object in ibm_db driver

2013/09/11 (setup.py 2.0.4, ibm_db-2.0.4, ibm_db_dbi-2.0.4)
- Fixed: ISO8601 datetime with 'T' delimiter (defect #495080)
- Fixed: Build error for Python-3.3.x with Visual Studio (defect #495080)

2013/09/25 (setup.py 2.0.4.1, ibm_db-2.0.4.1, ibm_db_dbi-2.0.4.1)
- Fixed: unicode ISO8601 datetime with 'T' delimiter (defect #495340)
- Modified test_6792_FieldTypeRetStrDatetimeTimestamp.py test case to add test for ISO8601 with 'T' delimiter (defect #495340)
Expand All @@ -161,8 +161,8 @@ only optimize for N rows issue #2 (defect #154260)
- Enhanced: Performance of query involving LOBs fields (defect #498081)
- Added: SQL_ATTR_INFO_PROGRAMNAME connection attribute (issue #144)
- Fixed: Unhashable type issue with 'DBAPITypeObject' (issue #145)
- Fixed: Tests adjustments for IBM Informix (issue #139)
- Fixed: Tests adjustments for IBM Informix (issue #139)

2015/01/01 (setup.py 2.0.5.1, ibm_db-2.0.5.1, ibm_db_dbi-2.0.5.1)
- Enhanced installation to pull IBM Data Server Driver automatically if not present

Expand All @@ -173,23 +173,23 @@ only optimize for N rows issue #2 (defect #154260)
- Fixed: Return relevant error message in case of closed connection (Issue #167)
- Fixed: Mac support enhancements to setup.py (Issue #184)
- Fixed: renamed README to README.md and updated setup.py

2016/03/23 (setup.py 2.0.7, ibm_db-2.0.7, ibm_db_dbi-2.0.7)
- Retrieve last serial value for IDS using get_last_serial_value() API.
- SQL_ATTR_QUERY_TIMEOUT keyword support using ibm_db.set_option:
- SQL_ATTR_QUERY_TIMEOUT keyword support using ibm_db.set_option:
- test_warn.py for ibm_db.stmt_warn()
- ibm_db binaries for python 3.5 on windows

2016/10/13
- Added: New attribute USE_WCHAR with values WCHAR_YES(default) and WCHAR_NO
Setting this attrbiute to WCHAR_NO would result in using char bind-in as against current default wchar.
- Added: New API set_fix_return_type(1(default)|0) to allow/disallow additional formatting of decimal and blob data.

2016/11/17
- Added: Correct OUTPUT TIMESTAMP Parameters behavior in ibm_db.callproc API for stored procedure calls.
- Added: Correct OUTPUT TIMESTAMP Parameters behavior in ibm_db.callproc API for stored procedure calls.

2017/08/09 (ibm-db 2.0.8)
-Python 3.6.x support for ibm_db.
-Python 3.6.x support for ibm_db.

2018/08/06 (ibm_db-2.0.9)
-Python 3.7.0 support for ibm_db
Expand All @@ -199,5 +199,5 @@ only optimize for N rows issue #2 (defect #154260)
-add support for DBCLOB in ibm_db_dbi - PR307
-process unique persistent connections - PR278
-Added new contribution guidelines - PR275
-enable travis CI

-enable travis CI
2 changes: 1 addition & 1 deletion IBM_DB/ibm_db/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include ibm_db.h ibm_db.c
include CHANGES LICENSE README.md
include config.py.sample
recursive-include tests *.py *.png *.jpg
recursive-include tests *.py *.png *.jpg
include MANIFEST.in
recursive-include clidriver *
recursive-include ibm_db_dlls *
Expand Down
50 changes: 25 additions & 25 deletions IBM_DB/ibm_db/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Installing ibm_db and ibm_db_dbi module
# Installing ibm_db and ibm_db_dbi module

We are assuming that you have Python already installed. In Linux you may need the python-dev package (you can install python-dev package through "$yum install python-devel" if yum doesn't work then you can also install it through "$apt-get install python-dev")

Note:The minimum python version supported by driver is python 2.7 and the latest version supported is python 3.7.
## Installation


## Installation
```
pip install ibm_db
pip install ibm_db
or
easy_install ibm_db
```
This will install *ibm_db* and *ibm_db_dbi* module.

If you face problems due to missing python header files, you would need to install python developer package before installing python ibm_db driver.
e.g:
```
zypper install python-devel
zypper install python-devel
or
yum install python-devel
```
```

### Environment Variables

Expand All @@ -30,7 +30,7 @@ e.g:
Set this environment variable to avoid automatic downloading of the clidriver during installation. You could set this to the installation path of ODBC and CLI driver in your environment. The list of supported platforms and installation file names are listed in the table under License requirements.


### IBM_DB and DB-API wrapper (ibm_db_dbi) sanity test
### IBM_DB and DB-API wrapper (ibm_db_dbi) sanity test

```python
$ python
Expand Down Expand Up @@ -80,7 +80,7 @@ Following are the details of the client license versions that you need to be abl
|Sun | i86pc |sunamd64_odbc_cli.tar.gz | Yes | V10.5 |
| | |sunamd32_odbc_cli.tar.gz | Yes | V10.5 |
| | sparc |sun64_odbc_cli.tar.gz | Yes | V11.1 |
| | sparc |sun32_odbc_cli.tar.gz | Yes | V11.1 |
| | sparc |sun32_odbc_cli.tar.gz | Yes | V11.1 |



Expand All @@ -94,7 +94,7 @@ Traceback (most recent call last):
ImportError: dlopen(/usr/local/lib/python3.5/site-packages/ibm_db.cpython-35m-darwin.so, 2): Library not loaded: libdb2.dylib
Referenced from: /usr/local/lib/python3.5/site-packages/ibm_db.cpython-35m-darwin.so
Reason: image not found

```

You would need to set DYLD_LIBRARY_PATH to point to lib folder as per the installation location of clidriver in your environment. Assuming the driver is installed at /usr/local/lib/python3.5/site-packages/clidriver, you can set the path as:
Expand All @@ -115,7 +115,7 @@ If you hit following error while attempting to connect to a database:
>>> ibm_db.connect("my_connection_string", "", "")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
Exception: [IBM][CLI Driver] SQL1042C An unexpected system error occurred. SQLSTATE=58004 SQLCODE=-1042
Exception: [IBM][CLI Driver] SQL1042C An unexpected system error occurred. SQLSTATE=58004 SQLCODE=-1042
```
Set DYLD_LIBRARY_PATH to point to icc folder as per the installation location of clidriver in your environment.

Expand All @@ -139,7 +139,7 @@ export DYLD_LIBRARY_PATH=/usr/local/lib/python3.5/site-packages/clidriver/lib/ic

# Testing

Tests displaying Python ibm_db driver code examples are located in the tests
Tests displaying Python ibm_db driver code examples are located in the tests
directory. A valid config.py will need to be created to configure your DB2
settings. A config.py.sample exists that can be copied and modified for your
environment.
Expand All @@ -158,32 +158,32 @@ port = 50000 # Port Number

Point the database to mydatabase as created by the following command.

The tests that ibm_db driver uses depends on a UTF-8 database. This can be
The tests that ibm_db driver uses depends on a UTF-8 database. This can be
created by running:
```
CREATE DATABASE mydatabase USING CODESET UTF-8 TERRITORY US
```
Some of the tests utilize XML functionality only available in version 9 or
later of DB2. While DB2 v8.x is fully supported, two of the tests
(test_195.py and test_52949.py) utilize XML functionality. These tests will
```
Some of the tests utilize XML functionality only available in version 9 or
later of DB2. While DB2 v8.x is fully supported, two of the tests
(test_195.py and test_52949.py) utilize XML functionality. These tests will
fail on version 8.x of DB2.

## Running the driver testsuite on Linux
In order to run the entire python driver testsuite on Linux, run this
In order to run the entire python driver testsuite on Linux, run this
command at the command prompt:
```
python tests.py
```
To run a single test, set the environment variable, **SINGLE_PYTHON_TEST**, to
```
To run a single test, set the environment variable, **SINGLE_PYTHON_TEST**, to
the test filename you would like to run, followed by the previous command.

## Running the driver testsuite on Windows
In order to run the entire python driver testsuite on Windows, run this
In order to run the entire python driver testsuite on Windows, run this
command at the command prompt:
```
tests.py
```
To run a single test, set the environment variable, **SINGLE_PYTHON_TEST**, to
To run a single test, set the environment variable, **SINGLE_PYTHON_TEST**, to
the test filename you would like to run, followed by the previous command.


Expand Down
20 changes: 10 additions & 10 deletions IBM_DB/ibm_db/config.py.sample
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
test_dir = 'tests' # Location of testsuite file (relative to current directory) (Don't change this.)
test_dir = 'tests' # Location of testsuite file (relative to current directory) (Don't change this.)

database = 'sample' # Database to connect to. Please use an empty database for best results.
user = 'db2inst1' # User ID to connect with
password = 'password' # Password for given User ID
hostname = 'localhost' # Hostname
port = 50000 # Port Number
database = 'sample' # Database to connect to. Please use an empty database for best results.
user = 'db2inst1' # User ID to connect with
password = 'password' # Password for given User ID
hostname = 'localhost' # Hostname
port = 50000 # Port Number

auth_user = 'auth_user' # Authentic user of Database
auth_pass = 'auth_pass' # Password for Authentic user
tc_user = 'tc_user' # Trusted user
tc_pass = 'tc_pass' # Password to trusted user
auth_user = 'auth_user' # Authentic user of Database
auth_pass = 'auth_pass' # Password for Authentic user
tc_user = 'tc_user' # Trusted user
tc_pass = 'tc_pass' # Password to trusted user
Loading

0 comments on commit 8dacbb0

Please sign in to comment.