mirror of
https://github.com/SOCI/soci.git
synced 2026-05-21 04:28:54 -05:00
5e9f200001
We need to read the entire contents of the CLOB in Oracle backend and not just the number of bytes corresponding to its length in characters as returned by OCILobGetLength() because this may (and will) be strictly less than its full size in bytes for any encoding using multiple bytes per character, such as the de facto standard UTF-8. Also make reading CLOBs more efficient by doing what Oracle documentation suggests and using the LOB chunk size for reading. Finally, add a unit test checking that using non-ASCII strings in UTF-8 (which had to be enabled for the CI) with CLOBs does work. This commit is best viewed ignoring whitespace-only changes.
34 lines
1.1 KiB
Bash
34 lines
1.1 KiB
Bash
# Definitions used by SOCI when building Oracle backend in CI builds
|
|
#
|
|
# Copyright (c) 2015 Vadim Zeitlin <vz-soci@zeitlins.org>
|
|
#
|
|
# Notice that this file is not executable, it is supposed to be sourced from
|
|
# the other files.
|
|
|
|
# This is arbitrary.
|
|
export ORACLE_CONTAINER=oracle-11g
|
|
|
|
# We use the same name for the path inside and outside the container.
|
|
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
|
|
export ORACLE_SID=XE
|
|
|
|
# Add path to Oracle libraries.
|
|
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
|
|
|
|
# We need to tell Oracle to use UTF-8 for the tests using non-ASCII strings.
|
|
export NLS_LANG=.AL32UTF8
|
|
|
|
# Execute any command in the Oracle container: pass the command with its
|
|
# arguments directly to the function.
|
|
oracle_exec()
|
|
{
|
|
docker exec ${ORACLE_CONTAINER} "$@"
|
|
}
|
|
|
|
# Execute SQLPlus in the Oracle container: pass the extra arguments to the
|
|
# command to this function and its input on stdin.
|
|
oracle_sqlplus()
|
|
{
|
|
docker exec --interactive --env ORACLE_HOME=${ORACLE_HOME} --env ORACLE_SID=${ORACLE_SID} ${ORACLE_CONTAINER} "$ORACLE_HOME/bin/sqlplus" -S -L "$@"
|
|
}
|