diff options
author | Jurijs Klopovskis <jurijs.klopovskis@zabbix.com> | 2021-11-12 00:17:20 +0300 |
---|---|---|
committer | Jurijs Klopovskis <jurijs.klopovskis@zabbix.com> | 2021-11-12 00:17:20 +0300 |
commit | 3754277b170c7d04e3d23bb47db9ff6e7842e168 (patch) | |
tree | 65d9568301df1275c20a483265d8a8cc5ad3bf3e /create | |
parent | c544d4dff606bf85fb3abcd006382b43589e1727 (diff) |
.......... [ZBXNEXT-3706] using default value from schema.tmpl instead of empty string
Diffstat (limited to 'create')
-rwxr-xr-x | create/bin/export_data.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/create/bin/export_data.sh b/create/bin/export_data.sh index b9ebc878c90..c6a3ea46e62 100755 --- a/create/bin/export_data.sh +++ b/create/bin/export_data.sh @@ -53,6 +53,7 @@ for tbl_line in `grep "^TABLE.*${dbflag}" "${schema}"`; do fld_line=${fld_line#*|} # <field_name> field_type=${fld_line%%|*} fld_line=${fld_line#*|} # <field_type> + default_val=${fld_line%%|*} fld_line=${fld_line#*|} # <default> fld_line=${fld_line#*|} # <not_null> flags=${fld_line%%|*} @@ -64,7 +65,9 @@ for tbl_line in `grep "^TABLE.*${dbflag}" "${schema}"`; do if [[ "$flags" =~ ZBX_NODATA ]]; then if [[ "$field_type" =~ ^t_(shorttext|text|longtext)$ ]]; then - fields="${fields}${delim} '' as ${field}" + [[ -n "$default_val" ]] || default_val="''" + + fields="${fields}${delim} $default_val as ${field}" else continue fi |