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

fix/ORA-00907 when comparing ref cursors with BINARY_... columns #898

Merged
merged 4 commits into from Apr 7, 2019

Conversation

opendba
Copy link
Contributor

@opendba opendba commented Apr 6, 2019

fixing "ORA-00907: missing right parenthesis" when comparing ref cursors with BINARY_DOUBLE/BINARY_FLOAT columns, because these column types do not support type length

Stack trace:

  1. ut_get_data
    ORA-00907: missing right parenthesis
    ORA-06512: at "UT3.UT_DATA_VALUE_REFCURSOR", line 318
    ORA-06512: at "UT3.UT_COMPOUND_DATA_HELPER", line 596
    ORA-06512: at "UT3.UT_DATA_VALUE_REFCURSOR", line 309
    ORA-06512: at "UT3.UT_DATA_VALUE_REFCURSOR", line 366
    ORA-06512: at "UT3.UT_EQUAL", line 225
    ORA-06512: at "UT3.UT_EXPECTATION", line 26
    ORA-06512: at "UT3.UT_EXPECTATION", line 138
    ORA-06512: at "TDS2.UT_TDSPATANSINTPKG", line 117
    ORA-06512: at "TDS2.UT_TDSPATANSINTPKG", line 117
    ORA-06512: at "UT3.UT_DATA_VALUE_REFCURSOR", line 318
    ORA-06512: at "UT3.UT_COMPOUND_DATA_HELPER", line 596
    ORA-06512: at "UT3.UT_DATA_VALUE_REFCURSOR", line 309
    ORA-06512: at "UT3.UT_DATA_VALUE_REFCURSOR", line 366
    ORA-06512: at "UT3.UT_EQUAL", line 225
    ORA-06512: at "UT3.UT_EXPECTATION", line 26
    ORA-06512: at "UT3.UT_EXPECTATION", line 138
    ORA-06512: at "TDS2.UT_TDSPATANSINTPKG", line 117
    ORA-06512: at "TDS2.UT_TDSPATANSINTPKG", line 117

…_FLOAT columns

fixing ORA-00907: missing right parenthesis when comparing ref cursors with BINARY_DOUBLE/BINARY_FLOAT columns, because these column types do not support type length
@opendba opendba changed the title fixing ORA-00907 when comparing ref cursors with BINARY_... columns fix/ORA-00907 when comparing ref cursors with BINARY_... columns Apr 6, 2019
@lwasylow
Copy link
Member

lwasylow commented Apr 6, 2019

Hi thanks for looking into this and catching that error. Do you know what's coming out of cursor desc? The else condition should not put a len when column_len is not null. Would probably be best to look why it didn't catch that and fix that line to be more generic for other types. Would be also very useful to provide a test with failing scenario, as a regression stop and showcase.

else 
      l_col_type := a_data_info.column_type
        ||case when a_data_info.column_len is not null
          then '('||a_data_info.column_len||')'
          else null
          end;
    end if;

@opendba
Copy link
Contributor Author

opendba commented Apr 6, 2019

Hi,

Thanks for review.

a_data_info.column_len is 8 for BINARY_DOUBLE column and this is the generated query part that fails, since oracle does not want type len to be specified:

 ,"PI_DOUBLE" BINARY_DOUBLE(8) PATH 'PI_DOUBLE' , "PI_FLOAT" BINARY_FLOAT(4) PATH 'PI_FLOAT'

I've added simple test case based on success_on_same_data that tries to compare binary_% data types, but fails with ORA-907 without this fix.

@jgebal
Copy link
Member

jgebal commented Apr 6, 2019

Can you also create issue for this?
It makes it easier to track releases.

@opendba
Copy link
Contributor Author

opendba commented Apr 6, 2019

Added issue for this: #899

@jgebal
Copy link
Member

jgebal commented Apr 7, 2019

@opendba This looks great.
Thank you.
It doesn't often happen that users fix tge bugs the find, usually they only report them.

Great contribution!

@jgebal jgebal added this to the v3.1.7 milestone Apr 7, 2019
@jgebal jgebal added the bugfix label Apr 7, 2019
@jgebal
Copy link
Member

jgebal commented Apr 7, 2019

Resloves #899

@jgebal
Copy link
Member

jgebal commented Apr 7, 2019

@lwasylow
Are you ok to merge this PR?

@jgebal jgebal requested a review from lwasylow April 7, 2019 06:05
@opendba
Copy link
Contributor Author

opendba commented Apr 7, 2019

it was a very simple fix.

@lwasylow lwasylow merged commit ce54eff into utPLSQL:develop Apr 7, 2019
@lwasylow
Copy link
Member

lwasylow commented Apr 7, 2019

Yes no problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants