Hi Ben,
On 08/29/2018 07:59 AM, Benjamin Franksen wrote:
> I am trying to upgrade an application to base-7 and getting these errors
> from dbExpand.pl. In base-3.14 it is allowed to set record fields to the
> empty string. Is this a bug or was it intentionally made illegal to set
> numeric fields to ''?
In Base-3.14 and earlier, dbExpand was a C program that used
dbStaticLib's host implementation. As such it stored field values as raw
strings without trying to interpret their values (other than expanding
macros that it had values for). It just does a syntax-check of whatever
you feed into it, and then spits out everything that it read in as a
single file/stream. If you feed it both a DBD and a DB file, the output
will contain a combination of the two.
Base-3.15 and 3.16 don't have a dbExpand program, but they do have a
dbdExpand.pl script which is used for expanding include statements in
DBD files. This script doesn't understand record instances at all.
Base-7.0 still has the dbdExpand.pl script, but also has a dbExpand.pl
script which reads in one or more DBD and DB files, expands any include
statements and macros, and spits out just the record instances. While
parsing the DB files it checks the field values against the specific
data type of that field, and these checks must be what is triggering
your errors.
The IOC's numeric parsing code has changed since 3.14, but we still
treat an empty string as the value zero, so my checks should really
permit that. If you want to try and fix them yourself look at the
modules/database/src/tools/DBD/Recfield.pm
Perl module, and the legal_value() subroutines. Inserting
$value eq '' or
at the beginning of the return statements for each of the numeric types
is probably all that is needed. You could also add tests to the
modules/database/test/tools/Recfield.plt
program to double-check and prevent future regressions.
It might take me a while to work on this, so if you can find the time
I'd be happy to accept a patch or a merge request.
- Andrew
--
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon
- References:
- dbExpand.pl: cannot set PHAS to '' Benjamin Franksen
- Navigate by Date:
- Prev:
RE: EDM X/Y Plot segfaults Baily, Scott A
- Next:
asyndriver installation error [key words: asyndriver, PLC, S7nodave, EPICS] =?gb18030?b?s8nN/rvG5a0=?=
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
<2018>
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
dbExpand.pl: cannot set PHAS to '' Benjamin Franksen
- Next:
the same question to "a simple question about pyepics" =?gb18030?b?s8nN/rvG5a0=?=
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
<2018>
2019
2020
2021
2022
2023
2024
|