()
| 438 | } |
| 439 | |
| 440 | func (qc *AQLQueryContext) processTimezone() { |
| 441 | if timezoneColumn, joinKey, success := parseTimezoneColumnString(qc.Query.Timezone); success { |
| 442 | timezoneTable := utils.GetConfig().Query.TimezoneTable.TableName |
| 443 | qc.timezoneTable.tableColumn = timezoneColumn |
| 444 | for _, join := range qc.Query.Joins { |
| 445 | if join.Table == timezoneTable { |
| 446 | qc.timezoneTable.tableAlias = join.Alias |
| 447 | } |
| 448 | } |
| 449 | // append timezone table to joins |
| 450 | if qc.timezoneTable.tableAlias == "" { |
| 451 | qc.timezoneTable.tableAlias = defaultTimezoneTableAlias |
| 452 | qc.Query.Joins = append(qc.Query.Joins, common.Join{ |
| 453 | Table: timezoneTable, |
| 454 | Alias: defaultTimezoneTableAlias, |
| 455 | Conditions: []string{fmt.Sprintf("%s=%s.id", joinKey, defaultTimezoneTableAlias)}, |
| 456 | }) |
| 457 | } |
| 458 | } else { |
| 459 | loc, err := common.ParseTimezone(qc.Query.Timezone) |
| 460 | if err != nil { |
| 461 | qc.Error = utils.StackError(err, "timezone Failed to parse: %s", qc.Query.Timezone) |
| 462 | return |
| 463 | } |
| 464 | qc.fixedTimezone = loc |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | func (qc *AQLQueryContext) readSchema(tableSchemaReader memCom.TableSchemaReader, shardOwner topology.ShardOwner) { |
| 469 | qc.TableScanners = make([]*TableScanner, 1+len(qc.Query.Joins)) |
no test coverage detected