Skip to content

feat: disable BaseBuilder::setAlias() #6871

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

Merged
merged 3 commits into from
Nov 18, 2022

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Nov 16, 2022

Description
Since there is not yet a consensus to make this method a public API, it will be disabled when v4.3.0 is released.

See #6734 (comment)

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

Since there is no consensus to make this method a public method, it will be put on hold.
@kenjis kenjis added database Issues or pull requests that affect the database layer 4.3 labels Nov 16, 2022
@kenjis kenjis mentioned this pull request Nov 16, 2022
5 tasks
@kenjis
Copy link
Member Author

kenjis commented Nov 16, 2022

What's wrong?

There was 1 error:

1) CodeIgniter\Database\Live\UpdateTest::testUpdateBatchUpdateFieldsAndAlias
CodeIgniter\Database\Exceptions\DatabaseException: oci_execute(): ORA-30926: unable to get a stable set of rows in the source tables

/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseConnection.php:632
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:1786
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:2427
/home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Database/Live/UpdateTest.php:400
phpvfscomposer:///home/runner/work/CodeIgniter4/CodeIgniter4/vendor/phpunit/phpunit/phpunit:97

Caused by
CodeIgniter\Database\Exceptions\DatabaseException: oci_execute(): ORA-30926: unable to get a stable set of rows in the source tables

/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/OCI8/Connection.php:211
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseConnection.php:678
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseConnection.php:600
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:1786
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:2427
/home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Database/Live/UpdateTest.php:400
phpvfscomposer:///home/runner/work/CodeIgniter4/CodeIgniter4/vendor/phpunit/phpunit/phpunit:97

Caused by
ErrorException: oci_execute(): ORA-30926: unable to get a stable set of rows in the source tables

/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/OCI8/Connection.php:199
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseConnection.php:678
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseConnection.php:600
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:1786
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Database/BaseBuilder.php:2427
/home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Database/Live/UpdateTest.php:400
phpvfscomposer:///home/runner/work/CodeIgniter4/CodeIgniter4/vendor/phpunit/phpunit/phpunit:97

https://github.com/codeigniter4/CodeIgniter4/actions/runs/3475428925/jobs/5810650672

@MGatner
Copy link
Member

MGatner commented Nov 16, 2022

Not sure what those errors mean but it looks like you got it working. Let's see if we can hear back from @sclubricants, but I'm good with this PR if it expedited 4.3

@kenjis
Copy link
Member Author

kenjis commented Nov 16, 2022

Yes, I fixed the bug. I don't know why only OCI8 did not work, but my code was obviously wrong.

@sclubricants
Copy link
Member

I can understand not wanting to make thing public that aren't necessary. I do find it easier to code having the separate public method. The method chaining seems easier to remember than the parameters. It does make more logical sense to tie it to the setData() method though.. as the alias is sure to be tied to the dataset and not to something else. If in the future there is a need for multiple aliases then this might not work so well.

@MGatner
Copy link
Member

MGatner commented Nov 18, 2022

@sclubricants I think the intent is to hide this now so we can finish discussing it without blocking the 4.3 release. I am looking to the Database Team to have most of that discussion, but I think this is a good temporary measure.

@kenjis kenjis merged commit 672e154 into codeigniter4:4.3 Nov 18, 2022
@kenjis kenjis deleted the disable-BaseBuilder-setAlias branch November 18, 2022 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Issues or pull requests that affect the database layer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants