title: ibatis and delimiter in mysql functions
body: <p>I tried to use the following example from <a href="http://www.bigdbahead.com/?p=185" rel="nofollow">Big DBA Head</a> in a ibatis migration script.</p>
  
  <pre><code>delimiter //
  drop function if exists true_function //
  create function true_function(p_param int) returns int
    deterministic
    sql security invoker
    return true
  //
  
  drop function if exists get_next_value//
  create function get_next_value(p_name varchar(30)) returns int
    deterministic
    sql security invoker
  begin  
    declare current_val integer;
  
    update mysql.sequences 
      set value = value + 1
      where name = p_name 
        and true_function((@current_val := mysql.sequences.value) is not null);
  
    return @current_val;
  end//
  delimiter ;
  </code></pre>
  
  <p>But the ibatis throws this error:</p>
  
  <blockquote>
    <p>...Error executing: delimiter //
    drop function if exists get_next_value_test //
    create function get_next_value_test(p_name varchar(30)) returns int 
      deterministic 
      sql security invoker 
    begin<br>
      declare current_val integer
    .  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'delimiter //...</p>
  </blockquote>
  
  <p>I already tried to set allowMultiQueries and send_full_script but without success.
  Do you have any idea to get this script executed?</p>
  
  <p>Thx,
  T.</p>