summaryrefslogtreecommitdiffstats
path: root/create/schema/gen.pl
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-07-16 10:09:00 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-07-16 10:09:00 +0000
commit9c1f6327bf84f4aafe17d6366521ef0e7ffd5765 (patch)
tree9156870fd46feea09f1bd483ff32a0025d7101e6 /create/schema/gen.pl
parented7c11afc6a47092d04df61a3c769ab6570f0116 (diff)
downloadzabbix-9c1f6327bf84f4aafe17d6366521ef0e7ffd5765.tar.gz
zabbix-9c1f6327bf84f4aafe17d6366521ef0e7ffd5765.tar.xz
zabbix-9c1f6327bf84f4aafe17d6366521ef0e7ffd5765.zip
- [DEV-137] small fixes (Artem)
- [DEV-137] perl script fixes against mysql {BLOB and TEXT columns cannot have DEFAULT values} (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5831 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'create/schema/gen.pl')
-rwxr-xr-xcreate/schema/gen.pl13
1 files changed, 12 insertions, 1 deletions
diff --git a/create/schema/gen.pl b/create/schema/gen.pl
index 6f46fa10..cc8733d8 100755
--- a/create/schema/gen.pl
+++ b/create/schema/gen.pl
@@ -254,7 +254,18 @@ sub process_field
$_=$type;
s/$type_short/$a/g;
$type_2=$_;
- if($default ne "") { $default="DEFAULT $default"; }
+
+ if($default ne ""){
+ $default="DEFAULT $default";
+ }
+
+ if($output{"database"} eq "mysql"){
+ @text_fields = ('blob','longblob','text','longtext');
+ if(grep /$output{$type_short}/, @text_fields){
+ $default="";
+ }
+ }
+
# Special processing for Oracle "default 'ZZZ' not null" -> "default 'ZZZ'. NULL=='' in Oracle!"
if(($output{"database"} eq "oracle") && (0==index($type_2,"varchar2")))
{