Commit Graph

179 Commits

Author SHA1 Message Date
NightjarNZ
0fa6b0fde7 FIX transaction depth related errors with invalid savepoint names
The logic for cancelling a savepoint was incorrect, as the behaviour
the logic was modelled on was for a different RDBMS - where a COMMIT
would always close the most recently opened transaction.

SQLite on contrast will commit the entire transaction, not just the
most recent savepoint marker until current execution point. The correct
manner to deal with a 'partial' commit is to call RELEASE <savepoint>.

This revealed an error in the savepoint logic, in that if someone had
supplied a savepoint name instead of relying on generated ones, the
rollback command did not factor for this and always assumed generated
savepoint names - again causing error. For this reason a new class
member field has been introduced to track savepoint names in a stack
fashion.
2018-10-11 22:07:23 +13:00
NightjarNZ
62ef14f711 FIX correct nesting level mismatches causing errors
Transactions that used more than one level would cause errors if
there were consecutive calls to start a transaction - because each
query executed would clear the flag indicating that a transaction
was already in progress.

The comment for the logic to reset the nesting level on a query was
indicating that DDL (data definition language) would not work within
a transaction. This is untrue, and the module itself uses a transaction
to alter table or field names. So this function has been converted to
a no-op, deprecated to be removed in version 3 of this module. It is
also no longer called upon each query.

There have been some maintenance tidyups around this area also by
abstracting the nested transaction flag manipulations into protected
functions.
2018-10-11 00:02:12 +13:00
NightjarNZ
0efd40e5c2 FIX correct handwritten logic for transactions to use new API instead
Code in the field alteration logic had a queries defiend as strings to
begin and commit transactions involve with changing table or column names.
This was causing fatal errors as BEGIN is not a valid keyword within
a trasaction (see SQLite documentation excerpt below).

A new api has been introduced to deal with transactions programmatically,
and this module was updated to support this a few months ago. This is a
tidy up of some missed portions - consuming this API which correctly uses
SAVEPOINT when a nested transaction is required automatically.

https://www.sqlite.org/lang_transaction.html
Transactions created using BEGIN...COMMIT do not nest. For nested
transactions, use the SAVEPOINT and RELEASE commands.
2018-10-09 22:22:53 +13:00
Daniel Hensby
4167d9fd1a FIX Make sure nested transactions get reset on implicit commits 2018-07-05 15:31:05 +12:00
Damian Mooyman
6432ceea0d
Merge pull request #46 from creative-commoners/pulls/master/add-supported-module-badge
Add supported module badge to readme
2018-06-18 10:14:43 +12:00
Dylan Wagstaff
d315c61ea0 Add supported module badge to readme 2018-06-15 17:49:06 +12:00
Damian Mooyman
c346e64590
Merge pull request #43 from lekoala/patch-1
return 0 for non iterable results
2018-04-16 09:08:06 +12:00
Damian Mooyman
a38ab53e33
Merge pull request #39 from dhensby/pulls/2.0/nested-transactions
FIX Add nested transaction support
2018-03-13 09:25:09 +13:00
Thomas Portelange
978c371820
return 0 for non iterable results
If there are no columns, it's not a iterable result set and we can return 0. This fixes issues with things like CREATE statement.
2018-03-12 14:04:43 +01:00
Daniel Hensby
b36f3598bb
Merge pull request #40 from mikenz/patch-2
Missing 'n'
2018-02-13 10:50:27 +00:00
Mike Cochrane
34648b9c05
Missing 'n' 2018-02-13 14:18:48 +13:00
Daniel Hensby
f176bb0a39
FIX Add nested transaction support 2018-02-09 11:24:35 +00:00
Damian Mooyman
0e6aa26f55
Merge remote-tracking branch 'origin/2.1' into 2 2017-12-07 16:18:39 +13:00
Damian Mooyman
9b00630616
Merge remote-tracking branch 'origin/2.0' into 2.1
# Conflicts:
#	code/SQLite3Database.php
#	code/SQLiteDatabaseConfigurationHelper.php
2017-12-07 16:18:19 +13:00
Damian Mooyman
e8f4e55b8a
Merge remote-tracking branch 'origin/1.4' into 2.0
# Conflicts:
#	.travis.yml
#	code/SQLite3Database.php
#	composer.json
2017-12-07 16:16:11 +13:00
Damian Mooyman
2bde2640c3
Merge pull request #1 from silverstripe-security/patch/1.4/SS-2017-008
[SS-2017-008] Fix SQL injection in search engine
2017-12-07 15:59:01 +13:00
Damian Mooyman
ca4a76eaab
Update 2 branch alias to 2.2 2017-11-28 10:50:04 +13:00
Damian Mooyman
77e5a5e18c
Merge branch '2.1' into 2 2017-11-28 10:49:33 +13:00
Damian Mooyman
dbf10488ee
Remove master branch alias from 2.1 branch 2017-11-28 10:49:05 +13:00
Daniel Hensby
978a5a19ce
Merge pull request #37 from open-sausages/pulls/4.0/update-styles
Update config / code styles for 4.0
2017-11-23 12:50:04 +00:00
Damian Mooyman
24cf40beaf
Update config / code styles for 4.0
Related https://github.com/silverstripe/silverstripe-framework/issues/7590
2017-11-23 14:11:10 +13:00
Daniel Hensby
4aad42c084
[SS-2017-008] Fix SQL injection in search engine 2017-11-21 16:16:32 +00:00
Damian Mooyman
acaaf95d22 Merge pull request #35 from dhensby/pulls/db-index-update
Update module to work with new stricter index definitions
2017-10-12 14:03:50 +13:00
Daniel Hensby
c00a11cf7e
Travis setup 2017-10-10 15:10:30 +01:00
Daniel Hensby
536ada309e
Update module to work with new stricter index definitions 2017-10-10 13:09:06 +01:00
Damian Mooyman
8d25343c41 Merge pull request #32 from open-sausages/pulls/2/vendorise-me-baby
Expose as vendor module
2017-10-03 16:17:05 +13:00
Ingo Schommer
eba3c2c746 Expose as vendor module 2017-10-03 03:12:27 +13:00
Daniel Hensby
4e854b3fd2 Merge pull request #30 from kinglozzer/fix-seek
FIX: SQLite3Query::seek() failed to return a record
2017-01-13 11:56:18 +00:00
Loz Calver
0a646577fe FIX: SQLite3Query::seek() failed to return a record 2017-01-12 17:08:05 +00:00
Damian Mooyman
47d47ab2a8 Bump alias of master to 2.1 2016-11-13 21:57:58 +13:00
Damian Mooyman
7304708fa1 BUG Fix installer for 4.0 (#29) 2016-10-26 14:24:31 +13:00
Loz Calver
cfdf20b253 Merge pull request #28 from mikenz/patch-1
Update for latest SS4 changes
2016-10-10 09:05:52 +01:00
Mike Cochrane
dd81faac7b Update for latest SS4 changes 2016-10-10 11:13:18 +13:00
Daniel Hensby
360b70aa22 Merge pull request #27 from open-sausages/pulls/4.0/fix-path-warnings
BUG Fix errors when 'path' isn't declared explicitly
2016-09-30 12:24:10 +01:00
Damian Mooyman
6d74fc05cf
BUG Fix errors when 'path' isn't declared explicitly 2016-09-30 15:45:13 +13:00
Damian Mooyman
b710ef04b3 Rename SS_ prefixed classes (#26) 2016-09-09 15:46:48 +12:00
Ingo Schommer
8001e69b71 Merge pull request #25 from open-sausages/pulls/4.0/namespace-everything
Upgrade for silverstripe namespaces
2016-09-08 16:11:21 +12:00
Damian Mooyman
1cb63311d8
Upgrade for silverstripe namespaces 2016-09-08 15:41:17 +12:00
Ingo Schommer
32ae8f8d94 Merge pull request #24 from open-sausages/pulls/4.0/namespace-cms
Update for SilverStripe\CMS namespace
2016-08-12 16:39:36 +12:00
Damian Mooyman
99e6081c42
Update for SilverStripe\CMS namespace 2016-08-12 13:22:58 +12:00
Damian Mooyman
72638cf40e BUG Fix incorrect upgrade / rules 2016-07-05 16:27:01 +12:00
Ingo Schommer
d09ab6bea4 Merge pull request #23 from open-sausages/pulls/4.0/namespace
API Apply SilverStripe\SQLite namespace to module
2016-07-01 15:10:06 +12:00
Damian Mooyman
e36e74ab2f API Apply SilverStripe\SQLite namespace to module 2016-06-29 13:55:45 +12:00
Damian Mooyman
0bd28649f5 Merge pull request #21 from dhensby/pulls/2.0/travis-fix
Update travis for 4.0 tests
2016-03-24 11:57:08 +13:00
Damian Mooyman
df303356cd Merge pull request #19 from helpfulrobot/add-standard-scrutinizer-config
Added standard Scrutinizer config
2016-03-24 11:52:54 +13:00
Loz Calver
149d1708b6 Merge pull request #20 from dhensby/pulls/1.4/travis
Update travis test coverage
2016-03-23 13:50:28 +00:00
Daniel Hensby
8a4e3434bc Update travis for 4.0 tests 2016-03-23 12:48:55 +00:00
Daniel Hensby
ea1d504617 Update travis test coverage 2016-03-23 11:37:24 +00:00
helpfulrobot
c77a73e970 Added standard Scrutinizer config 2016-03-23 23:18:23 +13:00
Daniel Hensby
7cf13c1808 Merge pull request #18 from helpfulrobot/add-standard-code-of-conduct-file
Added standard code of conduct file
2016-02-16 09:44:36 +00:00