Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorAndrejs Kozlovs <andrejs.kozlovs@zabbix.com>2020-11-09 09:41:05 +0300
committerAndrejs Kozlovs <andrejs.kozlovs@zabbix.com>2021-01-13 18:04:33 +0300
commitc2a9e2e430985a58f7dea06424be129c8ecdb6f3 (patch)
tree04d5b69cf617dad071ed8f14278037b405465bea /misc
parentdd79eaa49565a053546e8212b147743865c7d1ca (diff)
....I..... [ZBXNEXT-6285] code review fixes
Diffstat (limited to 'misc')
-rw-r--r--misc/images/images_oracle_start.txt2
-rwxr-xr-xmisc/images/png_to_sql.sh7
2 files changed, 4 insertions, 5 deletions
diff --git a/misc/images/images_oracle_start.txt b/misc/images/images_oracle_start.txt
index 9442fa9ba11..43fa0a068e3 100644
--- a/misc/images/images_oracle_start.txt
+++ b/misc/images/images_oracle_start.txt
@@ -1,4 +1,4 @@
--- this function is taken from https://stackoverflow.com/questions/19539408/error-when-decoding-base-64-to-blob
+-- https://stackoverflow.com/questions/19539408/error-when-decoding-base-64-to-blob
CREATE OR REPLACE FUNCTION base64_decode(p_content CLOB) RETURN BLOB
IS
C_CHUNK_SIZE CONSTANT INTEGER := 12000; -- should be a multiple of 4
diff --git a/misc/images/png_to_sql.sh b/misc/images/png_to_sql.sh
index ab2d53e8873..49739553fac 100755
--- a/misc/images/png_to_sql.sh
+++ b/misc/images/png_to_sql.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# A script to generate SQL from PNG images
-# depends on hexdump and base64
+# depends on hexdump and base64
scriptdir="$(dirname $0)"
pngdir="${1:-png_modern}"
@@ -47,9 +47,8 @@ for imagefile in $pngdir/*.png; do
rm -f $oracle_base64tmp
echo -e "\tl_clob := EMPTY_CLOB();" >> "$imagefile_oracle"
for oracle_imagefile in $oracle_base64tmp*; do
- image_data_oracle=$(grep "" "$oracle_imagefile")
- echo -e "\tl_clob := l_clob || '$image_data_oracle';" >> "$imagefile_oracle"
- rm -rf $oracle_imagefile
+ echo -e "\tl_clob := l_clob || '$(<$oracle_imagefile)';" >> "$imagefile_oracle"
+ rm -f $oracle_imagefile
done
echo -e "\tINSERT INTO images VALUES ($imagesdone,1,'$imagename',base64_decode(l_clob));" >> "$imagefile_oracle"
# ----- SQLite