Mybatis @ SelectKey returns self-incrementing primary key error BadSqlGrammarException

problem description

springboot integrates mybatis"s projects.
the database is mysql.
insert a piece of data and return the self-incrementing primary key.
an error was reported during operation.
I"ve made this mistake before. Is that why I didn"t write mapper XML?

error message

public class UploadImg {
    private Integer id;

    ...

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    ...
}
Sep.02,2021

to return the primary key incremented after insert, use @ Options

Mapper:

@InsertProvider(method = "insert", type = UserInfoMapperProvider.class)
@Options(keyProperty = "userInfoId", useGeneratedKeys = true)
void insert(UserInfo userInfo);

Service:

public Long insert(UserInfo userInfo) {
    userInfoMapper.insert(userInfo);
    return userInfo.getUserInfoId();
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37045-2c065.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37045-2c065.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?