-
Notifications
You must be signed in to change notification settings - Fork 121
Short named parameters #305
Short named parameters #305
Conversation
Before: SELECT
COUNT(1) AS "C"
FROM (
SELECT
"SYS_USER"."ID" AS "ID",
"SYS_USER"."EMAIL" AS "EMAIL",
"SYS_USER"."STATUS" AS "STATUS",
TO_CHAR(LAST_SIGNIN_TIME, :subselect1subselect1LAST_SIGNIN_TIME1) AS "LAST_SIGNIN_TIME",
TO_CHAR(CREATED_TIME, :subselect1subselect1CREATED_TIME1) AS "CREATED_TIME"
FROM
"SYS_USER"
WHERE
"LAST_SIGNIN_TIME" > SYSDATE - NUMTODSINTERVAL(:subselect1subselect1where1subpart1, :subselect1subselect1where1subpart2)
AND
"CREATED_TIME" > SYSDATE - NUMTODSINTERVAL(:subselect1subselect1where1subpart3, :subselect1subselect1where1subpart4
)) "original_select" After: SELECT
COUNT(1) AS "C"
FROM (
SELECT
"SYS_USER"."ID" AS "ID",
"SYS_USER"."EMAIL" AS "EMAIL",
"SYS_USER"."STATUS" AS "STATUS",
TO_CHAR(LAST_SIGNIN_TIME, :ss1ss1LAST_SIGNIN_TIME1) AS "LAST_SIGNIN_TIME",
TO_CHAR(CREATED_TIME, :ss1ss1CREATED_TIME1) AS "CREATED_TIME"
FROM
"SYS_USER"
WHERE
"LAST_SIGNIN_TIME" > SYSDATE - NUMTODSINTERVAL(:ss1ss1where1sp1, :ss1ss1where1sp2)
AND
"CREATED_TIME" > SYSDATE - NUMTODSINTERVAL(:ss1ss1where1sp3, :ss1ss1where1sp4
)) "original_select" |
@hamilok Please check travis build: It's failing because of your change. Could you please fix them and add your test case? |
@Ocramius please, merge it |
This seems to patch just the prefix/suffix to shorten it, but adding multiple sub-selects will lead to the same issue anyway... |
Very likely, but now even with one "subselect" there is a problem, and this patch corrects it. |
@Ocramius are you sure that this doesn't fix also multiple sub-selects use cases? |
@ezimuel yes: this is basically "let's fix an overflow by making the payload size smaller", instead of fixing the actual overflow. |
@hamilok you mentioned bug ORA-00972, can you add more information on this? I don't see any issue opened with this reference. Thanks! |
I'm extremely vary of anything that doesn't fix the issue at the source, so I can't agree with going with the current solution. The approach taken in #304 looks more appropriate. |
@ezimuel solution based on #304 approach don't fix ORA-00972 problem. What was in my changes? The first type of placeholder is based on the name of the column: 16 user characters and 21 system characters. This is a clear overflow. The second placeholder is auto-generated: Minimize up to 12 characters -: s1s1where1s1 |
Fixed bug "ORA-00972: identifier is too long"