@@ -543,12 +543,12 @@ sub db_vim_print
543
543
$line_txt = " " ;
544
544
}
545
545
546
- # ans, 2022 - 04 - 08 - allow to print from dbms_output empty lines
547
546
my @l ines = ();
548
547
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 = (" " );
550
550
} else {
551
- @l ines = split (" \n " , $line_txt );
551
+ @l ines = split (" \n " , $line_txt );
552
552
}
553
553
554
554
foreach my $line (@l ines) {
@@ -973,9 +973,8 @@ sub db_connect
973
973
LongTruncOk = > 1 ,
974
974
RaiseError = > 0 ,
975
975
PrintError = > 0 ,
976
- ## hello from ans
977
- ora_charset = > ' AL32UTF8' ,
978
- ora_ncharset = > ' AL32UTF8' ,
976
+ ora_charset = > ' AL32UTF8' ,
977
+ ora_ncharset = > ' AL32UTF8' ,
979
978
PrintWarn = > 0 }
980
979
);
981
980
# or die $DBI ::errstr;
@@ -1288,10 +1287,9 @@ sub db_query
1288
1287
return 0 ;
1289
1288
}
1290
1289
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
+ {
1295
1293
my ($conn_local ) = (@_ );
1296
1294
1297
1295
my $max_line_size = 32768 ; # anything we put here can be too short...
@@ -1306,7 +1304,7 @@ sub fetch_dbms_output {
1306
1304
$get_lines_st - >bind_param_inout (' :n' , \$ num_lines, 50 , {ora_type = > 1 });
1307
1305
1308
1306
$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" );
1310
1308
1311
1309
my @t ext_2 = ();
1312
1310
if ($num_lines ) {
@@ -1323,7 +1321,6 @@ sub fetch_dbms_output {
1323
1321
}
1324
1322
}
1325
1323
1326
- #push @t ext_2, " WARNING: please not foget to close the statement, debug version only!!!" ;
1327
1324
$get_lines_st = undef;
1328
1325
1329
1326
## max_line_size exceeded {
@@ -1699,7 +1696,7 @@ sub db_print_results
1699
1696
db_vim_print ($last_line , " (" .scalar (@r esult_set)." rows)" );
1700
1697
if (@d bms_output) {
1701
1698
$last_line ++ ;
1702
- # ans: we need this " join and afterwards split" trick because otherwise
1699
+ # ans: we used to need this " join and afterwards split" trick because otherwise
1703
1700
# individual rows from @d bms_output are coming encoded differently, see as well
1704
1701
# exploit Perl_Oracle_DBD_dbms_output/perl_dbd_oracle_dbms_output__inside_vim__simple.vim
1705
1702
# call :so % | call Check_my_perl__load ()
@@ -1710,9 +1707,8 @@ sub db_print_results
1710
1707
db_debug (" db_print_results: \@ dbms_output size: " .scalar (@d bms_output));
1711
1708
my @d bms_output_remade = @d bms_output;
1712
1709
for my $dol0 (@d bms_output_remade) {
1713
- #### THIS IS MAGIC ! !!!!!!
1714
- #### THIS_IS_MAGIC ! !!!!!!
1715
- #### THIS IS MAGIC ! !!!!!!
1710
+ # needed due to (DBI?) encoding problems when receiving from oracle with plsql
1711
+ # in /out table, see
1716
1712
my $dol = decode (' utf8' , ($dol0 // ' ' ));
1717
1713
db_debug (" db_print_results: printed dbms_output[i] (raw non-splitted) : " .$dol );
1718
1714
#chomp ($dol );
0 commit comments