01-database-procs.tcl

  • last updated 7 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
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

Added support for trailing non-positional arguments

The change makes the old hack with the own trailing-argument-parser

"ad_arg_parser" obsolete by using directly the c-level argument parser

which is anyhow capable of handling trailing arguments. A few changes

were necessary for api doc to handle there trailing arguments as well.

The proc "db_string" is already converted to use native arguments.

  1. … 7 more files in changeset.
Fix for issue #3442 to support range types in .xql files

PostgreSQL supports range types since 9.5. When using range types,

square braces have to be used in SQL statements. Since OpenACS uses

always Tcl substitution in .xql files, and OpenACS does NOT allow

backslash substitution in these files, square brackets could not be

escaped and therefore not be used in .xql files so far. This change

allows now a developer to deactivate the substitution by passing

e.g. "-subst none" to the db_* command using the .xql file. Valid

values for "-subst" are "all", "none", "vars", and "commands", default

is "all" which is exactly the behavior of before. Therefore, this

change is fully backward compatible.

  1. … 3 more files in changeset.
Make api public, complies with acs-api-browser.graph__bad_calls automated test

  1. … 4 more files in changeset.
prefer ns_dbquotevalue over db_quote, mark latter as deprecated

  1. … 3 more files in changeset.
make end of options explicit

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

don't throw error message on transaction rollbacks (these are no errors, but use the same exception handling)

Prefer 'namespace which' over 'info commands', as it is faster (on local tests, around 2x) and returns a single value. Many thanks to Nathan Coulter.

  1. … 58 more files in changeset.
fix broken support for explicit bindvars to db_foreach

improve comments

  1. … 4 more files in changeset.
introduced "ad_file" as a means to avoid unexpected tilde substitution in file names

  1. … 50 more files in changeset.