Educational-MySQL / UDFs-written-in-Python

MySQL UDFs written in Python
GNU General Public License v3.0
2 stars 5 forks source link

ValueError: invalid literal for int() with base 10 #4

Closed Komport closed 7 years ago

Komport commented 7 years ago

Hi :)

To avoid below error python: can't open file 'factorial.py': [Errno 2] No such file or directory

I have changed this string with direct path to python file. std::string command("python factorial.py");

after this changes error change as below

Traceback (most recent call last):
  File "/usr/lib/mysql/plugin/factorial.py", line 31, in <module>
    main()
  File "/usr/lib/mysql/plugin/factorial.py", line 18, in main
    num = int(num)
ValueError: invalid literal for int() with base 10: '\x01'
ShahriyarR commented 7 years ago

Thanks for report, Interesting thing here is that if you call function with 0:

select factorial(0);

It will give 'Not Enough arguments' error':

Not enough arguments
ShahriyarR commented 7 years ago

Fixed. Closing