Ticket #8585: mythtv-8585-use_proper_ISO_SQL_format_in_database_logging.patch

File mythtv-8585-use_proper_ISO_SQL_format_in_database_logging.patch, 952 bytes (added by mdean, 15 months ago)

Simplified patch to prevent bound datetimes from showing as invalid format in logging

  • libs/libmythbase/mythdbcon.cpp

    ---
     libs/libmythbase/mythdbcon.cpp |    7 	6 +	1 -	0 !
     1 file changed, 6 insertions(+), 1 deletion(-)
    
    old new bool MSqlQuery::exec() 
    512512        while (b.hasNext()) 
    513513        { 
    514514            b.next(); 
    515             str.replace(b.key(), '\'' + b.value().toString() + '\''); 
     515            if (b.value().type() == QVariant::DateTime) 
     516                str.replace(b.key(), '\'' + b.value().toDateTime() 
     517                                             .toString("yyyy-MM-dd hh:mm:ss") + 
     518                                             '\''); 
     519            else 
     520                str.replace(b.key(), '\'' + b.value().toString() + '\''); 
    516521        } 
    517522 
    518523        VERBOSE(VB_DATABASE,