A problem caused by a Time Zone in mysql was recently reported by the customer. During the use of ERP 2BizBox, the following problem was found: when viewing the report profit and loss statement of the financial module, modify the time parameter, the profit and loss report data has not changed.
After multi-party verification, we finally found that the query of BizBox 2 was correct, but it was caused by the customer's modification of the system's default time zone. For more information, see www.2cto.com 2BizBox. when processing the income statement query, the query involves multiple tables, therefore, data is first queried from multiple tables and cached in a temporary table. In this way, the query interval is determined next time, if the interval between the current query time and the last query time is less than 3 seconds, data is directly retrieved from the temporary table, this is to prevent the same user from querying multiple times at the same time, causing a burden on the system. The last query time is stored in the database. The current query time is the current time of the system, which can be executed stably in the normal system. If the time zone settings of the server operating system and data are inconsistent, the time of this query may be less than the time of the last query. Therefore, data will be retrieved from the temporary table, instead of updating the data in the temporary table. For example, if the database time zone is CST (UTC-6 hours) and the operating system time zone is CDT (UTC-5 hours), the system time database time will be one hour. In this way, when a query parameter is changed after a query, data will not be updated if the time interval is one hour, therefore, the query parameters are changed and the report data remains unchanged. The solution is of course simple: Change the mysql time zone to the same as the system time zone. Author: netcy