How Debugging Skills helped me to solve a problem?

What is a Problem?
According to Wikipedia, problem is a situation preventing something from being achieved.

What to do when you get a problem?
Before spending time to solve the problem, It is essential to understand the Problem.

Recently, I was working on configuring the MYSQL Server and encountered below error when I executed the file.

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -uroot -p myhome <c:\Users\srinivas\projects\myhome\schema\schema.mysql.sql

File Name: scheme.mysql.sql



As usual, I had only one question in my mind: "Why did I receive this error?"



And then It clocked 1.30pm, It was my break time.

During the break time, I was thinking about the Error and it bought me a few questions:


  1. "Which function?"
  2. "What does that error mean?"

Here, Debugging Skills helped me to solve this error:

First, I read the Error Message again and divided into parts

  • ERROR 1418 (HY000)
  • Line 15677:
  • The function has None of
  • DETERMINISTIC, NO SQL or READS SQL DATA

This triggered to open the file first and went to the line "15677".

There I saw a Function() written in the file, similar to the below.


CREATE FUNCTION f2()
RETURNS CHAR(36) CHARACTER SET utf8
BEGIN
Then I googled to find out "DETERMINISTIC, NO SQL or READS SQL DATA"

Found a comment on StackOverflow: https://stackoverflow.com/a/26015334


If there is no declaration, so I always put at least one declaration of "DETERMINISTIC", "NOT DETERMINISTIC", "NO SQL" or "READS SQL DATA" regardless other declarations I may have.

Then read another solution about where to add the declarations in the function.
https://stackoverflow.com/a/31185234



This immediately solved the error for the Line 15677.
When I re-executed the command, again encountered the same error on a different line And Solved with the Same Fix.
Thus, Debugging Skills helped me to solve a problem rather than leaving the problem out.

Popular Posts

JMeter Producing Error: Windows RegCreateKeyEx(...) returned error code 5

Understanding about Contract Testing