diff options
author | Viktors Tjarve <viktors.tjarve@zabbix.com> | 2019-12-02 17:47:48 +0300 |
---|---|---|
committer | Viktors Tjarve <viktors.tjarve@zabbix.com> | 2019-12-02 17:47:48 +0300 |
commit | 5b0deaec3e1512343dce50efa0f7200c8c5c0962 (patch) | |
tree | 82797f06980b3be3348c17647c7a322424c0255d /misc | |
parent | 4be2a3b122ab79da1a2239bbc913062865b21999 (diff) |
.......... [ZBXNEXT-5592] dropped DB2 database support for Zabbix server
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/images/png_to_sql.sh | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/misc/images/png_to_sql.sh b/misc/images/png_to_sql.sh index 70aa403c297..935a2525761 100755 --- a/misc/images/png_to_sql.sh +++ b/misc/images/png_to_sql.sh @@ -3,28 +3,6 @@ # A script to generate SQL from PNG images # depends on hexdump -DB2_LENGTH_LIMIT=32000 - -# Converts hexadecimal string to DB2 BLOB format. -# -# This function splits the string into 32000 byte chunks because -# of DB2 limitation "For a hexadecimal constant (X, GX, or UX), -# the number of hexadecimal digits must not exceed 32704" -# Though it still did not work with 32704 length limit, so it was -# lowered to 32000. -db2_blob() -{ - image_data=$1 - if [ ${#image_data} -le $DB2_LENGTH_LIMIT ]; then - echo "blob(x'$image_data')" - return; - fi - image_chunk=${image_data:0:$DB2_LENGTH_LIMIT} - image_data=${image_data:$DB2_LENGTH_LIMIT} - echo "$(db2_blob $image_chunk) || $(db2_blob $image_data)" -} - - scriptdir="$(dirname $0)" pngdir="${1:-png_modern}" sqlbasedir="$scriptdir/../../database" @@ -34,9 +12,8 @@ imagefile_mysql="$sqlbasedir/mysql/$imagefile" imagefile_pgsql="$sqlbasedir/postgresql/$imagefile" imagefile_sqlite3="$sqlbasedir/sqlite3/$imagefile" imagefile_oracle="$sqlbasedir/oracle/$imagefile" -imagefile_ibm_db2="$sqlbasedir/ibm_db2/$imagefile" -for imagefile in "$imagefile_mysql" "$imagefile_pgsql" "$imagefile_sqlite3" "$imagefile_oracle" "$imagefile_ibm_db2"; do +for imagefile in "$imagefile_mysql" "$imagefile_pgsql" "$imagefile_sqlite3" "$imagefile_oracle"; do [[ -s "$imagefile" ]] && { echo "Non-empty $imagefile already exists, stopping" exit 1 @@ -63,8 +40,6 @@ for imagefile in $pngdir/*.png; do echo -e "\tLOAD_IMAGE($imagesdone,1,'$imagename','$imagefile');" >> "$imagefile_oracle" # ----- SQLite echo "INSERT INTO images (imageid,imagetype,name,image) VALUES ($imagesdone,1,'$imagename','$image_data');" >> "$imagefile_sqlite3" - # ----- IBM DB2 - echo "INSERT INTO images (imageid,imagetype,name,image) VALUES ($imagesdone,1,'$imagename',$(db2_blob $image_data));" >> "$imagefile_ibm_db2" echo -ne "\b\b\b\b$[$imagesdone*100/$imagecount]% " done |