if ((eval { lc ${ $info->{default_value} } }||'') eq 'current timestamp') {
${ $info->{default_value} } = 'current_timestamp';
delete $info->{size};
+
+ my $orig_deflt = 'current timestamp';
+ $info->{original}{default_value} = \$orig_deflt;
}
}
if ((eval { lc ${ $info->{default_value} } }||'') eq 'getdate()') {
${ $info->{default_value} } = 'current_timestamp';
+
+ my $getdate = 'getdate()';
+ $info->{original}{default_value} = \$getdate;
}
}
}
}
if ((eval { lc(${ $info->{default_value} }) }||'') eq 'sysdate') {
- $info->{original}{default_value} = $info->{default_value};
-
my $current_timestamp = 'current_timestamp';
$info->{default_value} = \$current_timestamp;
+
+ my $sysdate = 'sysdate';
+ $info->{original}{default_value} = \$sysdate;
}
}
if ((eval { lc ${ $info->{default_value} } }||'') eq 'now()') {
# do not use a ref to a constant, that breaks Data::Dump output
${$info->{default_value}} = 'current_timestamp';
+
+ my $now = 'now()';
+ $info->{original}{default_value} = \$now;
}
}
if ((eval { lc ${ $info->{default_value} } }||'') eq 'current timestamp') {
${ $info->{default_value} } = 'current_timestamp';
+
+ my $orig_deflt = 'current timestamp';
+ $info->{original}{default_value} = \$orig_deflt;
}
}
'time with time zone' => { data_type => 'time with time zone' },
'time(2) with time zone' => { data_type => 'time with time zone', size => 2 },
timestamp => { data_type => 'timestamp' },
- 'timestamp default current_timestamp'
- => { data_type => 'timestamp', default_value => \'current_timestamp' },
+ 'timestamp default now()'
+ => { data_type => 'timestamp', default_value => \'current_timestamp',
+ original => { default_value => \'now()' } },
'timestamp(2)' => { data_type => 'timestamp', size => 2 },
'timestamp without time zone' => { data_type => 'timestamp' },
'timestamp(2) without time zone' => { data_type => 'timestamp', size => 2 },
password => $password,
null => '',
data_types => {
- 'timestamp DEFAULT CURRENT TIMESTAMP' => { data_type => 'timestamp', default_value => \'current_timestamp' }
+ 'timestamp DEFAULT CURRENT TIMESTAMP' => { data_type => 'timestamp', default_value => \'current_timestamp',
+ original => { default_value => \'current timestamp' } },
},
);
datetime => { data_type => 'datetime' },
# test rewriting getdate() to current_timestamp
'datetime default getdate()'
- => { data_type => 'datetime', default_value => \'current_timestamp' },
+ => { data_type => 'datetime', default_value => \'current_timestamp',
+ original => { default_value => \'getdate()' } },
smalldatetime => { data_type => 'smalldatetime' },
time => { data_type => 'time' },
'time(0)'=> { data_type => 'time', size => 0 },
'timestamp' => { data_type => 'timestamp' },
# rewrite 'current timestamp' as 'current_timestamp'
'timestamp default current timestamp'
- => { data_type => 'timestamp', default_value => \'current_timestamp' },
+ => { data_type => 'timestamp', default_value => \'current_timestamp',
+ original => { default_value => \'current timestamp' } },
'time' => { data_type => 'time' },
# String Types
else {
$tester->run_tests();
}
+# vim:et sts=4 sw=4 tw=0: