Home > database >  Mysql 5.7 sql_mode modified is invalid
Mysql 5.7 sql_mode modified is invalid

Time:09-18

Mysql 5.7 default opens the sql_mode constraints, but after I modify it, still is invalid, either through the console input set sql_mode=', inside the set gloale sql_mode=", set the session sql_mode=', or in my. CFN files inside options/mysqld under sql_mode=', cannot take effect,
Direct stick picture


Stored procedure is as follows, a stored procedure to select * out of things to group by operation, mysql 5.7 is not supported by default, need group by field, must select the field to view the official mysql manual, they just won the above a few set command can cancel the limit, no really, for two days, a great god teach
 
DELIMITER $$
USE ` qp_game_loggers ` $$
DROP PROCEDURE IF the EXISTS ` MB_GR_GetBoxResult ` $$
CREATE PROCEDURE ` MB_GR_GetBoxResult ` (IN iKindId INT (11), IN iUserId INT (11))
LABEL_PROC:
The BEGIN
IF iKindId=0 THEN
SELECT *, SUM (Score) AS TotalScore, MAX (curgame) AS RoundCount FROM gamebox_game_result WHERE boxid IN
(SELECT boxid FROM gamebox_game_result WHERE userid=iUserId
AND CollectTime & gt;=NOW () - the INTERVAL is 3600 * 24 * 5 SECOND
The ORDER BY CollectTime DESC) GROUP BY userid, boxid ORDER BY CollectTime DESC;
The ELSE
SELECT *, SUM (Score) AS TotalScore, MAX (curgame) AS RoundCount FROM gamebox_game_result WHERE boxid IN
(SELECT boxid FROM gamebox_game_result WHERE userid=iUserId
AND kindid=iKindId AND CollectTime & gt;=NOW () - the INTERVAL is 3600 * 24 * 5 SECOND
The ORDER BY CollectTime DESC) GROUP BY userid, boxid ORDER BY CollectTime DESC;
END IF;
END LABEL_PROC $$
DELIMITER ;

CodePudding user response:

The default value of empty includes group that option

CodePudding user response:

reference 1st floor rucypli response:
empty default value contains a group that option


Seems wrong, http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html
Mysql website explains that "To clear the SQL mode explicitly, and set it To an empty string using - SQL - mode=" "on the command line, or SQL - mode=" "in an option file."

CodePudding user response:

The building Lord solved excuse me?

CodePudding user response:

Set the database under the rewiring a try, after the SQL statement execution, database not heavy, will report errors, (wish I could help you)

CodePudding user response:

The building Lord solved? I see online are also this kind of reply, I am also into empty or not, configuration files and navicat directly set are tried, I also am a stored procedure,
  • Related