@@ -543,12 +543,12 @@ sub db_vim_print
543543 $line_txt = " " ;
544544 }
545545
546- # ans, 2022 - 04 - 08 - allow to print from dbms_output empty lines
547546 my @l ines = ();
548547 if (! defined ($line_txt ) || length ($line_txt ) == 0 ) {
549- @l ines = (" " );
548+ # from dbms_output it is possible to get empty lines to print
549+ @l ines = (" " );
550550 } else {
551- @l ines = split (" \n " , $line_txt );
551+ @l ines = split (" \n " , $line_txt );
552552 }
553553
554554 foreach my $line (@l ines) {
@@ -973,9 +973,8 @@ sub db_connect
973973 LongTruncOk = > 1 ,
974974 RaiseError = > 0 ,
975975 PrintError = > 0 ,
976- ## hello from ans
977- ora_charset = > ' AL32UTF8' ,
978- ora_ncharset = > ' AL32UTF8' ,
976+ ora_charset = > ' AL32UTF8' ,
977+ ora_ncharset = > ' AL32UTF8' ,
979978 PrintWarn = > 0 }
980979 );
981980 # or die $DBI ::errstr;
@@ -1288,10 +1287,9 @@ sub db_query
12881287 return 0 ;
12891288}
12901289
1291- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1292- # 2021 - 09 - 19 ans: fetch all rows of dbms_output
1293- # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1294- sub fetch_dbms_output {
1290+ # Fetches all available rows of dbms_output from server
1291+ sub fetch_dbms_output
1292+ {
12951293 my ($conn_local ) = (@_ );
12961294
12971295 my $max_line_size = 32768 ; # anything we put here can be too short...
@@ -1306,7 +1304,7 @@ sub fetch_dbms_output {
13061304 $get_lines_st - >bind_param_inout (' :n' , \$ num_lines, 50 , {ora_type = > 1 });
13071305
13081306 $get_lines_st - >execute ();
1309- db_debug (" executed get_lines() ok. num_lines = $num_lines" );
1307+ db_debug (" executed get_lines() ok. num_lines fetched = $num_lines" );
13101308
13111309 my @t ext_2 = ();
13121310 if ($num_lines ) {
@@ -1323,7 +1321,6 @@ sub fetch_dbms_output {
13231321 }
13241322 }
13251323
1326- #push @t ext_2, " WARNING: please not foget to close the statement, debug version only!!!" ;
13271324 $get_lines_st = undef;
13281325
13291326 ## max_line_size exceeded {
@@ -1699,20 +1696,10 @@ sub db_print_results
16991696 db_vim_print ($last_line , " (" .scalar (@r esult_set)." rows)" );
17001697 if (@d bms_output) {
17011698 $last_line ++ ;
1702- # ans: we need this " join and afterwards split" trick because otherwise
1703- # individual rows from @d bms_output are coming encoded differently, see as well
1704- # exploit Perl_Oracle_DBD_dbms_output/perl_dbd_oracle_dbms_output__inside_vim__simple.vim
1705- # call :so % | call Check_my_perl__load ()
1706- ##my @d bms_output_remade = split (" \n " , join (" \n " , @d bms_output));
1707- # ans: 2021 - 09 - 19 now we use decode (" utf8" ... ) and other method of
1708- # fetching of array, there are chances we dont need this ugly workaround
1709- # any more
17101699 db_debug (" db_print_results: \@ dbms_output size: " .scalar (@d bms_output));
1711- my @d bms_output_remade = @d bms_output;
1712- for my $dol0 (@d bms_output_remade) {
1713- #### THIS IS MAGIC ! !!!!!!
1714- #### THIS_IS_MAGIC ! !!!!!!
1715- #### THIS IS MAGIC ! !!!!!!
1700+ for my $dol0 (@d bms_output) {
1701+ # needed due to (DBI?) encoding problems when receiving from oracle with plsql
1702+ # in /out table, see https://github.com/ ant0sha/dbext.vim/ commit/ ??? # # TODO
17161703 my $dol = decode (' utf8' , ($dol0 // ' ' ));
17171704 db_debug (" db_print_results: printed dbms_output[i] (raw non-splitted) : " .$dol );
17181705 #chomp ($dol );
0 commit comments