2022-02-22 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in rddbmgr(8) that could cause the 346=>347 schema
	conversion to hang indefinitely with databases containing large
	cart libraries.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2022-02-22 09:14:51 -05:00
parent a2f8ddd9bc
commit 2b2605ecf1
2 changed files with 16 additions and 2 deletions

View File

@ -22889,3 +22889,7 @@
use the CSV generation routines in 'lib/rdcsv.[cpp|h]'.
2022-02-22 Fred Gleason <fredg@paravelsystems.com>
* Added a '--print-progress' switch to rddbmgr(8).
2022-02-22 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in rddbmgr(8) that could cause the 346=>347 schema
conversion to hang indefinitely with databases containing large
cart libraries.

View File

@ -10770,9 +10770,17 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
return false;
}
sql=QString("create index `CART_IDX` on `STACK_LINES`(`CART`)");
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
if (!StackLineTitles347(err_msg)) {
return false;
}
sql=QString("drop index `CART_IDX` on `STACK_LINES`");
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
WriteSchemaVersion(++cur_schema);
}
@ -11270,8 +11278,10 @@ bool MainObject::StackLineTitles347(QString *err_msg) const
while(q->next()) {
if(!q->value(1).isNull()) {
sql=QString("update `STACK_LINES` set ")+
"`TITLE`='"+RDEscapeString(q->value(1).toString().toLower().replace(" ",""))+"' "+
"where `CART`='"+RDEscapeString(q->value(0).toString())+"'";
"`TITLE`=\""+
RDEscapeString(q->value(1).toString().toLower().replace(" ",""))+"\" "+
"where "+
QString::asprintf("`CART`=%u",q->value(0).toUInt());
if(!RDSqlQuery::apply(sql,err_msg)) {
delete q;
return false;