@name 检查默认数据库是否损坏
(sfile)
| 582 | |
| 583 | |
| 584 | def check_default_error(sfile): |
| 585 | """ |
| 586 | @name 检查默认数据库是否损坏 |
| 587 | """ |
| 588 | try: |
| 589 | default_db_obj = get_db_obj(sfile) |
| 590 | res = default_db_obj.query("SELECT name FROM sqlite_master WHERE type='table' AND name not in ('sqlite_sequence','sqlite_master');") |
| 591 | if type(res) == str: |
| 592 | if res.find('unable to open database file') >= 0: |
| 593 | #磁盘满了,非数据库损耗 |
| 594 | return False |
| 595 | if res.find('error:') >= 0: |
| 596 | return True |
| 597 | except:pass |
| 598 | return False |
| 599 | |
| 600 | |
| 601 |
no test coverage detected