Mercurial > hg > orthanc
comparison OrthancServer/DatabaseWrapper.cpp @ 218:0200cd330582
fixes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 29 Nov 2012 13:27:33 +0100 |
parents | 4453a010d0db |
children | 8098448bd827 |
comparison
equal
deleted
inserted
replaced
217:1ac3aacd10a5 | 218:0200cd330582 |
---|---|
574 { | 574 { |
575 char buf[128]; | 575 char buf[128]; |
576 sprintf(buf, "SELECT COUNT(*) FROM %s", table.c_str()); | 576 sprintf(buf, "SELECT COUNT(*) FROM %s", table.c_str()); |
577 SQLite::Statement s(db_, buf); | 577 SQLite::Statement s(db_, buf); |
578 | 578 |
579 assert(s.Step()); | 579 if (!s.Step()) |
580 { | |
581 throw OrthancException(ErrorCode_InternalError); | |
582 } | |
583 | |
580 int64_t c = s.ColumnInt(0); | 584 int64_t c = s.ColumnInt(0); |
581 assert(!s.Step()); | 585 assert(!s.Step()); |
582 | 586 |
583 return c; | 587 return c; |
584 } | 588 } |