func (e *GrantExec) checkAndInitTablePriv(user string, host string) error {
	db, tbl, err := e.getTargetSchemaAndTable()
	if err != nil {
		return errors.Trace(err)
	}
	ok, err := tableUserExists(e.ctx, user, host, db.Name.O, tbl.Meta().Name.O)
	if err != nil {
		return errors.Trace(err)
	}
	if ok {
		return nil
	}
	// Entry does not exist for user-host-db-tbl. Insert a new entry.
	return initTablePrivEntry(e.ctx, user, host, db.Name.O, tbl.Meta().Name.O)
}
// Check if table scope privilege entry exists in mysql.Tables_priv.
// If unexists, insert a new one.
Check if table scope privilege entry exists in mysql.Tables_priv.
If unexists, insert a new one.
// Check if table scope privilege entry exists in mysql . Tables_priv . // If unexists insert a new one .
func (e *GrantExec) checkAndInitTablePriv(user string, host string) error {
	db, tbl, err := e.getTargetSchemaAndTable()
	if err != nil {
		return errors.Trace(err)
	}
	ok, err := tableUserExists(e.ctx, user, host, db.Name.O, tbl.Meta().Name.O)
	if err != nil {
		return errors.Trace(err)
	}
	if ok {
		return nil
	}
	return initTablePrivEntry(e.ctx, user, host, db.Name.O, tbl.Meta().Name.O)
}
func ( e * GrantExec ) checkAndInitTablePriv ( user string , host string ) error { db , tbl , err := e . getTargetSchemaAndTable ( ) if err != nil { return errors . Trace ( err ) } ok , err := tableUserExists ( e . ctx , user , host , db . Name . O , tbl . Meta ( ) . Name . O ) if err != nil { return errors . Trace ( err ) } if ok { return nil } return initTablePrivEntry ( e . ctx , user , host , db . Name . O , tbl . Meta ( ) . Name . O ) }
Check if table scope privilege entry exists in mysql.Tables_priv.
Check if table scope privilege entry exists in mysql . Tables_priv .
// Entry does not exist for user-host-db-tbl. Insert a new entry.