-
Notifications
You must be signed in to change notification settings - Fork 185
ORA-22921: length of input buffer is smaller than amount requested #346
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
Comments
Does it store anything in the memory or disc while looking through the code? Can limited space be the cause? |
Can you provide the database nls settings, in particular the NLS_CHARACTERSET? |
I can't seem to get to the root cause of the issue. |
Here is what I've tried:
|
Two more things that come to my mind are to try to change the way we create temporary lob: dbms_lob.createtemporary(a_src_clob, true); to: dbms_lob.createtemporary(a_src_clob, false); another thing to try could be change to: dbms_lob.createtemporary(a_src_clob, true, dbms_lob.call); We could see how this works. |
If any of the above solves it, we've learned something new ;) |
@Pazus, |
Don't know yet... |
Thanks everyone, the reason is found. DB Charset is same as yours: Thanks for your time again, great job on the project. |
I think the code should still work OK. create or replace procedure tst_chars as
l_source clob;
l_str varchar2(4000);
begin
l_str := 'a regular line';
ut_utils.append_to_clob(l_source, l_str );
l_str := 'उदेश जिम्मे अंतर्गत संस्थान पुर्व मानव असरकारक';
ut_utils.append_to_clob(l_source, l_str );
l_str := q'[Like ‘PE’ instead of 'PE' and – instead of -]';
ut_utils.append_to_clob(l_source, l_str );
end;
/
set echo on
alter session set NLS_LANGUAGE=RUSSIAN ;
alter session set NLS_TERRITORY=RUSSIA ;
alter session set NLS_ISO_CURRENCY=RUSSIA ;
alter session set NLS_CALENDAR=GREGORIAN ;
alter session set NLS_COMP=BINARY ;
alter session set NLS_LENGTH_SEMANTICS=BYTE;
alter session set NLS_NCHAR_CONV_EXCP=FALSE;
begin
tst_chars;
end;
/ |
It failed on the following string: While the actual size is 71, length returned 75. |
Got it reproduced: create or replace package tst_chars as
-- 2) Status of the process = ‘PE’ with no linked data
end;
/
declare
l_lines sys.dbms_preprocessor.source_lines_t;
begin
l_lines := sys.dbms_preprocessor.get_post_processed_source(
object_type => 'PACKAGE',
schema_name => user,
object_name => 'TST_CHARS'
);
for i in 1..l_lines.count loop
dbms_output.put_line(' dbms_lob.getlength='||dbms_lob.getlength(l_lines(i)));
dbms_output.put_line(' length='||length(l_lines(i)));
dbms_output.put_line(' lengthc='||lengthc(l_lines(i)));
dbms_output.put_line(' length2='||length2(l_lines(i)));
dbms_output.put_line(' length4='||length2(l_lines(i)));
dbms_output.put_line(' lengthb='||lengthb(l_lines(i)));
dbms_output.put_line('line='||l_lines(i));
end loop;
end;
/ When I use my default NLS parameters in SQL Developer it gives:
So we need to use When I change the NLS parameters to use russian it gives different results (and it actually makes the error not reproducable).
Funny. |
I'll try to create a unit test for it |
When running ut.run() on a separate schema with lots of data, it eventually fails with the following error:
There are no tests in the code. Trying ut.run() at the schema it's installed on works fine.
Here is dbms_output:
As far as I tested it, append_to_clob works alright and gets past some packages in the schema, then suddenly fails with a_src_clob size of 3212 and a_new_data of 75.
I'm not sure if it parses the packages alphabetically, but when I added a test package farther down the schema it failed at a different place.
The text was updated successfully, but these errors were encountered: