Closed GoogleCodeExporter closed 9 years ago
When I try to create the function split_token by manually pasting into an SQL
query
I get:
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 'CHARSET utf8,
token_index INT UNSIGNED) RETURNS TEXT CHARSET utf8
DETERMINISTIC' at line 1
If I do the same for function replace_all it works to manually create - so my
tested method is OK.
Here is what I pasted into the query:
DELIMITER $$
DROP FUNCTION IF EXISTS split_token $$
CREATE FUNCTION split_token(txt TEXT CHARSET utf8, delimiter VARCHAR(255)
CHARSET utf8, token_index INT UNSIGNED) RETURNS TEXT CHARSET utf8
DETERMINISTIC
NO SQL
SQL SECURITY INVOKER
COMMENT 'Return substring by index in delimited text'
begin
if CHAR_LENGTH(delimiter) = '' then
return SUBSTRING(txt, token_index, 1);
else
return SUBSTRING_INDEX(SUBSTRING_INDEX(txt, delimiter, token_index), delimiter, -1);
end if;
end $$
Original comment by ygs...@gmail.com
on 18 Jan 2013 at 5:05
Tested with 5.6.8-rc, with same settings as yours (same sql_mode) - works fine,
including manually entering function code.
The code you have pasted is valid and works well on all versions (5.1, 5.5,
5.6).
Will now proceed to test on 5.6.9-rc, which is the version you used.
Original comment by shlomi.n...@gmail.com
on 18 Jan 2013 at 6:13
I am unable to reproduce. I have now tested with 5.6.9-rc on linux 64 generic,
there is no problem.
By what means are you issuing the query? Command line? Workbench? Other?
Which OS are you using?
32/64 bit?
Original comment by shlomi.n...@gmail.com
on 18 Jan 2013 at 7:23
I am pasting the query into Sequelpro for Mac OS X 10.6.8
I am using 64 bit.
Do note that I copy and pasted the replace_all create FUNCITON and it ran fine.
Only split_token and get_num_tokens fail to create.
I was trying to see if it was a INT UNSIGNED syntax was at fault.
or some hidden character is messing up the line break.
Is the clue in the error message "... DETEMINISTIC' line 1 " ie it has not
parse DETERMINISTIC onto line 2.
or
something before the " CHARSET utf8 .
Californian time is past midnight so I am logging off.
Thanks for the help.
michael
Original comment by ygs...@gmail.com
on 18 Jan 2013 at 8:17
Now I see it; this is a SequelPro/Mac issue, and happens for any MySQL version.
So this is the deal: I want the code to run anywhere, but I can't fix bugs in
GUI tools. Already found two such weird bugs in MySQL Workbench.
Now I suppose submitting a bug to Sequelpro will not help; so better find a
workaround.
The SQL code is just fine, and I couldn't find funny characters either. Looking
more into this.
Original comment by shlomi.n...@gmail.com
on 18 Jan 2013 at 12:57
OK, found the problem:
Sequelpro doesn't like the function variable called "delimiter". Can modify to
_delimiter and everything works.
Will update the code
Original comment by shlomi.n...@gmail.com
on 18 Jan 2013 at 12:57
Attached please find an updated code; I have verified it works for me. Can you
verify the same for you?
Original comment by shlomi.n...@gmail.com
on 18 Jan 2013 at 1:10
Attachments:
Thanks
I am running the test now.
You could submit a bug report to SequelPro as they are still actively
developing it.
I am crisis mode - one of my mysql installations has a:
WARNING: my_print_defaults command not found.
In 10 years of mysql admin I have never seen this error!!
In the meantime the common_scheme installation has finished.
BTW I am using the SequelPro Import function the run the .sql file
[ERROR in query 444] Thread stack overrun: 69600 bytes used of a 196608 byte
stack, and 128000 bytes needed. Use 'mysqld --thread_stack=#' to specify a
bigger stack.
[ERROR in query 446] Thread stack overrun: 69600 bytes used of a 196608 byte
stack, and 128000 bytes needed. Use 'mysqld --thread_stack=#' to specify a
bigger stack.
[ERROR in query 448] Thread stack overrun: 69600 bytes used of a 196608 byte
stack, and 128000 bytes needed. Use 'mysqld --thread_stack=#' to specify a
bigger stack.
[ERROR in query 450] Thread stack overrun: 69600 bytes used of a 196608 byte
stack, and 128000 bytes needed. Use 'mysqld --thread_stack=#' to specify a
bigger stack.
[ERROR in query 452] Thread stack overrun: 69600 bytes used of a 196608 byte
stack, and 128000 bytes needed. Use 'mysqld --thread_stack=#' to specify a
bigger stack.
[ERROR in query 454] Thread stack overrun: 69600 bytes used of a 196608 byte
stack, and 128000 bytes needed. Use 'mysqld --thread_stack=#' to specify a
bigger stack.
Indeed my thread stack is:
thread_stack = 196608
The DB is not very busy not sure if this is your error or an error of the
mysqld 5.6.9-rc
Original comment by ygs...@gmail.com
on 18 Jan 2013 at 6:29
Are there any safe test query_scritps to run just a quick test.
All the examples i see have things like ALTER_TABLE and KILL.
While very useful not for the novice common-schema to just test if the
installaiton is working.
Original comment by ygs...@gmail.com
on 18 Jan 2013 at 6:36
The install should have asked you to set thread_stack to 256K -- this is the
default as of 5.5
To just do a quick test, run:
call common_schema.run("if(1) select 'working!'");
Original comment by shlomi.n...@gmail.com
on 19 Jan 2013 at 6:04
set thread_stack=256k
now installs and works
thanks
Original comment by ygs...@gmail.com
on 22 Jan 2013 at 3:37
"While very useful not for the novice common-schema to just test if the
installaiton is working."
-- thanks. I have added in project page as well an in REQUIREMENTS section.
Will work to have this auto-generated on install.
Original comment by shlomi.n...@gmail.com
on 3 Feb 2013 at 8:13
Fix released in 1.3.1
Original comment by shlomi.n...@gmail.com
on 3 Feb 2013 at 8:50
Original issue reported on code.google.com by
ygs...@gmail.com
on 18 Jan 2013 at 4:38