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

Version 2.034001 broke results_exist on Oracle #104

Open
abraxxa opened this issue Jun 23, 2020 · 8 comments
Open

Version 2.034001 broke results_exist on Oracle #104

abraxxa opened this issue Jun 23, 2020 · 8 comments

Comments

@abraxxa
Copy link
Contributor

abraxxa commented Jun 23, 2020

See #54 (comment).

@ribasushi
Copy link
Contributor

Hrm... Since the Oracle tests no longer work (d845dfc#diff-67f50785d40416a7a7689c5c353f1128): can you please distill this down to a one-liner-ish example and provide the full exception text.

@abraxxa
Copy link
Contributor Author

abraxxa commented Jun 23, 2020

It's as simple as $rs->results_exist for any $rs as the generated SQL syntax SELECT EXISTS doesn't exist 🤣.

@ribasushi
Copy link
Contributor

Given the current state of affairs, I have to write a patch, completely blind, against a database I do not have easy access to. Please either provide a complete PR that solves your case (not a random SO link), OR alternatively provide the exact thing I requested above.

@abraxxa
Copy link
Contributor Author

abraxxa commented Jun 23, 2020

Is that sufficient? Devel::REPL run of

say rs('Device')->results_exists;

SELECT * 
  FROM ( 
    SELECT EXISTS( 
        SELECT 42 
          FROM device me
       )
   ) AS _existence_subq
Runtime error: DBD::Oracle::db prepare_cached failed: ORA-00936: missing expression (DBD ERROR: error possibly near <*> indicator at char 23 in 'SELECT * FROM ( SELECT <*>EXISTS (SELECT 42 FROM device me ) ) AS _existence_subq ') [for Statement "SELECT * FROM ( SELECT EXISTS (SELECT 42 FROM device me ) ) AS _existence_subq "]

Trace begun at /home/ahartmai/.plenv/versions/30.0/lib/perl5/site_perl/5.30.0/DBIx/Class/Storage/DBI.pm line 1850
DBIx::Class::Storage::DBI::_prepare_sth('DBIx::Class::Storage::DBI::Oracle::Generic=HASH(0x55f7d782e248)', 'DBI::db=HASH(0x55f7d7f60218)', 'SELECT * FROM ( SELECT EXISTS (SELECT 42 FROM device me ) ) AS _existence_subq ') called at /home/ahartmai/.plenv/versions/30.0/lib/perl5/site_perl/5.30.0/DBIx/Class/Storage/DBI.pm line 1829

@ribasushi
Copy link
Contributor

Is that sufficient

Yep that's perfect, thanks! I'll write something up tomorrow if @frioux or @rabbiveesh don't beat me to it.

@rabbiveesh
Copy link
Contributor

rabbiveesh commented Jun 23, 2020

And for all the work I spent making sure the codebase would even try to test it...

@ribasushi
Copy link
Contributor

@rabbiveesh based on history Oracle broke prior to your fixes. I.e. it's been disabled for a while for some unrelated reason, @frioux would know more...

@ribasushi
Copy link
Contributor

@rabbiveesh @abraxxa I see why this was disabled: https://github.com/wnameless/docker-oracle-xe-11g#docker-oracle-xe-11g
I suppose one of you could try to fix https://github.com/frioux/DBIx-Class-Helpers/blob/main/maint/run-oracle and then be able to run https://github.com/frioux/DBIx-Class-Helpers/blob/main/maint/dockerprove
I am not setup for docker properly, so yet again I'll have to try this towards the weekend, but knowing that the core tests run: would be a good starting point.

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

No branches or pull requests

3 participants