title: mysql insert bigint variable into tinyint type column
body: <p>I've got tables users and devices with a user_id columns which are tinyint(3). 
  I have to create a procedure which will add new user and update these tables with user_id. So I set the delimiter to // and make this:</p>
  
  <pre><code>create procedure add_user (in pr_name varchar(15), in pr_surname varchar(15), in pr_address varchar(15), in pr_pesel float(11,0), in pr_tel int (9), in pr_package_id tinyint(3) unsigned, in pr_mac varchar(17), in pr_model varchar(15), in pr_ip int(10) unsigned) 
  
  begin 
      set @date = curdate(); 
      insert into users values (null, pr_name, pr_surname, pr_address, pr_pesel, pr_tel, pr_package_id);
      set @id = last_insert_id()
      insert into devices (pr_mac, pr_ip, @id, pr_model, @date); 
  end;//
  </code></pre>
  
  <p>I want to take last added <code>user_id</code> from <code>users</code> (which is first column in users and is also auto-increment) and put it into <code>user_id</code> in <code>devices</code> table. Mysql returns an syntax error near <code>'null, @id, pr_model, @date); end'</code>.
  I think it's because <code>last_insert_id()</code> function returns <code>bigint unsigned</code>.
  Please help me with this.</p>