CREATE PROCEDURE 'substring_pre_map' ()
BEGIN
  DECLARE m_unit_map_filename varchar(200);
  DECLARE m_str1 int(3);
  DECLARE m_str2 int(3);
  DECLARE m_flag    int(1);
  DECLARE cur_title cursor for select unit_map_filename from t_maps_hot; 
  DECLARE continue handler for not found set m_flag = 1;
  open cur_title;
  repeat
   fetch cur_title into m_unit_map_filename;
   begin
      m_str1=substring_index(substring_index(m_unit_map_filename,'_',-2),'_',1)+2;
      m_str2=substring_index(m_unit_map_filename,'_',-1)+2;                       
      update t_maps_hot set unit_map_filename=concat('pre_map_',m_str1,'_',m_str2) where unit_map_filename=m_unit_map_filename;
   end;
  until m_flag=1
  end repeat;
  close cur_title;
end
=============================ERROR============================
错误代码: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=substring_index(substring_index(m_unit_map_filename,'_',-2),'_',1)+2;
      m_s' at line 13
(耗费 0 ms)
我的MYSQL是5.1的