You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tcl.apache.org by mx...@apache.org on 2026/04/19 16:51:29 UTC

(tcl-rivet) branch master updated: trimming SQL strings before passing to statement construction

This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git


The following commit(s) were added to refs/heads/master by this push:
     new 136edf2  trimming SQL strings before passing to statement construction
136edf2 is described below

commit 136edf2f3428d6dd9af8858c3e3bc75d348819cd
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Sun Apr 19 18:51:22 2026 +0200

    trimming SQL strings before passing to statement construction
---
 ChangeLog                       | 4 ++++
 rivet/packages/dio/dio_Tdbc.tcl | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 293d090..dd9a45f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2026-04-19 Massimo Manghi <mx...@apache.org>
+	* rivet/packages/dio/dio_Tdbc.tcl: trimming sql command string before
+	testing the presence of a terminating ';'
+
 2026-03-10 Massimo Manghi <mx...@apache.org>
 	* src/mod_rivet_ng/rivet_[worker|prefork|lazy]_mpm.c: Fully expressing
 	fields in bridge structure definition
diff --git a/rivet/packages/dio/dio_Tdbc.tcl b/rivet/packages/dio/dio_Tdbc.tcl
index fc3fdf5..455bbad 100644
--- a/rivet/packages/dio/dio_Tdbc.tcl
+++ b/rivet/packages/dio/dio_Tdbc.tcl
@@ -299,6 +299,8 @@ namespace eval DIO {
         public method exec {sql} {
             $this check_connector
 
+            set sql [::string trim $sql]
+
             # tdbc doesn't like ';' at the end of a SQL statement
 
             if {[::string index $sql end] == ";"} {set sql [::string range $sql 0 end-1]}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org