You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Coverage reporters failing with "operand value exceeds system limits" #368
Hi,
I'm getting an error on the Coverage Reports when trying to run them without additional parameters.
If i run:
exec ut.run(ut_coverage_html_reporter());
I get:
ORA-22813: operand value exceeds system limits
ORA-06512: at "UT3.UT_RUNNER", line 87
ORA-06512: at "UT3.UT_RUNNER", line 111
ORA-06512: at "UT3.UT", line 292
ORA-06512: at "UT3.UT", line 267
ORA-06512: at line 1
And the following trace in DBMS_OUTPUT:
ORA-06512: at "UT3.UT_COVERAGE", line 167
ORA-06512: at "UT3.UT_COVERAGE_HTML_REPORTER", line 37
ORA-06512: at "UT3.UT_EVENT_LISTENER", line 64
ORA-06512: at "UT3.UT_EVENT_LISTENER", line 32
ORA-06512: at "UT3.UT_RUN", line 66
ORA-06512: at "UT3.UT_SUITE_ITEM", line 48
ORA-06512: at "UT3.UT_RUNNER", line 77ORA-22813: operand value exceeds system limits
Same with all the other coverage reporters (sonar, coveralls)
I can make the coverage reports work if I specify the source files mappings. So this works fine:
SQL> select count(1)
2 from user_objects o
3 where o.object_name = 'UT' or object_name like 'UT\_%' escape '\'
4 and o.object_type <> 'SYNONYM';
COUNT(1)
----------
183
SQL> select count(1) from table( UT3.ut_utils.get_utplsql_objects_list() );
COUNT(1)
----------
103
Forgot to mention, I have the UTPSQL v2 installed on the same DB, different schema though, just in case this can be caused by having both at the same time.
v2 and v3 and coexist in the same DB - no issues with that.
I cant reproduce the issue on my test DB's.
Anything specific that you can point?
Would you be able to provide an isolated scenario to reproduce the issue?
Hi,
I did a bit of debugging on my DB and the issue seems to be that 11g does not allow for a variable in an SQL statement to be >4000 chars.
So, the exception was being raised in the ut_coverage package, function get_coverage_data when executing the following:
execute immediate populate_sources_tmp_table(a_coverage_options) using l_schema_names, l_skipped_objects, a_coverage_options.include_objects;
l_schema_names is a table of varchar2(32767) and 11g does not like it.
If i change l_schema_names to be a table of varchar2(4000) it works fine.
Hi @jolmopar
Thanks for providing some more debug info.
The odd thing is that we run a full set of unit tests on 11g release 2 and never encountered this issue.
Also, as I read about the exception, it seems to be related to the actual data in the Array rather than the size limit of an array.
But (maybe) you have a different version of 11g with different patches applied and therefore the bug is showing there.
We will need to be careful when change to this datatype is done, as it's used in several places.
Hi @jolmopar
Are you able to try the solution without change to the datatype?
Can you try the solution with pipelined function suggested here?
That could be a pipelined function in ut_utils package (like ut_utils.pipe_table)
The query in ut_coverage could then use syntax like:
wheres.ownerin (selectupper(t.column_value) from table(ut_utils.pipe_table(:l_schema_names)) t)
Hi @jgebal
That solution works fine! I added this to the ut_utils package:
function pipe_table(a_list ut_varchar2_list) return ut_varchar2_rows pipelined is
begin
for i in 1..a_list.count loop
pipe row (a_list(i));
end loop;
return;
end pipe_table;
I had to add a public synonym for the ut_utils package, otherwise I could not run the coverage reporter from a different schema other than UT3.
Note that the returning type is ut_varchar2_rows (which is a table of 4000 bytes). I tried returning ut_varchar2_list and I got the same error message.
Activity
jgebal commentedon Jun 27, 2017
This is related to the upper limit of oracle nested tables (2^31) (2147483647).
The limit is described here.
Can you give me the results of this query from the schema where utPLSQL v3 is installed?
Or try to execute the following query:
select count(1) from table( UT3.ut_utils.get_utplsql_objects_list() );UT3is the schema containing the utplsql v3jolmopar commentedon Jun 28, 2017
Forgot to mention, I have the UTPSQL v2 installed on the same DB, different schema though, just in case this can be caused by having both at the same time.
jgebal commentedon Jun 29, 2017
v2 and v3 and coexist in the same DB - no issues with that.
I cant reproduce the issue on my test DB's.
Anything specific that you can point?
Would you be able to provide an isolated scenario to reproduce the issue?
jolmopar commentedon Jul 6, 2017
Hi,
I did a bit of debugging on my DB and the issue seems to be that 11g does not allow for a variable in an SQL statement to be >4000 chars.
So, the exception was being raised in the ut_coverage package, function get_coverage_data when executing the following:
execute immediate populate_sources_tmp_table(a_coverage_options) using l_schema_names, l_skipped_objects, a_coverage_options.include_objects;l_schema_names is a table of varchar2(32767) and 11g does not like it.
If i change l_schema_names to be a table of varchar2(4000) it works fine.
jgebal commentedon Jul 7, 2017
Hi @jolmopar
Thanks for providing some more debug info.
The odd thing is that we run a full set of unit tests on 11g release 2 and never encountered this issue.
Also, as I read about the exception, it seems to be related to the actual data in the Array rather than the size limit of an array.
But (maybe) you have a different version of 11g with different patches applied and therefore the bug is showing there.
We will need to be careful when change to this datatype is done, as it's used in several places.
jgebal commentedon Jul 13, 2017
Hi @jolmopar
Are you able to try the solution without change to the datatype?
Can you try the solution with pipelined function suggested here?
That could be a pipelined function in ut_utils package (like
ut_utils.pipe_table)The query in
ut_coveragecould then use syntax like:jolmopar commentedon Jul 14, 2017
Hi @jgebal
That solution works fine! I added this to the ut_utils package:
I had to add a public synonym for the ut_utils package, otherwise I could not run the coverage reporter from a different schema other than UT3.
Note that the returning type is ut_varchar2_rows (which is a table of 4000 bytes). I tried returning ut_varchar2_list and I got the same error message.