summaryrefslogtreecommitdiff
path: root/adodb.inc.php
AgeCommit message (Collapse)AuthorFilesLines
2016-01-02Update version 5.21.0-dev release year to 2016Damien Regad1-2/+2
2015-12-27Update version to avoid merge conflictsDamien Regad1-2/+2
2015-12-22Define default constructor in ADOConnection base classDamien Regad1-0/+11
Avoids PHP Fatal error: Cannot call constructor in postgres driver. Fixes #172
2015-12-14Merge branch 'hotfix/5.20.1'Damien Regad1-5/+19
2015-12-06Bump version to 5.20.1v5.20.1Damien Regad1-2/+2
2015-12-03ADOConnection::Version() now handles SemVerDamien Regad1-5/+14
In the past, ADOdb versions were numbered X.YY, and hot fixes were identified by an optional letter suffix, e.g. 5.17, 5.18a. Starting with 5.20, we switched to Semantic Versioning. The regex in ADOConnection::Version() was not adjusted to reflect this, and the function incorrectly returns '5.20' instead of '5.20.0'. The code now correctly handles SemVer version numbers, and also allows the following pre-production suffixes: dev, alpha, beta, rc; the last 3 must be followed by an additional version number (e.g. 5.21.0-beta.1). In case the ADOdb version string (defined in $ADODB_vers global) does not match the regex, the function outputs a warning and falls back to returning a substring starting with 1st character (excluding leading 'v' if present), until the first whitespace or the end of the string). Fixes #164
2015-12-01Fix PHP Warning in GetAssoc() on empty recordsetDamien Regad1-0/+5
Regression introduced in v5.20.0. Commit 32a479a182c86f4b15c337ca6b1d3f4b967e37a8 removed the is_array() check, resulting in a PHP warning when calling array_keys() on an empty recordset, since $this->fields is false in this case. Fixes #162
2015-11-28Bump version to 5.21devDamien Regad1-2/+2
2015-11-28Bump version to 5.20.0v5.20.0Damien Regad1-2/+2
2015-11-26Adjust header comment blocksDamien Regad1-6/+8
- running SED script - manual adjustments for files not processed by regex
2015-10-25new public method setConnectionParameter fixes ↵Mark Newnham1-1/+26
https://github.com/ADOdb/ADOdb/pull/158
2015-09-14Release Recordset when raising exceptionpyscht1-0/+4
Fixes #143 Signed-off-by: Damien Regad <dregad@mantisbt.org>
2015-09-11Fix incorrect handling of input array in Execute()Damien Regad1-0/+13
When executing a query that does not expect any parameters with a non-empty input array, the parameters are added at the end of the query. Example: - $db->Execute('select * from table where id=', 1); expected: failure (extra param, invalid query) actual: execution of 'select * from table where id=1' - $db->Execute('select * from table where id=1', 1); expected: failure (extra param) actual: execution of 'select * from table where id=11' This has been confirmed to occur using mysqli driver, but could possibly affect others drivers with _bindInputArray = false as well. Execute() now issues an error when the number of provided input parameters does not match what the query expects. Thanks to peterdd for the initial research and proposed fix. Fixes #146
2015-09-09ADOConnection::GetCharSet now returns charSet propertyDamien Regad1-4/+4
2015-09-09Set charSet in ADOConnection::SetCharSetAndreas Fernandez1-1/+2
Prior to this every driver needed to define their own SetCharSet method, because the original method just returned FALSE. The charset is now set in the base class method. This commit squashes the 2 patches provided in PR #39. Signed-off-by: Damien Regad <dregad@mantisbt.org>
2015-09-09Restore check for ADOdb ExtensionDamien Regad1-1/+3
This line was inadvertantly removed in commit 016dea3c70a7e2bd146907213f050931a8fbf684 This would most likely not have had any impact on recent version of ADOdb, since the extension has not been supported for many years.
2015-08-11Fix#139: Remove PHP 4 ConstructorsValentin Sheyretski1-4/+4
This is the original commit from @valioz, rebased on latest master Signed-off-by: Damien Regad <dregad@mantisbt.org> Conflicts: drivers/adodb-db2ora.inc.php drivers/adodb-mssqlpo.inc.php drivers/adodb-odbc_oracle.inc.php
2015-08-04Fix #105: error in _Execute() functionmike.benoit1-6/+8
Commit 41839f5c18abe262ee088f1d4bd92453616d2a4a (fix for #88) introduced a regression, causing error in some cases, for example "oci_execute() expects parameter 1 to be resource, string given". This resolves the problem by only attempting str_replace() on strings rather than arrays. Signed-off-by: Damien Regad <dregad@mantisbt.org> Original patch was modified to wrap long comments and improve commit message.
2015-06-25GetAssocKeys() convert case regardless of fetch modeDamien Regad1-10/+8
Commit 9d47b60bc746076bef8453a99b8d0ee97b5999ac limited case conversion to when the recordset was in associative fetch mode; this introduced a regression, causing the unit tests to fail. We now convert the case systematically (i.e. also when fetch mode is ADODB_FETCH_NUM).
2015-06-25Move _updatefields() method to ADORecordSetDamien Regad1-0/+28
Currently, this method only exists in postgres7, oci8 and derived drivers. Moving it to the base class will enable reuse by other drivers that need the functionality.
2015-06-25New method ADORecordSet::AssocCaseConvertFunction()Damien Regad1-11/+20
- Avoid code duplication - optimize ADORecordSet_assoc_postgres7::_updatefields()
2015-06-25Fix PHP notice in GetAssocKeys()Damien Regad1-4/+1
2015-06-25Fix GetRowAssoc() default key caseDamien Regad1-2/+2
GetRowAssoc() and GetAssocKeys() parameter now defaults to ADODB_ASSOC_CASE instead of ADODB_ASSOC_CASE_UPPER, which ensures we're able to properly bind data when using lowercase field names. Adjusts the test case accordingly. Fixes #98
2015-06-25Fix recordset returning no data in assoc fetch modeDamien Regad1-2/+1
Fixes #20
2015-06-25Move check for bind array definition to GetAssocKeys()Damien Regad1-3/+5
2015-06-25Use recordset's fetch mode to determine assoc caseDamien Regad1-7/+27
When buidling the bind array in GetAssocKeys(), we now use the ADORecordSet's fetchMode property to determine the case conversion function to use (if any), and only apply it when necessary.
2015-05-15Removed commented out definition of ADODB_ASSOC_CASEDamien Regad1-5/+3
The constant is set to ADODB_ASSOC_CASE_NATIVE within ADONewConnection(), if it is not previously defined.
2015-05-15Use ADODB_ASSOC_CASE_xxx constantsDamien Regad1-1/+1
2015-05-15Fix incorrect behavior for GetAssoc()Damien Regad1-1/+4
Commit 52a1d8f473d90ec7f46d27a9b0439478e74659a9 introduced a regression. The fix did not properly consider that the purpose of the isset tests was to determine whether the recordset's fields was a numerically 0-based indexed array. As a consequence, when calling GetAssoc() in ADODB_FETCH_ASSOC mode with data like array('adodb', '0'), $numIndex was incorrectly set to True, leading to an 'Undefined offset' PHP notice and wrong return value array(0=>null) instead of array('adodb'=>'0'). Fixes #101
2015-05-04Improve documentation of fetch mode and assoc caseDamien Regad1-12/+29
Update comments in the code as well as the documentation to describe ADODB_FETCH_* and ADODB_ASSOC_CASE_ constants. Added description of each case and usage hints.
2015-04-20Define DB_AUTOQUERY_* constants in main includeDamien Regad1-0/+8
They were previously defined in adodb-pear.inc.php, which doesn't make much sense since they are only referenced within adodb.inc.php. Fixes #49
2015-04-20Unset global variable after useDamien Regad1-1/+3
No point in cluttering global workspace with a variable that is not used anywhere after initial setup.
2015-04-20When flushing cache, initialize it if it is not setDamien Regad1-1/+2
Fixes #57
2015-04-20mssql datetime2 metatype mappingMarcelTO1-0/+1
Adds the mssql datatype datetime2 to the metatype mapping. Prevents date time errors caused by the field being treated as a long. Signed-off-by: Damien Regad <dregad@mantisbt.org>
2015-04-20Parse port out of hostname if specified when connectingAndy Theuninck1-0/+6
- ADOConnection::Connect - ADOConnection::PConnect Fixes #63 Signed-off-by: Damien Regad <dregad@mantisbt.org>
2015-04-20Add support for pagination with complex queriesMike Benoit1-0/+5
There are cases where ADODB is not be able to figure out the proper count(*) queries for PageExecute() on its own. To work around this problem, ADOdb now handles a new keyword "_ADODB_COUNT" that can be wrapped around the parts of the SQL query that should be replaced with "COUNT(*)"; the code will remove everything between and including the _ADODB_COUNT keywords and replace it with COUNT(*). The _ADODB_COUNT tags are of course removed when COUNT(*) is not needed. Example usage: SELECT _ADODB_COUNT col1, col2, col3, ( select col4 from table2 where col1=col2 ) col4, _ADODB_COUNT FROM table1 LEFT JOIN ( select col5 from table3 where col3=col4 ) AS tmp; Original 2012 bug report: http://phplens.com/lens/lensforum/msgs.php?id=19058 The fix has been in use since that time in hundreds of thousands of production installations. Fixes #88 Signed-off-by: Damien Regad <dregad@mantisbt.org>
2015-04-20Move() method returns false if given row is < 0Mike Benoit1-0/+5
Signed-off-by: Damien Regad <dregad@mantisbt.org> Mike's original commit was split into distinct elements.
2015-03-04Fixed Including of memcache library only once for PHPUnit 4.xAlan Farquharson1-1/+1
Signed-off-by: Damien Regad <dregad@mantisbt.org>
2014-10-01Fix syntax errorDamien Regad1-2/+0
2014-09-26Coding guidelines / whitespaceDamien Regad1-1025/+1308
2014-09-26Coding guidelinesDamien Regad1-34/+35
2014-09-26Replace useless variable $false by falseDamien Regad1-47/+41
2014-09-26Improve compatability of ADORecordSet_emptySjan Evardsson1-0/+8
Added methods to ADORecordSet_empty to improve compatability with other ADORecordSet_* types. resolves #43, PR #45 Signed-off-by: Damien Regad <dregad@mantisbt.org>
2014-08-07Remove undefined variable referenceDamien Regad1-2/+2
Fixes #24
2014-08-07Convert files from ISO-8859-1 encoding to UTF-8Damien Regad1-5/+5
Fixes #32
2014-05-12Fix version match regexDamien Regad1-1/+1
There was a small mistake in the version matching regex introduced in commit 30c21280a48680c079f825af6583793928d65cf5, causing the function to trigger a system notice and only return 'V' instead of the actual version number. Fixes #16
2014-05-07WhitespaceDamien Regad1-13/+13
2014-05-07Use constants in switch statementDamien Regad1-3/+3
2014-05-07AutoExecute does not respect empty ResultSet in case of UpdateDamien Regad1-3/+6
Fixes #13
2014-05-07Simplify code to determine AutoExecute's return valueDamien Regad1-4/+1