Hi Dave,
I think you are right. I just checked the code and it seems that the
export function does not keep the same order as the original db, but it
saves the objects by using the serial as their prefix in the filesystem
(from export-import.lib):
my $serial = $object->getSerial ($datatype [0]);
That means when the objects are re-read to be imported, the order of
insertion is derived from the serials' sorting (when readdir is used on
the different object's sub-directories).
This is definitely the origin of the error.
To fix that, we need to write a patch that adds, in front of the
filename, the rowid - this should naturally provide the same order in
import and export, thus obtaining the same relative rowid order (not the
same rowid as that is an auto-increment field).
--- Max
On 7/22/14, 5:41 PM, blain...@gdls.com wrote:
Hi Max
I would look at the backup and restore logic that created the rowids
in the first place. Something is not right there...
Dave
------------------------------------------------------------------------
* From: *Massimiliano Pala [direc...@openca.org]
* Sent: *07/22/2014 04:24 PM AST
* To: *openca-users@lists.sourceforge.net
* Subject: *Re: [Openca-Users] Backup and restore from OpenCA 1.0.2
to 1.5.1 - sort order problems
Dave,
(to be more precise) the DBI.pm module should be located in:
<PREFIX>/lib/openca/perl_modules/perl5/OpenCA/DBI.pm
Cheers,
Max
On 7/22/14, 4:21 PM, Massimiliano Pala wrote:
Hi Dave,
Small update - I checked the code for 1.5. It seems that (for the
search only) the order is specified as DESC - but only in the
getPrevItem function (DBI.pm).
That is probably the cause of the issue you are facing when ordering
the certificates.
You might try to see if this quick fix works for you. Open the DBI.pm
(installed under the <PREFIX> directory), and search for the "DESC"
text. This should take you to here:
$query .= " ORDER BY " .
$OpenCA::DBI::SQL->{VARIABLE}->{$arguments{TABLE}."_ORDERBY"}[0] .
" DESC";
that should be changed to (to get the old behavior - CAVEAT: I have
not tested that):
$query .= " ORDER BY " .
$OpenCA::DBI::SQL->{VARIABLE}->{$arguments{TABLE}."_ORDERBY"}[0] ;
Please let me know,
Cheers,
Max
P.S.: I just saw your other e-mail about ProsgreSQL - it might be
that the behavior between the two different versions changed, but
this proposed fix should probably work since it is the same DBMS. Let
me know if it does or does not.
On 7/22/14, 4:04 PM, Massimiliano Pala wrote:
Hi Dave,
as far as I remember the ORDER BY is done on the rowid of the
tables. I would have to check the repository for changes in that
area, but I do not think we changed it from 1.0.2 (but I have not
verified that). The ASCENDING is not specified in the query.. so
this takes me to the next question: did you also update the DB
and/or switch to a different DB ? Could be a change in how the rowid
is treated by the DBMS ?
If so, we could add an option to specify the ASCENDING order
explicitly to avoid different behaviors with different DBMS (this is
just a guess, of course :D)
Cheers,
Max
On 7/22/14, 3:48 PM, blain...@gdls.com wrote:
Hi Max,
Previously in 1.0.2 they were in ascending date order by date issued.
I think in 1.5.1 they are in ascending date order by date expiring.
Total guess on my part.
So for example, say I have 42 pages of certificates. On the old
system a certificate on page 42, appears on page 30 in the new
system. Its fellows around it are on different pages too.
Is this supposed to be this way?
Dave
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Openca-Users mailing list
Openca-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openca-users
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Openca-Users mailing list
Openca-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openca-users
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Openca-Users mailing list
Openca-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openca-users
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Openca-Users mailing list
Openca-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openca-users
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Openca-Users mailing list
Openca-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openca-users
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Openca-Users mailing list
Openca-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openca-users