AppVeyor - testing on SQL Server [WIP] #193

Closed
wants to merge 9 commits into
from

Projects

None yet

4 participants

@dg dg referenced this pull request in dg/texy Nov 4, 2015
Closed

CI AppVeyor #38

@dg dg changed the title from AppVeyor - testing on Windows to AppVeyor - testing on Windows [WIP] Nov 4, 2015
@mhujer
mhujer commented Nov 4, 2015

I've tried to make dibi run there but I did not succed. See master...mhujer:appveyor tests/databases.appveyor.ini may be useful for this PR

@dg dg changed the title from AppVeyor - testing on Windows [WIP] to AppVeyor - testing on SQL Server [WIP] Nov 4, 2015
@dg
Owner
dg commented Nov 4, 2015

CI AppVeyor works, but some tests fails on SQL Server.

@dg appveyor: testing with SQL Server WIP
e126b15
@DiGi
DiGi commented Nov 8, 2015

Few notes about MSSQL:

  1. You should always use schemaName.objectName sytanx, everywhere. In CREATE scripts, in all DML. Table dbo.customers can be very different from sales.customers. MSSQL can cache plans and reuse them later
  2. MSSQL doesn't support JOINS with USING syntax
  3. Preffered TOP syntax is now TOP (n), not TOP n
  4. You should always use ORDER BY if you use TOP. MSSQL does not guarantee any implicit ordering. For different ID you can get different plan using different index
  5. You should alias computed columns, even in subselects

Related failures:

  1. Connection.fetch.phpt(78), assert line 93, because note 2.
  2. Just guess without SQL: Isn't generated SQL someting like SELECT COUNT() FROM (SELECT COUNT() FROM products ORDER BY product_id)? If so then there should be SELECT TOP (1) in inner SELECT
  3. Error Fluent.select.phpt(100), generated SQL is probably "OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY" or "SELECT TOP 1". Test fails because it is not "odbc" and definitely is not "LIMIT 1"
  4. Result.meta.phpt(19) will not work because note 2.
  5. meta.phpt(20) same issue with test, not running "odbc" and you didn't get LIMIT 2

I don't have working PHP environment right now, but I hope that this can point you at some issues. Special 'odbc' code can be sometimes used for MSSQL too, but maybe it is better to write correct test.

@castamir
Contributor

ping @dg

Is there any progress? I am trying to migrate my application to ms sql and so far I found out that fetch issue (using OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY) is still there.

@dg
Owner
dg commented Jan 22, 2016

I will be glad if you send a pull request. I do not use (and know) MS SQL.

@castamir
Contributor

Ok, I'll try to fix this driver by myself

@dg
Owner
dg commented Jan 22, 2016

💯

castamir and others added some commits Jan 26, 2016
@castamir castamir SqlsrvDriver::applyLimit(): fixed limit and offset behaviour for odbc…
… 11+

SqlsrvReflector: changed constrains metadata loading from
INFORMATION_SCHEMA to sys schema to get complete list of all constraints,
not PK only
e58f62c
@castamir castamir tests: Sqlsrv.limits: fixed sqlsrv2008 compatibility ddc45ac
@castamir castamir tests: changed environment from sql server 2008 to 2012 174a5ac
@castamir castamir SqlsrvReflector::getTables(): gets list of all tables from dbo schema…
… only
a4bb63e
@castamir castamir tests: excluded getTables() count test from metadata tests on sqlsrv
449deec
@castamir castamir cleanup a6a80b7
@castamir castamir AppVeyor: allowed sqlsrv 2014 for testing
dc37e3b
@dg Merge pull request #206 from castamir/test
SqlsrvDriver compatibility fix for SQL Server 2012 and 2014
ed56cf7
@dg dg closed this Feb 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment