• last updated 23 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
merge from oacs-5-10

  1. … 8099 more files in changeset.
Align names used in utility db functions in Oracle and PostgreSQL

Over the years, the names used in the function for PostgreSQL and

Oracle drifted away, which is a problem when using call-by-name

convention for stored procedures. Furthermore, recent Oracle versions

do not allow attributes named "table" (for table_name). So the longer

version is now used uniformily. Fortunately, nsf allow abbreviation

for named parameters (like Tcl does), such one can use both

"-table_name" and "-table".

Bumped version number to 5.10.1d7.

  1. … 4 more files in changeset.
Fixes for Oracle 19c: uppercase consistently in schema queries

All names in the schema data model are in Oracle in uppercase.

Fixes for Oracle 19c: fixed more cases with Problems with Boolean data types

This fixes e.g. the following problem

[16/Feb/2022:20:55:19][3908.7fa5364fa700][-conn:oacs-5-10-0:default:1:9-] Error: SQL(): nsoracle.c:863:OracleExecPLSQLBind: error in `OCIStmtExecute ()': ORA-06550: line 1, column 13:

: PLS-00382: expression is of wrong type

: ORA-06550: line 1, column 7:

: PL/SQL: Statement ignored

:

: SQL: BEGIN :1 := util.foreign_key_exists(table_name => :table_name,column => :column,reftable => :reftable,refcolumn => :refcolumn); END;

[16/Feb/2022:20:55:19][3908.7fa5364fa700][-conn:oacs-5-10-0:default:1:9-] Notice: ### db_with_handle returned error <nsoracle.c:863:OracleExecPLSQLBind: error in `OCIStmtExecute ()': ORA-06550: line 1, column 13:

: PLS-00382: expression is of wrong type

: ORA-06550: line 1, column 7:

: PL/SQL: Statement ignored

:

Fixes for Oracle 19c: output potential errors after command

Fixes for Oracle 19c:

- types defined inside an package cannot be used from the outside;

so utility function get_primary_keys() was not usable

- fix various problems with boolean values

Two sample errors raised before the fix:

[16/Feb/2022:16:12:52][20833.7fa027de8940][-main:oacs-5-10-0-] Error: SQL(): nsoracle.c:863:OracleExecPLSQLBind: error in `OCIStmtExecute ()': ORA-06550: line 1, column 13:

: PLS-00382: expression is of wrong type

: ORA-06550: line 1, column 7:

: PL/SQL: Statement ignored

:

: SQL: BEGIN :1 := util.table_column_exists(t_name => :t_name,c_name => :c_name); END;

16/Feb/2022:18:16:39][27419.7fb7a518a940][-main:oacs-5-10-0-] Error: SQL(): nsoracle.c:863:OracleExecPLSQLBind: error in `OCIStmtExecute ()': ORA-06550: line 1, column 13:

: PLS-00382: expression is of wrong type

: ORA-06550: line 1, column 7:

: PL/SQL: Statement ignored

:

: SQL: BEGIN :1 := util.get_primary_keys(table_name => :table_name); END;

[16/Feb/2022:18:16:39][27419.7fb7a518a940][-main:oacs-5-10-0-] Notice: ### db_with_handle returned error <nsoracle.c:863:OracleExecPLSQLBind: error in 'OCIStmtExecute ()': ORA-06550: line 1, column 13:

: PLS-00382: expression is of wrong type

: ORA-06550: line 1, column 7:

: PL/SQL: Statement ignored

:

: SQL: BEGIN :1 := util.get_primary_keys(table_name => :table_name); END;> for statement

: #:log "sql=BEGIN :1 := util.get_primary_keys($sql_args); END;, sql_command=ns_ora exec_plsql_bind $db $sql 1 """

: return [ ns_ora exec_plsql_bind $db $sql 1 "" ]

:

providing compatibility with Oracle 19c

Either these scripts never worked for Oracle, or these Oracle changed over the years

  1. … 1 more file in changeset.
Bring files on oacs-5-10 in sync with HEAD

  1. … 15 more files in changeset.
Reinstate reworked versions of some oracle database utilities left behind during solution of bug #3302

Rework is based on coding style observed in code provided by Brian Fenton, but could still not be tested. See https://openacs.org/bugtracker/openacs/bug?bug_number=3302

  1. … 2 more files in changeset.
merged changes from the oacs-5-9 branch and resolved conflicts

  1. … 7834 more files in changeset.
applied changes provided by Brian for oracle. For details, see issue #3302

  1. … 2 more files in changeset.
Added new database utility to retrieve primary keys of a table.

Source for the postgres version: https://wiki.postgresql.org/wiki/Retrieve_primary_key_columns

Source for the oracle version: http://stackoverflow.com/questions/4749650/function-that-would-return-the-data-retreived-from-a-select-query-oracle

  1. … 4 more files in changeset.
Added new database functions to check for various properties and constraints in database metadata:

- foreign key constraint

- unique constraint

- not null constraint

- get column default value

  1. … 4 more files in changeset.
Merging back to HEAD branch oacs-5-8 (using tag vg-merge-oacs-5-8-from-20141027).

  1. … 2547 more files in changeset.
Created stored procedures to check for table, columns, view and index existance.

On xotcl-core powered installations, they will trigger the creation of OO methods

in the ::xo::db::sql::util namespace.

  1. … 4 more files in changeset.
Removed unused Java-based function from the Oracle version.

bootstrapper can now load either the Oracle or PostgreSQL acs-kernel

datamodel. It checks on-the-fly for which db is configured in the OpenNSD

database pools allocated to OpenACS. Only acs-kernel is correctly self-

configured at this point.

    • -0
    • +95
    ./utilities-create.sql
  1. … 113 more files in changeset.