Commit Graph

277 Commits

Author SHA1 Message Date
Daniel Hensby
9d76e2a042
FIX Make sure nested transactions get reset on implicit commits 2018-06-20 12:49:08 +01:00
Loz Calver
321b9fe890 Update SQLServerQuery to use generators 2018-03-16 16:52:47 +00:00
Daniel Hensby
6b3959ba48
FIX Support nested transactions 2018-02-08 21:37:59 +00:00
Dylan Wagstaff
76fb2b29dc Fix class loading issues 2018-01-19 16:27:18 +13:00
Damian Mooyman
2b6a70e529
Merge remote-tracking branch 'origin/1'
# Conflicts:
#	code/MSSQLDatabase.php
#	code/MSSQLSchemaManager.php
#	composer.json
2017-12-07 16:05:30 +13:00
Daniel Hensby
ada270c884
[SS-2017-008] Fix SQL injection in search engine 2017-11-22 11:52:50 +00:00
Brett Tasker
dac4be1a51 Fix DROP INDEX not checking correct schema 2017-02-15 15:24:46 +13:00
Andrew O'Neil
d9ec128735 Fix index issues in /dev/build 2017-02-03 11:47:48 +11:00
Damian Mooyman
6a25ac4ab4 BUG Fix installer for 4.0 (#40) 2016-10-26 14:24:22 +13:00
Damian Mooyman
a34d67c753 Rename SS_ prefixed classes (#39) 2016-09-09 18:55:53 +12:00
Damian Mooyman
da6cefac06 Upgrade code for core namespaces 2016-08-30 13:08:11 +12:00
Damian Mooyman
97d8750f3d
Updated docs
Fix support for freetds
Fixes #19
Fixes #32
2016-08-16 18:11:58 +12:00
Damian Mooyman
9309cf3a50 API Namespace MSSQL connector (#31)
API Update to support customtable names
Update to support new namespaced orm
Cleanup PHPDoc
2016-07-15 13:57:54 +12:00
Will Rossiter
2e64e44087 FIX: Check index exists before dropping 2016-07-13 14:47:38 +12:00
helpfulrobot
4badb07597 Converted to PSR-2 2015-12-18 07:50:59 +13:00
Damian Mooyman
be2e9469fd Update API for 3.2 release
See https://github.com/silverstripe/silverstripe-framework/pull/4288
2015-06-17 13:58:45 +12:00
ClayLennart
15ff8640a2 Add bigint support 2014-07-15 09:34:19 +02:00
Sean Harvey
093df443ea Fixing use of "bigint" and "decimal" for pure integer types.
See https://github.com/silverstripe/silverstripe-mssql/issues/14
for more info.

"bigint" doesn't work for PHP 32-bit, as the integer could get too big
for PHP to be able to interpret the value as an integer type. In that
case it would try to approximate it as a float, but that could lead
to a bad assumption for identity columns.

For compatibility, stick with standard "int" type which has a maximum
value of 2147483647.

Note that MySQLAdapter already has this maximum, so changing it to
this keeps this database adapter consistent with MySQL.
2014-07-11 13:46:44 +12:00
Sean Harvey
a6a9b25901 Removing reference to postgres, it doesn't belong in the mssql module. 2014-07-11 13:41:45 +12:00
Damian Mooyman
758fe810a5 API Upgraded module to use new database ORM 2014-07-11 09:46:32 +12:00
Nik Rolls
e884a1cc31 BUG: Indexes were not being fully escaped (the parent table name was, but if the relational table is also namespaced then it would trigger an error). 2014-01-18 21:30:27 +13:00
Sean Harvey
91a2a6ceb4 Merge branch '3.0-index-fixes' of git://github.com/tractorcow/silverstripe-mssql into tractorcow-3.0-index-fixes 2013-09-13 15:15:10 +12:00
Sean Harvey
696c889fc1 Merge pull request #6 from ss23/patch-1
Update MSSQLDatabaseConfigurationHelper.php
2013-06-20 20:04:47 -07:00
Sean Harvey
01d376f501 BUG Fixing problem where duplicate items appear on pages
Reverts 13cdb07539 and instead calls
setLimitItems(false) on PaginatedList to tell it we've already
limited the number of items to be shown.
2013-05-27 15:21:24 +12:00
Sean Harvey
1560bad60c Free the result when at the end of a set using mssql drivers 2013-05-22 22:38:05 +12:00
Matt Gunn
13cdb07539 Removing paging subset occuring before pagination is set 2013-05-17 11:45:15 +12:00
Sean Harvey
9ae0cecc36 Revert fc3df54eab 2013-04-25 11:33:54 +12:00
Sean Harvey
55c56b9b66 default float spec to 53 so dev/build doesn't continually show as changed
otherwise it continually shows as changed from "float(53) not null..." to
"float not null"
2013-04-25 11:28:05 +12:00
Sean Harvey
fc3df54eab Removing dropping of indexes, has problems with running dev/build twice 2013-04-05 17:23:13 +13:00
Stephen Shkardoon
e500b024e3 Update MSSQLDatabaseConfigurationHelper.php
In preparation for https://github.com/silverstripe/sapphire/pull/1319
Probably should accept this at the same time.

If someone knows of the relevant ALTER permissions in MSSQL, feel free to implement.
2013-03-24 03:05:04 +13:00
Sean Harvey
bd18c0a1f3 removing double up of quotes in getIndexSqlDefinition() 2013-01-07 17:40:30 +13:00
Sean Harvey
d6a075f9c7 Fixing MSSQLDatabase to conform to dev/build change detection
This involves changing a few things around so that it's closer to
how the MySQLDatabase adapter works. indexList() should return an
array in the same format instead of using arbitrary "indexname"
and "spec". indexNames() has also been introduced to MSSQLDatabase
so that we can drop all indexes (except for fulltext and primary key
indexes) on a table when altering the table columns, this helps when
constraints not directly related to a modified column refuse to allow changes.
2013-01-07 16:25:31 +13:00
Sean Harvey
91548f76be Checking for underscore in SortColumn just to be sure 2012-12-20 16:04:44 +13:00
Sean Harvey
7c369a383a BUG Fix SortColumn ORDER BY not working when using a limit
MSSQL doesn't support putting an alias into the OVER clause,
something which is required when limiting results with an offset.
The workaround is to just put the aggregate inline, taken from
the select list.
2012-12-20 15:57:50 +13:00
Sean Harvey
e527665c5c Show the last error a bit more clearly if available 2012-12-19 11:39:51 +13:00
Sean Harvey
f64c662124 Tidying up error reporting in databaseError() and adding getLastError()
Whenever databaseError() is called when a database problem occurred
then the last error is automatically appended to the end of the
general error message.
2012-12-19 11:27:49 +13:00
Sean Harvey
f34996ae1c BUG Remove "empty" keywords when building search SQL 2012-12-19 11:19:48 +13:00
Ingo Schommer
d17ae37411 BUG Support for case sensitive searches
Through newly added Database->comparisonClause() API
2012-12-11 01:47:35 +01:00
Sean Harvey
334c2634ac Removed deprecated transaction methods on MSSQLDatabase 2012-11-16 14:25:13 +13:00
Damian Mooyman
93eab9c132 FIXED: Repaired failing test cases (DataObjectSchemaGenerationTest)
FIXED: Incorrect implementation of alterIndex
UPDATED: Improved parsing of index specification by including code borrowed from the postgres database connector module. Possibly a candidate for refactor into SS_Database.
2012-09-24 15:36:59 +12:00
Kirk Mayo
357482d6c9 BUG: open ticket 7813 fixing dobule quoting issue in getIndexSqlDefinition 2012-08-27 15:05:37 +12:00
Ingo Schommer
530c97f671 Added supportsTimezoneOverride() method 2012-07-06 11:36:07 +02:00
Sam Minnee
05e706ea18 BUG: Fixed MSSQL index name generation for tables with \ in the name.
Right now the name of a table with a namespace will contain a '\' character.  The internal index name generated clashes with this, so we've dealt with it by turning the '\' into a '_'
2012-06-26 14:52:18 +12:00
Sam Minnee
22d53b036b BUG: Fixed index generation to meet new SS3 expectations.
In SS3, the column lists passed through for index specifications are now quoted.  The database adaptor needed to be updated to meet this change.
2012-06-26 14:35:59 +12:00
Sean Harvey
0465f1b1a2 MINOR Performance optimisation in MSSQLDatabase::nextRecord() by
building field meta-data only on construct of MSSQLQuery
2012-06-12 13:31:29 +12:00
Sean Harvey
a4c269bf62 BUGFIX Fixing date/datetime handling in MSSQLDatabase
Fixing the date type to actually be "date", and not "datetime" so
that values are returned as "Y-m-d" for dates, and not "Y-m-d H:i:s".

Additionally, fixing a case where using the mssql functions would
return strange datetime formats. We need the datetime field values
in Y-m-d H:i:s. To get this working, we need to inspect the field type
when retrieving rows from the database and re-format the datetime
value at this point. This is done in MSSQLQuery::nextRecord()
2012-06-12 12:57:53 +12:00
Sean Harvey
84ec3a2014 BUGFIX Fixed undefined notice regression 2012-05-08 17:41:01 +12:00
Sean Harvey
f1daa29592 BUGFIX Fixing MSSQLDatabase to work with latest SQLQuery changes in SS3 2012-05-07 16:40:47 +12:00
Sean Harvey
05d24b0843 BUGFIX Ensure DateTime objects are handled correctly 2012-05-04 21:58:48 +12:00
Sean Harvey
30f017335b BUGFIX Fixing SS3 broken search, use simpler query syntax 2012-05-03 14:33:17 +12:00