If function behave differently in MySQL 5.5.49
It's because in the comparison v_no_por_cabang = 0 you're converting v_no_por_cabang implicitly to a number. When you use single-quotes like in v_no_por_cabang = '0' you're correctly comparing two strings.

MySQL also tells you so, when you execute show warnings; afterwards. Result:

+---------+------+------------------------------------------+
| Level   | Code | Message                                  |
+---------+------+------------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: 'POR1' |
+---------+------+------------------------------------------+


Fun fact: When your string starts with a number, MySQL converts the first number part of the string to a number.

root@localhost:playground &gt; CALL sp_testing('1POR1',@out1);

+------------------+
| v_no_por_cabang1 |
+------------------+
| 1POR1            |
+------------------+
1 row in set (0.01 sec)

+------------------+
| v_no_por_cabang2 |
+------------------+
| 1POR1            |
+------------------+
1 row in set (0.01 sec)

Query OK, 0 rows affected, 1 warning (0.01 sec)

root@localhost:playground &gt; CALL sp_testing('0POR1',@out1);
+------------------+
| v_no_por_cabang1 |
+------------------+
| NULL             |
+------------------+
1 row in set (0.00 sec)

+------------------+
| v_no_por_cabang2 |
+------------------+
| 0POR1            |
+------------------+
1 row in set (0.00 sec)