This is an automated email from the ASF dual-hosted git repository. mxmanghi pushed a commit to branch 3.2 in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
commit 948b0508e2a74878866c8ee9055c590d32114d42 Author: Massimo Manghi <[email protected]> AuthorDate: Mon Oct 6 10:52:34 2025 +0200 properly handle sqlite3 connection, fixed severe bug in arguments being passed to special fields formatter --- ChangeLog | 14 ++++++++++---- rivet/packages/dio/dio.tcl | 2 +- rivet/packages/dio/dio_Tdbc.tcl | 1 + rivet/packages/dio/formatters.tcl | 12 ++++++------ rivet/packages/session/session-class.tcl | 20 +++++++++++--------- 5 files changed, 29 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a3a48c..e9954d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,14 @@ +2025-10-05 Massimo Manghi <[email protected]> + * rivet/packages/dio/[dio|dio_Tdbc.tcl|formatters.c]: fix missing argument + in field formatter call + * rivet/packages/session/session-class.tcl: add debug output method to allow + overriding of it + 2025-10-03 Massimo Manghi <[email protected]> - * rivet/packages/dio/dio_Tdbc.tcl: restricting constructor action on the set of tdbc - known drivers. Creating 'mariadb' and 'sqlite' aliases for mysql and sqlite3 - respectively. Adopting a specific tdbc connector creator form when creating a - sqlite3 handle + * rivet/packages/dio/dio_Tdbc.tcl: restricting constructor action on the set of tdbc + known drivers. Creating 'mariadb' and 'sqlite' aliases for mysql and sqlite3 + respectively. Adopting a specific tdbc connector creator form when creating a + sqlite3 handle 2025-10-02 Massimo Manghi <[email protected]> * rivet/packages/dio/dio.tcl: definining command ::rivet::lempty if not present diff --git a/rivet/packages/dio/dio.tcl b/rivet/packages/dio/dio.tcl index d841413..8ab32e0 100644 --- a/rivet/packages/dio/dio.tcl +++ b/rivet/packages/dio/dio.tcl @@ -654,7 +654,7 @@ proc handle {interface args} { } public method makeDBFieldValue {table_name field_name val {convert_to {}}} { - return [$this build_special_field $table_name $field_name $val] + return [$this build_special_field $table_name $field_name $val $convert_to] } ## diff --git a/rivet/packages/dio/dio_Tdbc.tcl b/rivet/packages/dio/dio_Tdbc.tcl index 98eed2b..2ef78c4 100644 --- a/rivet/packages/dio/dio_Tdbc.tcl +++ b/rivet/packages/dio/dio_Tdbc.tcl @@ -37,6 +37,7 @@ namespace eval DIO { -timeout] constructor {interface_name args} {eval configure -interface $interface_name $args} { + set connector_n 0 set connector "" # I should check this one: we only accept connector diff --git a/rivet/packages/dio/formatters.tcl b/rivet/packages/dio/formatters.tcl index 7bc16bf..c2b17b5 100644 --- a/rivet/packages/dio/formatters.tcl +++ b/rivet/packages/dio/formatters.tcl @@ -79,12 +79,12 @@ namespace eval ::DIO::formatters { public method NOW {field_name val convert_to} { - # we try to be coherent with the original purpose of this method whose - # goal is endow the class with a uniform way to handle timestamps. - # E.g.: Package session expects this case to return a timestamp in seconds - # so that differences with timestamps returned by [clock seconds] - # can be done and session expirations are computed consistently. - # (Bug #53703) + # we try to be coherent with the original purpose of this method whose + # goal endows the class with a uniform way to handle timestamps. + # E.g.: Package session expects this case to return a timestamp in seconds + # so that differences with timestamps returned by [clock seconds] + # can be done and session expirations are computed consistently. + # (Bug #53703) switch $convert_to { SECS { diff --git a/rivet/packages/session/session-class.tcl b/rivet/packages/session/session-class.tcl index 1a047a2..f3ffebd 100644 --- a/rivet/packages/session/session-class.tcl +++ b/rivet/packages/session/session-class.tcl @@ -17,7 +17,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -package provide Session 1.0 +package provide Session 1.0.1 package require Itcl ::itcl::class Session { @@ -103,9 +103,9 @@ package require Itcl public variable debugMode 1 constructor {args} { - eval configure $args + eval configure $args $dioObject registerSpecialField $sessionTable session_update_time NOW - $dioObject registerSpecialField $sessionTable session_start_time NOW + $dioObject registerSpecialField $sessionTable session_start_time NOW } method status {args} { @@ -192,10 +192,10 @@ package require Itcl # method set_session_cookie {value} { ::rivet::cookie set $cookieName $value \ - -path $cookiePath \ - -minutes $cookieLifetime \ - -secure $cookieSecure \ - -HttpOnly $cookieHttpOnly + -path $cookiePath \ + -minutes $cookieLifetime \ + -secure $cookieSecure \ + -HttpOnly $cookieHttpOnly } # @@ -494,9 +494,11 @@ package require Itcl # method debug {message} { if {$debugMode} { - puts $debugFile "$this (debug) $message<br>" + $this debug_output "$this (debug) $message" $debugFile flush $debugFile } } -} + method debug_output {msg args} { puts [lindex $args 0] "$msg <br>" } + +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
