Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default column expressions do not work on SQL Server #3547

Merged
merged 1 commit into from
May 22, 2019

Conversation

morozov
Copy link
Member

@morozov morozov commented May 20, 2019

Q A
Type bug
BC Break no

The combination of #2960 and #3348 helped identify that the SQL Server platform doesn't properly generate DDL for the date/time columns with the default value described as an expression (see the change in AbstractSQLServerPlatformTestCase). Instead of using the expression as such, it converts it to a string literal.

@morozov morozov force-pushed the default-expressions branch 2 times, most recently from afc5996 to 9c07718 Compare May 20, 2019 21:36
@morozov morozov removed the WIP label May 20, 2019
Ocramius
Ocramius previously approved these changes May 22, 2019
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides issues with the test implementation, I don't see anything wrong with this change

}

if ($platform instanceof OraclePlatform) {
self::markTestSkipped('Not supported on Oracle');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhh, I don't think we should skip tests from code within the data-provider: confusing approach IMO

Copy link
Member Author

@morozov morozov May 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can split the test into three, one for each expression and move the skip logic into methods.

jwage
jwage previously approved these changes May 22, 2019
Copy link
Member

@jwage jwage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Copy link
Member

@SenseException SenseException left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's isn't much I can add here.


$this->connection->exec($query);

$query = sprintf('SELECT default_value, actual_value FROM default_expr_test');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a sprintf without any type specifiers. Is there a reason or did this happen unintentional during changes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a copy-paste of the previous query. Will fix.

@morozov morozov dismissed stale reviews from jwage and Ocramius via 48c38b0 May 22, 2019 17:38
@morozov morozov force-pushed the default-expressions branch from 9c07718 to 48c38b0 Compare May 22, 2019 17:38
@SenseException
Copy link
Member

When the build goes green, then this PR is 👍

@morozov morozov merged commit 04cb1b4 into doctrine:master May 22, 2019
@morozov morozov deleted the default-expressions branch May 22, 2019 19:53
morozov added a commit that referenced this pull request May 22, 2019
@morozov morozov added this to the 2.9.3 milestone May 22, 2019
@morozov morozov self-assigned this May 23, 2019
rgrellmann added a commit to Rossmann-IT/dbal that referenced this pull request Apr 22, 2020
Release v2.9.3

[![Build Status](https://travis-ci.org/doctrine/dbal.svg?branch=v2.9.3)](https://travis-ci.org/doctrine/dbal)

This release fixes regressions introduced in previous releases and other bugs.

- Total issues resolved: **5**
- Total pull requests resolved: **14**
- Total contributors: **9**

**Regressions**

 - [3686: Fixed query result caching when `FetchMode::COLUMN` is used](doctrine#3686) thanks to @morozov and @Junker

 - [3456: Compare type class when comparing columns.](doctrine#3456) thanks to @garret-gunter and @cs278

**Other bugs**

 - [3679: fix begin trasaction after reconnect](doctrine#3679) thanks to @kalinin-k-a

 - [3547: Default column expressions do not work on SQL Server](doctrine#3547) thanks to @morozov

 - [3420: Index length can be a `string`: ensure that it is an integer when read by the `MySqlSchemaManager`](doctrine#3420) thanks to @leofeyer

**CI improvements and maintenance**

 - [3702: Updated SQL Server extensions to fix build failures on PHP 7.4](doctrine#3702) thanks to @morozov

 - [3662: Marked connection exception test incomplete on MySQL 8](doctrine#3662) thanks to @morozov

 - [3622: Switched from ibmcom/db2express-c to ibmcom/db2](doctrine#3622) thanks to @morozov

 - [3465: Replaced MySQL 5.7 installed from a PPA with an official Docker image](doctrine#3465) thanks to @morozov

 - [3454: CI: Test against PHP 7.4snapshot instead of nightly (8.0)](doctrine#3454) thanks to @Majkl578

 - [3452: Fixed AppVeyor build configuration and the issue on SQL Server](doctrine#3452) thanks to @morozov and @Majkl578

 - [3447: Replaced custom docker image for PostgreSQL with the official one](doctrine#3447) thanks to @morozov

 - [3407: CI: Test against MySQL 8.0 on Travis](doctrine#3407) thanks to @morozov

**PHP 7.4 support**

 - [3642: Fixed test failures on PHP 7.4](doctrine#3642) thanks to @morozov

# gpg: Signature made Sat Nov  2 23:20:42 2019
# gpg:                using RSA key 374EADAF543AE995
# gpg: Can't check signature: public key not found
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants