Skip to content

[6.x] revert PR #33453 (backport of #33430) - #33496

Merged
driesvints merged 1 commit into
laravel:6.xfrom
rodrigopedra:6.x
Jul 10, 2020
Merged

driesvints merged 1 commit into
laravel:6.xfrom
rodrigopedra:6.x

Conversation

@rodrigopedra

Copy link
Copy Markdown
Contributor

This is the same as PR #33488 but target at 6.x branch, text below is adapted from that PR

As noted by issue #33485 PR #33453 (backport of #33430) breaks a Laravel app when using the freeTDS driver to connect to SQL Server.

PR PR #33453 (backport of #33430) was sent to address issue #32883, but when implementing it I didn't test it against freeTDS drivers. I only tested against Microsoft official drivers ( https://github.com/Microsoft/msphpsql ). It seems freeTDS is widely used , specially with older versions of SQL Server.

After the issue was reported I started investigating a solution that could solve both issues #33485 and #32883 but I could not find one.

So I am sending this PR to revert the changes made. Issue #32883 will still need to be addressed after reverting it.

I shared some of my findings on a comment on PR #33430 discussion and also presented some alternatives. Please refer to comment #33430 (comment) to have more details about it.

There I said I would send PR for both 6.x and 7.x branches, but I will wait on feedback on this one before sending the second one as maintainers could have a different workflow on back porting features and fixes.

If someone has a better suggestion on how to address this I would be glad to help.

@rodrigopedra rodrigopedra changed the title [6.x] revert PR #33453 [6.x] revert PR #33453 (backport of #33430) Jul 10, 2020
@driesvints
driesvints merged commit d6fc44b into laravel:6.x Jul 10, 2020
@rodrigopedra
rodrigopedra deleted the 6.x branch July 10, 2020 17:21
@joelharkes

Copy link
Copy Markdown
Contributor

It seems freeTDS is widely used , specially with older versions of SQL Server.

I'm not sure for laravel latest version to keep support older versions of SQL server, this can be lacking behing.
instead of reverting it maybe its a better solution to provide a config variable/legacy where old working still works behind?

@GrahamCampbell

Copy link
Copy Markdown
Collaborator

Laravel 6 and 7 both support SQL Server 2017 and 2019, but no other versions. You will probably find most features work on 2016 too, but there is no official support.

@rodrigopedra

Copy link
Copy Markdown
Contributor Author

Problem is not specifically with older SQL versions, my remarks on that might have sounded misleading.

Problem is using freeTDS driver and not the official driver from Microsoft to connect to the database.

freeTDS handles calls with multiple statements differently and does not return the expected value when running those.

My remark is that, from my research, freeTDS is used mostly with older SQL Server version, but they support newer versions. Therefore some users might be using that driver to connect to a newer version.

I would add to documentation that only the official driver is supported. But as Laravel 6 is LTS and those apps worked before that PR, it would be a breaking change to add this requirement to that.

I guess it would be fine to add that requirement to a newer Laravel version (8 maybe). Reason I reverted PR is that it was targeted to 6.x and 7.x and broke some apps.

@GrahamCampbell

Copy link
Copy Markdown
Collaborator

Can we not raise an issue with the broken driver to see if they can change their code to be compatible?

@rodrigopedra

Copy link
Copy Markdown
Contributor Author

Sorry I don't quite understand your request, might be due to not being a native speaker.

You mean to add checks to the SQL processor to see which driver is being used? similar to what is done for the ODBC driver already?

Reference:

if ($connection->getConfig('odbc') === true) {
$id = $this->processInsertGetIdForOdbc($connection);
} else {
$id = $connection->getPdo()->lastInsertId();
}

If that is what you mean I think it would solve the issue. It is also one of the suggestions I made on how to handle it:

#33430 (comment)

@mfn

mfn commented Jul 15, 2020

Copy link
Copy Markdown
Contributor

He meant opening e.g. an issue at https://github.com/FreeTDS/freetds :)

@rodrigopedra

Copy link
Copy Markdown
Contributor Author

thanks for the heads up =)

salmanarshad321 pushed a commit to salmanarshad321/framework that referenced this pull request Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants