Upgrades and Database Maintenance

This forum is for programmers who have questions about the source code.
Post Reply
parljohn
Posts: 9
Joined: Tue Jan 11, 2011 6:56 pm

Upgrades and Database Maintenance

Post by parljohn » Mon Mar 10, 2014 3:54 pm

In order to make some reporting tools we're using faster, we've implement various views in our database. Whenever we upgrade or run database maintenance from OpenDental it thinks the views are tables and are corrupt or don't belong so it stops upgrades from happening and won't fix regular database issues in the maintenance window. I haven't looked at the code to see how you're checking for tables but I suspect the code is using a SHOW TABLES query to get table names which also returns VIEWS. If you change this query to

SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'

this would only look at the real table structure instead of looking at our views. Hopefully its an easy fix and something you're willing to implement.

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Upgrades and Database Maintenance

Post by jsalmon » Mon Mar 10, 2014 5:09 pm

That's exactly what we are doing. A simple SHOW TABLES command and then looping through those results. I'll add this to our bug tracker.
http://opendentalsoft.com:1942/ODBugTra ... sions.aspx
"Database maint and upgrade script are including MySQL views when verifying table integrity."
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

Post Reply