summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2010-07-16 01:17:02 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-07-18 03:00:50 (GMT)
commite0a590ed25627a7d8efc7f2e20e814394fd8418d (patch)
treebd3edca1d52f7d7730f1082fc5c6ec14bec7524d
parent8506cf958836fb5cacd6a21c928acaf98c7175be (diff)
downloadQt-e0a590ed25627a7d8efc7f2e20e814394fd8418d.zip
Qt-e0a590ed25627a7d8efc7f2e20e814394fd8418d.tar.gz
Qt-e0a590ed25627a7d8efc7f2e20e814394fd8418d.tar.bz2
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 (cherry picked from commit 3a51462bfb3cca8c90e1c690cf045b371d2ab393)
-rw-r--r--src/sql/drivers/oci/qsql_oci.cpp2
1 files changed, 1 insertions, 1 deletions
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);