sachanrahul / common-schema

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

Error 1064 when installing on 5.6.8-rc with workbench #34

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Which version of common_schema are you using? (specify
revision+distribution)
1.2.2 r368

Which component is failing? (specify the view, function, etc.)

What is the expected output? What do you see instead?
11:33:43    INTO metadata (attribute_name, attribute_value) VALUES   ('author', 
'Shlomi Noach'),   ('author_url', 'http://code.openark.org/blog/shlomi-noach'), 
  ('install_success', false),   ('install_time', NOW()),   ('install_sql_mode', 
@@sql_mode),   ('install_mysql_version', VERSION()),   
('base_components_installed', false),   ('innodb_plugin_components_installed', 
false),   ('percona_server_components_installed', false),   ('license_type', 
'New BSD'),   ('license', ' Copyright (c) 2011 - 2012, Shlomi Noach All rights 
reserved.  Redistribution and use in source and binary forms, with or without 
modification, are permitted provided that the following conditions are met:     
 * Redistributions of source code must retain the above copyright notice, this 
list of conditions and the following disclaimer.     * Redistributions in 
binary form must reproduce the above copyright notice, this list of conditions 
and the following disclaimer in the documentation and/or other materials 
provided with the distribution.     * Neither the name of the organization nor 
the names of its contributors may be used to endorse or promote products 
derived from this software without specific prior written permission.  THIS 
SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  '),   
('project_name', 'common_schema'),   ('project_home', 
'http://code.google.com/p/common-schema/'),   ('project_repository', 
'https://common-schema.googlecode.com/svn/trunk/'),   
('project_repository_type', 'svn'),   ('revision', '368'),   ('version', 
'1.2.2')    Error Code: 1064. 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 'INTO metadata (attribute_name, attribute_value) VALUES   ('author', 
'Shlomi Noac' at line 1 0.000 sec

Can you provide with sample data?

(As of version 1.1), please provide output of
SELECT * FROM common_schema.status

Please provide any additional information below.

It seems like workbench does not like:
1. some statements which use multiple lines
2. "-- " comments do not work. "-- x" works

Original issue reported on code.google.com by Daniel.v...@gmail.com on 23 Nov 2012 at 10:50

GoogleCodeExporter commented 8 years ago
Partial fix:

--- common_schema-1.2.2.sql 2012-11-23 11:31:49.059021612 +0100
+++ common_schema-1.2.2_wb.sql  2012-11-23 11:59:05.682225926 +0100
@@ -202,9 +202,7 @@
 --
 -- 
 --
-INSERT 
-  INTO metadata (attribute_name, attribute_value)
-VALUES
+INSERT INTO metadata (attribute_name, attribute_value) VALUES
   ('author', 'Shlomi Noach'),
   ('author_url', 'http://code.openark.org/blog/shlomi-noach'),
   ('install_success', false),
@@ -249,8 +247,7 @@
 --
 -- Populate numbers table, values range [0...4095]
 --
-INSERT IGNORE
-  INTO numbers (n)
+INSERT IGNORE INTO numbers (n)
 SELECT
   @counter := @counter+1 AS counter 
 FROM
@@ -3782,9 +3779,11 @@
 end $$

 DELIMITER ;
+
 -- 
 -- Verbose all reported messages
---
+-- 
+
 DELIMITER $$

 DROP procedure IF EXISTS _script_report_finalize $$
@@ -3805,7 +3804,7 @@
 DELIMITER ;
 -- 
 -- Do not invoke twice within the same script 
---
+-- 
 DELIMITER $$

 DROP procedure IF EXISTS _throttle_script $$

Original comment by Daniel.v...@gmail.com on 23 Nov 2012 at 11:03

GoogleCodeExporter commented 8 years ago
It now fails during the creation of proceslist_per_userhost

11:59:16    CREATE OR REPLACE ALGORITHM = UNDEFINED SQL SECURITY INVOKER VIEW 
processlist_per_userhost AS   SELECT      USER AS user,     
MIN(SUBSTRING_INDEX(HOST, ':', 1)) AS host,     COUNT(*) AS count_processes,    
 SUM(COMMAND != 'Sleep') AS active_processes,     
CAST(split_token(GROUP_CONCAT(IF(COMMAND != 'Sleep', TIME, NULL) ORDER BY 
TIME), ',', COUNT(IF(COMMAND != 'Sleep', TIME, NULL))/2) AS DECIMAL(10,2)) AS 
median_active_time,     CAST(split_token(GROUP_CONCAT(IF(COMMAND != 'Sleep', 
TIME, NULL) ORDER BY TIME), ',', COUNT(IF(COMMAND != 'Sleep', TIME, 
NULL))*95/100) AS DECIMAL(10,2)) AS median_95pct_active_time,     
MAX(IF(COMMAND != 'Sleep', TIME, NULL)) AS max_active_time,     AVG(IF(COMMAND 
!= 'Sleep', TIME, NULL)) AS average_active_time   FROM      
INFORMATION_SCHEMA.PROCESSLIST    WHERE      id != CONNECTION_ID()   GROUP BY   
  USER, SUBSTRING_INDEX(HOST, ':', 1)   Error Code: 1305. FUNCTION 
common_schema.split_token does not exist    0.002 sec

The split_token function indeed doesn't exist.

Original comment by Daniel.v...@gmail.com on 23 Nov 2012 at 11:22

GoogleCodeExporter commented 8 years ago
@Daniel,

Thanks. With regard original blog post, I've seen it, as well, and have not 
figured out why workbench would not allow multiline statements. I'm actually 
very shocked to see this.

With regard comment #1: is this also only on Workbench? Does import from bash 
or via SOURCE command also produces this error for you?

Original comment by shlomi.n...@gmail.com on 23 Nov 2012 at 12:17

GoogleCodeExporter commented 8 years ago
Import with the source command works fine.

Original comment by Daniel.v...@gmail.com on 23 Nov 2012 at 12:25

GoogleCodeExporter commented 8 years ago
I used workbench 5.2.44 r9933 on Ubuntu 12.10

Original comment by Daniel.v...@gmail.com on 23 Nov 2012 at 12:27

GoogleCodeExporter commented 8 years ago
I'm inclined to file this as a Workbench bug, not a common_schema bug. What say 
you?

Original comment by shlomi.n...@gmail.com on 23 Nov 2012 at 12:41

GoogleCodeExporter commented 8 years ago
I also believe that it's a workbench bug, or maybe several.

But if possible common_schema should try to work around these bugs.

Original comment by Daniel.v...@gmail.com on 23 Nov 2012 at 12:45

GoogleCodeExporter commented 8 years ago
Indeed, I will try to around it. Quite a few things to go around :)

Original comment by shlomi.n...@gmail.com on 23 Nov 2012 at 12:50

GoogleCodeExporter commented 8 years ago
I've opened a MySQL Bug for this issue.
http://bugs.mysql.com/bug.php?id=67848

Original comment by Daniel.v...@gmail.com on 9 Dec 2012 at 12:42

GoogleCodeExporter commented 8 years ago
I have modified the INSERT statements in revision 380 (not released yet). You 
can expect a release in January

Original comment by shlomi.n...@gmail.com on 10 Dec 2012 at 8:23

GoogleCodeExporter commented 8 years ago
My bug for workbench is closed. The fix is in 6.0.2, but that version is not 
released yet so I cant't confirm it.

http://bugs.mysql.com/67848

Original comment by Daniel.v...@gmail.com on 13 Jun 2013 at 6:42