01-database-procs.tcl

  • last updated 2 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
merge with missing files

  1. … 1464 more files in changeset.
merge from oacs-5-10

  1. … 8099 more files in changeset.
Fix regression in db_multirow_group_last_row_p

Row is last when the next value changes

Many thanks to Miachel Aram for reporting the issue

reduced verbosity in the system log, provide hint to message

db_multirow: fall back to -local behavior, when used outside of an ADP file

The old behavior was, that when "db_multirow" was called outside an ADP

environment, an error was generated, since the uplevel was determined

without the "-local" flag by [template::adp_level]. Outside ADP,

the result of the function is empty, leading to an error that

a level "#" is invalid. Depending on an optional flag is strange

for a "db_*" command.

Now, the default behavior outside ADP file is local (i.e., when

calling outside ADP, the output variables are set in the calling

scope, unless a different "upvar_level" is specified).

Fallback to the location of the psql executable when a pgbin was not explicitly defined in the config file (which is allowed)

Fix typo

Repair -column_set flag

A more efficient approach would use db api returning ns_sets directly, rather than db_list_of_lists, however this would require a deeper refactoring.

Deprecate old api

Fix typo

improved support for cluster-wide operations

  1. … 2 more files in changeset.
New package parameter for acs-tcl: DbLogMinDuration

This parameter can be used to adjust the time threshold for longdb

warnings in the log file. When SQL logging is turned on, it might

also adjust the threshold, unless it is already more sensitive.

Bump version number to 5.10.1d25.

  1. … 2 more files in changeset.
improve spelling

  1. … 9 more files in changeset.
Bugfix: Get database name from postgres connection string keywords

The connection string can be provided for libpq either as the plain

dbname (old style) or as a list of keywords (new style).

In the latter case, the full keyword string was returned

instead of the dbname.

fix bug in db_multirow_group_last_row_p

The bug showed up in bug-tracker usage of multirows,

where db_multirow_group_last_row_p was still expecting the

dict structure

Changed "db_multirow" to use "db_list_of_lists" instead of "db_list_of_ns_sets"

Thanks to the recent improvements in NaviServer for

"db_list_of_lists", it is more efficient to use this in "db_multirow"

(actually in "db_multirow_helper"). The implementation revealed a bug

in "db_list_of_lists", when both options "-columns_var" and

"-with_headers" were set.

Extended regression test to cover the former bug.

  1. … 1 more file in changeset.
fix testcase as indicated by hector, extend regression test

  1. … 1 more file in changeset.
Improved db-functions db_list_of_nssets, db_list_of_lists, and db_foreach

These versions were developed in the conjunction with the NaviServer

ns_set reform. Especially ns_list_of_lists is improved, since it

avoids duplication of the data. This is especially important, when

queries return huge amount of data.

minor cleanup to make code more consistent

Fix typo

Streamline ns_set idioms

get rid of pipe-open, when nsproxy exec is available

added dropped "cd" command

reduce cases of tcl pipe open in acs-core

AFIKT, the semantics are the same.

For background, see: https://openacs.org/forums/message-view?message_id=5539060

  1. … 1 more file in changeset.
Change caching of driver keys

There seems to be a bug in "db_driverkey", when OpenACS connects to

multiple databases [1]. The situation with "db_driverkey" is

complicated by the fact that this function is sometimes called with a

database name in its argument "dbn", and sometimes with a database

handle. This is something to look at in the future.

The new version removes the per-thread caching, which was introduced

to reduce the high number of mutex locks caused in busy machines. The

new version is better by a factor of 2 than older versions, but relies

on NaviServer.

[1] https://openacs.org/forums/message-view?message_id=5537865

Reduce usage of ns_mktemp in OpenACS

ns_mktemp uses the deprecated old POSIX call mktemp(), which should

not be used anymore for security reasons (race between the name

creation and opening the file). This change removes several usages of

"ns_mktemp" from OpenACS and replaces it with calls to the

safe Tcl call "file tempfile ..." (introduced by Tcl 8.6).

  1. … 7 more files in changeset.
whitespace changes: break overlong lines

move function db_current_rdbms to acs-bootstrap installer to improve code locality

  1. … 1 more file in changeset.
Cleanup of low-level DB-interace: use dict instead of list with fixed positions

VS: ----------------------------------------------------------------------

  1. … 3 more files in changeset.
reduce usage of ad_arg_parser by using c-level implementation; fixes as well broken cases of bind-var handling