From 3a51462bfb3cca8c90e1c690cf045b371d2ab393 Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Fri, 16 Jul 2010 11:17:02 +1000 Subject: Fixes the Oracle invalid date bug when date is greater or equal to 2800 By converting the char into unsigned char to avoid the overflow when getting the century from a char for years greater or equal to 2800. Task-number: QTBUG-8210 Reviewed-by: Michael Goddard --- src/sql/drivers/oci/qsql_oci.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp index 2f0cfdc..c56b995 100644 --- a/src/sql/drivers/oci/qsql_oci.cpp +++ b/src/sql/drivers/oci/qsql_oci.cpp @@ -648,7 +648,7 @@ QByteArray qMakeOraDate(const QDateTime& dt) QDateTime qMakeDate(const char* oraDate) { - int century = oraDate[0]; + int century = uchar(oraDate[0]); if(century >= 100){ int year = uchar(oraDate[1]); year = ((century-100)*100) + (year-100); -- cgit v0.12