[Vtigercrm-commits] [Vtiger development] #8623: Querygenerator improper CASTING for DATETIME type
Vtiger development
vtiger-tickets at trac.vtiger.com
Tue Sep 8 10:58:21 GMT 2015
#8623: Querygenerator improper CASTING for DATETIME type
--------------------------+------------------------
Reporter: nilay.khatri | Owner: developer
Type: defect | Status: new
Priority: major | Milestone: Unassigned
Component: vtigercrm | Version: 6.2.0
Severity: Medium | Keywords: datetime
--------------------------+------------------------
If the user's timezone is set to a different Timezone than the default
timezone, if we search on created time or modified time or custom created
datetime type of field it gives improper result.
This is not just related to timezone conversion, but could be also
reproduced if timezones are same.
In querygenerator at Line: 782
elseif($field->getFieldDataType() == 'datetime') {
if data type is datetime,
at line 790,
$fieldSql .= "$fieldGlue
CAST(".$field->getTableName().'.'.$field->getColumnName()." AS DATE)
$valueSql";
CAST should be DATETIME.
As well as at line 799,
$fieldSql .= "$fieldGlue
CAST(".$field->getTableName().'.'.$field->getColumnName()." AS DATE)
$valueSql";
CAST should be DATETIME.
-------------------------------------------------
Specific scenario,
default timezone: UTC
user time zone : Canada
Search on Ticket created time
Date to be searched on: 05-08-2015 (05 Aug)
Result: no records
After changing to DATETIME casting
results: 8 records
--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8623>
Vtiger development <http://trac.vtiger.com/>
Vtiger CRM
More information about the vtigercrm-commits
mailing list