| Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
The PHP native `$php_errormsg` variable has been deprecated as of PHP
7.2. The recommended replacement is `error_get_last()`.
A number of the driver classes used `$php_errormsg` to track if a DB
action caused an error.
As the `error_get_last()` function returns an array and comparing the
message therefore is slightly more involved, two new methods have been
introduced into the abstract parent class `ADOConnection` to handle the
message comparison.
The `resetLastError()` method retrieves the initial (old) error message
and resets it to enable checking whether a new error has occurred, even
when the new error is the same as the previous one.
The new `getChangedErrorMsg()` method compares the old error message
with the current one to determine whether a new message has occurred,
and if so, returns the message.
Refs:
* http://php.net/manual/en/migration72.deprecated.php#migration72.deprecated.track_errors-and-php_errormsg
* http://php.net/manual/en/reserved.variables.phperrormsg.php
* http://php.net/manual/en/function.error-get-last.php
Additional notes:
* In the `ADODB_ads::UpdateBlob()` method, the original (old) message
was not being retrieved which could result in an unrelated error being
recorded. This has been fixed.
* In the `ADODB_db2::_connect()` and `ADODB_db2::_pconnect()` methods,
the `$php_errormsg` was being reset, but subsequently not checked for
changes, so as the variable in effect was not being used, I've removed
the related code.
* In the `ADODB_sybase::ErrorMsg()` method, the `$php_errormsg` was
being checked, but no functions which could potential cause errors are
being called. As `$php_errormsg` is only available in the scope an
error occurred in, this meant that `$php_errormsg` would always be
empty, so I've removed the related code.
Fixes #409
|
|
The `dl()`has been removed/disabled in most SAPIs since PHP 5.3, so
chances of it being available are rather slim.
> 7.0.0 dl() is disabled in PHP-FPM.
> 5.3.9 dl() is enabled in PHP-FPM, albeit discouraged.
> 5.3.0 dl() is now disabled in some SAPIs due to stability issues.
> The only SAPIs that allow dl() are CLI and Embed. Use the Extension
> Loading Directives instead.
Ref: http://php.net/manual/en/function.dl.php#refsect1-function.dl-changelog
Fixes #406
|
|
Magic quotes were removed from PHP in v5.4.0.
The return value of `get_magic_quotes_runtime()` will be 0 if
`magic_quotes_runtime` is off, 1 otherwise. And as of PHP 5.4.0, it will
always returns `false`.
This minor change prevents trying to set the ini value when the ini
rective is not available and cleans up some old/unused/commented out
code.
Refs:
* http://php.net/manual/en/info.configuration.php#ini.magic-quotes-runtime
* http://php.net/manual/en/function.get-magic-quotes-runtime.php
Fixes #407
Signed-off-by: Damien Regad <dregad@mantisbt.org>
Minor changes to original commit message
|
|
|
|
|
|
The `SelectLimit` function has a potential SQL injection vulnerability
through the use of the `nrows` and `offset` parameters which are not
forced to integers.
This is a follow-up on #311, and fixes all remaining drivers that do not
use ADOConnection::SelectLimit().
Fixes #401
Signed-off-by: Damien Regad <dregad@mantisbt.org>
Original commits squashed, message reworded. Fixed whitespace.
|
|
The same is done (at least for `$nrows`) in the `SelectLimit` method of `Adodb/adodb.inc.php`.
This lowers the risk of SQL injection.
Fixes #311
(cherry picked from commit 7d43989dc95fd00fcf3ba73e08fdaf56ffa4f3e5)
|
|
Cherry-pick + squash of commits
- 5c5ee9e953dd0caf978630b1c3147447d6cb58a7
- c8524bb3fcd291fe6233643fb43e9ceeb8aef925
|
|
Reserved variable $php_errormsg is deprecated in PHP 7.2
http://php.net/manual/en/reserved.variables.phperrormsg.php
Fixes #405
|
|
create_function() is deprecated in PHP 7.2
http://php.net/manual/en/function.create-function.php
Fixes #404
|
|
Fixes #373
|
|
Backported from d9cc6c66ec08e5a517f8fa4503345ead992e2a62. I meant to do
this in 5.20.10 but I forgot...
Fixes #373
|
|
|
|
|
|
5.20.0 was released in November 2015, everybody should have migrated
by now...
|
|
|
|
|
|
Packagist.org complained about invalid data in composer.json:
'License "LGPL-2.1" is a deprecated SPDX license identifier, use
"LGPL-2.1-only" or "LGPL-2.1-or-later" instead'.
README.md and LICENCE.md were updated accordingly.
|
|
To avoid unwanted information disclosure if an error occurs when
loading a database driver, we should not output the full path in the
error message.
Fixes #389
|
|
Fixes #371
Signed-off-by: Damien Regad <dregad@mantisbt.org>
Changes from original pull request:
- suppress errors in _connect() also
- commit message reworded
|
|
|
|
This way if the connection fails, the error can be captured and used as
intended. Without this, mysqli_real_connect() triggers a PHP warning.
Fixes #348
|
|
We had a problem in our app using the pdo_sqlsrv driver with PHP 7 that
manifested itself by a ODBC32.dll crash at the end of a PHP request
(see issue: https://github.com/Microsoft/msphpsql/issues/434).
It seems the dll tried to free a statement after the connection had been
disconnected.
We looked at our code and the ADOdb code to see if a reference to a
statement could imply that it would be garbage-collected after the PDO
disconnection.
We found that `ADODB_pdo#_query` returns a statement to
`ADOConnection#_Execute` which stores it in its `_queryID` property and
never empties it explicitly.
Setting it to `false` in `ADOConnection#Close` seems to fix the problem
in our app.
Fixes #379
|
|
Fixes #316
|
|
Add SetAutoCommit() method for PDO drivers.
Avoids PDO Error: The auto-commit mode cannot be changed for this driver
Fixes #347
|
|
Currently the _ADODB_ALIAS_ is only used for postgres and mysql, but
it's also necessary for mssql, otherwise the query assigned to
$rewritesql on line 422 fails and produces the following warning:
PHP Warning (2): mssql_query(): message: Incorrect syntax near ')'.
(severity 15) in /usr/share/php/adodb/drivers/adodb-mssql.inc.php on
line 832
Fixes #359
Signed-off-by: Damien Regad <dregad@mantisbt.org>
Original commit amended to split long line.
|
|
Given year can only be less than 3000 or greater than 1000.
Fixes #375
|
|
|
|
|
|
Regression introduced by 7c758c3cbb9ecc639f5744d991e8a6d5c35e5be4.
Fixes #305
|
|
|
|
Includes fixes to 5.20.2 and 5.20.4 that were modified after release, so
that the changelog is aligned with the master branch.
|
|
With MSSQL it is not possible to drop or alter a column with an
existing constraint. The constraint has to be removed before the
operation takes place.
In 'datadict-mssqlnative.inc.php' AlterColumnSQL is commented out and
DropColumnSQL doesn't care.
This tries to fix the problem with the smallest possible impact:
- Fix DropColumnSQL(), to allow the drop even with a constraint on that
given column. We drop, so any default doesn't matter.
- Fix AlterColumnSql(), to allow changes if (and only if !) either a
'new' default is given for an existing default, or there is no
existing one at all. So something like
'ALTER TABLE t ALTER COLUMN c INT NOT NULL'
with an existing constraint on c will still fail since it can't be
determined if keeping or removing the constraint is implied here.
Fixes #290 via #297
Changes to original commit:
- split long lines, whitespace
- Added commit message text from issue #290's description
Signed-off-by: Damien Regad <dregad@mantisbt.org>
|
|
The ADOdb_oci8::SelectLimit() method performs Oracle-specific query
optimization, manipulating the SQL to apply hints in a way that is not
compatible with the oci8po driver, due to conversion of query
parameters ('?' vs oci8 native ':xx').
To avoid the problem, we define the SelectLimit() method directly in
ADODB_oci8po, and rely on the slower ADOConnection::SelectLimit()
method from the base class.
Also, to avoid issues with prepared statements causing PHP to throw a
Warning: "oci_execute(): supplied resource is not a valid oci8
statement resource", we retrieve the prepared statement's SQL and pass
it on to ADOConnection::SelectLimit().
Fixes #282
|
|
The method incorrectly returned -1 for success instead of 0. In
addition, the method attempted to distinguish between warnings and
errors produced by the SQL Server parameter "WarningsReturnAsErrors"
when logging was enabled, but in ADOdb logging this parameter is always
set false so the code was removed.
Fixes #298
|
|
Use 'adodbseq' everywhere
|
|
Incorrect forwarding of parameter values from GenID() to GenID2008/2012
forced the sequence name to the default of 'adodbseq'.
Fixes #300
|
|
Fixes #302
|
|
|
|
This modified regex allows matching of empty strings and is much more
efficient than the original one.
A better fix for this will be available in v5.21
Fixes #185
|
|
Removes the extra assignment of $seq when calling CreateSequence2012()
(possibly leftover from a copy/paste ?) which was causing the code to
always use the default 'adodbseq' sequence.
Fixes #295
|
|
|
|
Removes the unnecessary upper bound on the server version check.
Fixes #294
|
|
The code in ServerVersion() method now only calls preg_match() once.
|
|
sequences
Backported from master (b28cafea05d0c88018dd0c980ba024de1e54192f).
|
|
The property is referenced in MetaColumns(), and calling this method
causes an 'Undefined property' PHP Notice to be thrown.
Fixes #289
|
|
Allow indexed or associative array for bindvars.
Fixes #288
Signed-off-by: Damien Regad <dregad@mantisbt.org>
|
|
|
|
|