1
0
forked from HPR/hpr-tools

Enhanced placeholder/argument check algorithm

This commit is contained in:
Dave Morriss
2025-05-07 17:21:29 +01:00
parent 586c8e537e
commit bf8f6db45c
3 changed files with 18 additions and 14 deletions

View File

@@ -21,7 +21,7 @@
# AUTHOR: Dave Morriss (djm), Dave.Morriss@gmail.com
# VERSION: 0.0.4
# CREATED: 2015-07-11 15:53:01
# REVISION: 2025-05-06 21:12:08
# REVISION: 2025-05-07 17:20:00
#
#===============================================================================
@@ -136,8 +136,10 @@ else {
_debug( $DEBUG >= 3, '$query: ' . Dumper(\$query) );
#
# Count placeholders in the query and the arguments provided
# Count placeholders in the query and the arguments provided. First remove all
# comments which may contain '?' characters, then count any that are left.
#
$query = join("\n", grep {!/^--/} split( "\n", $query ) );
$pcount = grep {/\?/} split( '', $query );
$acount = scalar(@dbargs);