Skip to content
Snippets Groups Projects

Fix for #1520 - Eliminate MySQL CAST on datetime columns when expected value type is datetime.

Merged Fix for #1520 - Eliminate MySQL CAST on datetime columns when expected value type is datetime.
Merged Akshath requested to merge akshath/vtigercrm:fix_1520 into 7.4.0

Areas validated

Querygenerators
CustomView
Reports (all types) with grouping.
Calendar

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
736 736 }
737 737 $values = explode(' ', $value);
738 738 if (count($values) == 2) {
739 $fieldSql .= "$fieldGlue CAST(CONCAT($dateFieldColumnName,' ',$timeFieldColumnName) AS DATETIME) $valueSql ";
739 $fieldSql .= "$fieldGlue CONCAT($dateFieldColumnName,' ',$timeFieldColumnName) $valueSql ";
740 740 } else {
  • Akshath @akshath started a thread on the diff
  • 736 736 }
    737 737 $values = explode(' ', $value);
    738 738 if (count($values) == 2) {
    739 $fieldSql .= "$fieldGlue CAST(CONCAT($dateFieldColumnName,' ',$timeFieldColumnName) AS DATETIME) $valueSql ";
    739 $fieldSql .= "$fieldGlue CONCAT($dateFieldColumnName,' ',$timeFieldColumnName) $valueSql ";
    740 740 } else {
    • Author Contributor

      @uma.s this is not alias, it is the target type achieved using CAST method. Here we are concating and casting to datetime type which is not required as resultant value is alrady datetime.

  • Uma
    Uma @uma.s started a thread on the diff
  • 736 736 }
    737 737 $values = explode(' ', $value);
    738 738 if (count($values) == 2) {
    739 $fieldSql .= "$fieldGlue CAST(CONCAT($dateFieldColumnName,' ',$timeFieldColumnName) AS DATETIME) $valueSql ";
    739 $fieldSql .= "$fieldGlue CONCAT($dateFieldColumnName,' ',$timeFieldColumnName) $valueSql ";
    740 740 } else {
  • Uma Status changed to merged

    Status changed to merged

  • Uma mentioned in commit 70b94148

    mentioned in commit 70b94148

  • Please register or sign in to reply
    Loading