hlapidez / common-schema

Automatically exported from code.google.com/p/common-schema
0 stars 0 forks source link

new install: FUNCTION common_schema.split_token does not exist #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which version of common_schema are you using? (specify
revision+distribution)
1.3

Which component is failing? (specify the view, function, etc.)
new install
First time ever installing common-schema (any version )

What is the expected output? What do you see instead?
missing FUNCTIONS errors on install of common-schemas-1.3

Can you provide with sample data?
( maybe some earlier erros not logged )

[ERROR in query 416] FUNCTION common_schema.split_token does not exist
[ERROR in query 418] FUNCTION common_schema.split_token does not exist
[ERROR in query 419] FUNCTION common_schema.split_token does not exist
[ERROR in query 441] FUNCTION common_schema.split_token does not exist
[ERROR in query 443] FUNCTION common_schema.split_token does not exist
[ERROR in query 445] FUNCTION common_schema.split_token does not exist
[ERROR in query 447] FUNCTION common_schema.split_token does not exist
[ERROR in query 449] FUNCTION common_schema.split_token does not exist
[ERROR in query 451] FUNCTION common_schema.split_token does not exist
[ERROR in query 607] FUNCTION common_schema.get_num_tokens does not exist
[ERROR in query 608] FUNCTION common_schema.get_num_tokens does not exist

(As of version 1.1), please provide output of
SELECT * FROM common_schema.status
project_name    version revision    install_time    install_success base_components_insta
lled    innodb_plugin_components_installed  percona_server_components_installed inst
all_mysql_version   install_sql_mode
common_schema   1.3 419 2013-01-17 
20:19:27    1   1   0   0   5.6.9-rc-log    STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION

Please provide any additional information below.

Original issue reported on code.google.com by ygs...@gmail.com on 18 Jan 2013 at 4:38

GoogleCodeExporter commented 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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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:

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
set thread_stack=256k

now installs and works

thanks

Original comment by ygs...@gmail.com on 22 Jan 2013 at 3:37

GoogleCodeExporter commented 9 years ago
"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

GoogleCodeExporter commented 9 years ago
Fix released in 1.3.1

Original comment by shlomi.n...@gmail.com on 3 Feb 2013 at 8:50