You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/11/12 08:59:37 UTC

[GitHub] [shardingsphere] tuichenchuxin opened a new issue #13571: Improve sql support of shardingsphere-parser

tuichenchuxin opened a new issue #13571:
URL: https://github.com/apache/shardingsphere/issues/13571


   Hi, community.
   This is a issue to collect the sql not supported in shardingsphere-parser.
   When i found some sql is not supported in shardingsphere-parser, I'll write in this issue.
   And when you found some sql is not supported. Welcome to comment.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuichenchuxin removed a comment on issue #13571: Improve sql support of shardingsphere-parser

Posted by GitBox <gi...@apache.org>.
tuichenchuxin removed a comment on issue #13571:
URL: https://github.com/apache/shardingsphere/issues/13571#issuecomment-966940898


   in postgresql
   ```
   SELECT d.oid,
          d.datname                               AS databasename,
          d.datacl,
          d.datistemplate,
          d.datallowconn,
          pg_get_userbyid(d.datdba)               AS databaseowner,
          d.datcollate,
          d.datctype,
          shobj_description(d.oid, 'pg_database') AS description,
          d.datconnlimit,
          t.spcname,
          d.encoding,
          pg_encoding_to_char(d.encoding)         AS encodingname
   FROM pg_database d
            LEFT JOIN pg_tablespace t ON d.dattablespace = t.oid
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuichenchuxin commented on issue #13571: Improve sql support of shardingsphere-parser

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #13571:
URL: https://github.com/apache/shardingsphere/issues/13571#issuecomment-966949244


   in postgres
   ```
   SELECT COUNT(*)
   FROM pg_class c
            LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
   WHERE c.relkind = ANY ('{r,v,m}'::char[])
   UNION
   SELECT COUNT(*)
   FROM pg_attribute a
            JOIN pg_class c on a.attrelid = c.oid
            JOIN pg_namespace n on c.relnamespace = n.oid
            JOIN pg_type tp on tp.typelem = a.atttypid
   WHERE a.attnum > 0
   UNION
   SELECT COUNT(*)
   FROM information_schema.routines;
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuichenchuxin commented on issue #13571: Improve sql support of shardingsphere-parser

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #13571:
URL: https://github.com/apache/shardingsphere/issues/13571#issuecomment-966949908


   in postgres
   ```
   SELECT n.nspname              AS rule_schema,
          c.relname,
          r.rulename,
          r.oid,
          r.ev_type,
          r.is_instead,
          r.ev_enabled,
          pg_get_ruledef(r.oid)  AS definition,
          obj_description(r.oid) AS comment
   FROM ((pg_rewrite r JOIN pg_class c ON ((c.oid = r.ev_class)))
            LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace)))
   WHERE (r.rulename <> '_RETURN'::name)
     AND (n.nspname = 'public')
     AND (c.relname = 't_order')
   ORDER BY c.relname, r.oid ASC
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuichenchuxin commented on issue #13571: Improve sql support of shardingsphere-parser

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #13571:
URL: https://github.com/apache/shardingsphere/issues/13571#issuecomment-966936115


   in pg this sql is not supported
   ```
   SELECT c.oid,
          n.nspname                                                        AS schemaname,
          c.relname                                                        AS tablename,
          c.relacl,
          pg_get_userbyid(c.relowner)                                      AS tableowner,
          obj_description(c.oid)                                           AS description,
          c.relkind,
          ci.relname                                                       As cluster,
          c.relhasoids                                                     AS hasoids,
          c.relhasindex                                                    AS hasindexes,
          c.relhasrules                                                    AS hasrules,
          t.spcname                                                        AS tablespace,
          c.reloptions                                                     AS param,
          c.relhastriggers                                                 AS hastriggers,
          c.relpersistence                                                 AS unlogged,
          ft.ftoptions,
          fs.srvname,
          c.reltuples,
          ((SELECT count(*) FROM pg_inherits WHERE inhparent = c.oid) > 0) AS inhtable,
          i2.nspname                                                       AS inhschemaname,
          i2.relname                                                       AS inhtablename
   FROM pg_class c
            LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
            LEFT JOIN pg_tablespace t ON t.oid = c.reltablespace
            LEFT JOIN (pg_inherits i INNER JOIN pg_class c2 ON i.inhparent = c2.oid LEFT JOIN pg_namespace n2 ON n2.oid = c2.relnamespace) i2
                      ON i2.inhrelid = c.oid
            LEFT JOIN pg_index ind ON (ind.indrelid = c.oid) and (ind.indisclustered = 't')
            LEFT JOIN pg_class ci ON ci.oid = ind.indexrelid
            LEFT JOIN pg_foreign_table ft ON ft.ftrelid = c.oid
            LEFT JOIN pg_foreign_server fs ON ft.ftserver = fs.oid
   WHERE ((c.relkind = 'r'::"char") OR (c.relkind = 'f'::"char"))
     AND n.nspname = 'public'
   ORDER BY schemaname, tablename;
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuichenchuxin commented on issue #13571: Improve sql support of shardingsphere-parser

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #13571:
URL: https://github.com/apache/shardingsphere/issues/13571#issuecomment-966947674


   in postgres
   ```
   SELECT COUNT(*)
   FROM pg_class c
            LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
   WHERE c.relkind = ANY ('{r,v,m}'::char[])
   UNION
   SELECT COUNT(*)
   FROM pg_attribute a
            JOIN pg_class c on a.attrelid = c.oid
            JOIN pg_namespace n on c.relnamespace = n.oid
            JOIN pg_type tp on tp.typelem = a.atttypid
   WHERE a.attnum > 0
   UNION
   SELECT COUNT(*)
   FROM information_schema.routines
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuichenchuxin commented on issue #13571: Improve sql support of shardingsphere-parser

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #13571:
URL: https://github.com/apache/shardingsphere/issues/13571#issuecomment-966948844


   in postgres
   ```
   SELECT t.oid                                                               AS oid,
          (n.nspname)::information_schema.sql_identifier                      AS trigger_schema,
          (t.tgname)::information_schema.sql_identifier                       AS trigger_name,
          (c.relname)::information_schema.sql_identifier                      AS trigger_table_name,
          (em.text)::information_schema.character_data                        AS event_manipulation,
          (c.relkind)::information_schema.sql_identifier                      AS trigger_table_type,
          (nsp.nspname)::information_schema.sql_identifier                    AS referenced_table_schema,
          (cs.relname)::information_schema.sql_identifier                     AS referenced_table,
          t.tgdeferrable                                                      AS is_deferrable,
          t.tginitdeferred                                                    AS is_deferred,
          (np.nspname)::information_schema.sql_identifier                     AS function_schema,
          (p.proname)::information_schema.sql_identifier                      AS function_name,
          ("substring"(pg_get_triggerdef(t.oid),
                       ("position"("substring"(pg_get_triggerdef(t.oid), 48), 'EXECUTE PROCEDURE'::text) +
                        47)))::information_schema.character_data              AS action_statement,
          (CASE
               WHEN (((t.tgtype)::integer & 1) = 1) THEN 'ROW'::text
               ELSE 'STATEMENT'::text END)::information_schema.character_data AS for_each,
          (CASE
               WHEN (((t.tgtype)::integer & 2) = 2) THEN 'BEFORE'::text
               ELSE 'AFTER'::text END)::information_schema.character_data     AS fire_time,
          t.tgenabled                                                         AS enabled,
          (CASE
               WHEN pg_has_role(c.relowner, 'USAGE'::text) THEN (SELECT rm.m[1] AS m
                                                                 FROM regexp_matches(pg_get_triggerdef(t.oid),
                                                                                     (E'.{35,} WHEN \((.+)\) EXECUTE PROCEDURE'::text)) rm(m)
                                                                 LIMIT 1)
               ELSE NULL::text END)::information_schema.character_data        AS condition,
          tc.event_object_column                                              AS update_columns,
          (t.tgconstraint > 0)                                                AS is_constraint,
          t.tgisinternal                                                      AS is_internal,
          obj_description(t.oid)                                              AS comment
   FROM pg_trigger t
            INNER JOIN pg_class c ON t.tgrelid = c.oid
            LEFT JOIN pg_namespace n ON c.relnamespace = n.oid
            LEFT JOIN pg_proc p ON t.tgfoid = p.oid
            LEFT JOIN pg_namespace np ON p.pronamespace = np.oid
            LEFT JOIN (((SELECT 4, 'INSERT' UNION ALL SELECT 8, 'DELETE') UNION ALL SELECT 16, 'UPDATE')
                       UNION ALL
                       SELECT 32, 'TRUNCATE') em(num, text) ON ((t.tgtype)::integer & em.num) <> 0
            LEFT OUTER JOIN (SELECT oid, relnamespace, relname FROM pg_class) cs ON (t.tgconstrrelid = cs.oid)
            LEFT OUTER JOIN (SELECT oid, nspname FROM pg_namespace) nsp ON (cs.relnamespace = nsp.oid)
            LEFT JOIN information_schema.triggered_update_columns tc
                      ON (tc.trigger_schema = n.nspname) AND (tc.trigger_name = t.tgname) AND
                         (tc.event_object_schema = n.nspname) AND (tc.event_object_table = c.relname)
   WHERE (n.nspname)::information_schema.sql_identifier = 'public'
     AND (c.relname)::information_schema.sql_identifier = 't_order'
   ORDER BY c.relname, t.tgname ASC
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ZWMdarker commented on issue #13571: Improve sql support of shardingsphere-parser

Posted by GitBox <gi...@apache.org>.
ZWMdarker commented on issue #13571:
URL: https://github.com/apache/shardingsphere/issues/13571#issuecomment-987646578


   pg   union / union all


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuichenchuxin removed a comment on issue #13571: Improve sql support of shardingsphere-parser

Posted by GitBox <gi...@apache.org>.
tuichenchuxin removed a comment on issue #13571:
URL: https://github.com/apache/shardingsphere/issues/13571#issuecomment-966936115


   in pg this sql is not supported
   ```
   SELECT c.oid,
          n.nspname                                                        AS schemaname,
          c.relname                                                        AS tablename,
          c.relacl,
          pg_get_userbyid(c.relowner)                                      AS tableowner,
          obj_description(c.oid)                                           AS description,
          c.relkind,
          ci.relname                                                       As cluster,
          c.relhasoids                                                     AS hasoids,
          c.relhasindex                                                    AS hasindexes,
          c.relhasrules                                                    AS hasrules,
          t.spcname                                                        AS tablespace,
          c.reloptions                                                     AS param,
          c.relhastriggers                                                 AS hastriggers,
          c.relpersistence                                                 AS unlogged,
          ft.ftoptions,
          fs.srvname,
          c.reltuples,
          ((SELECT count(*) FROM pg_inherits WHERE inhparent = c.oid) > 0) AS inhtable,
          i2.nspname                                                       AS inhschemaname,
          i2.relname                                                       AS inhtablename
   FROM pg_class c
            LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
            LEFT JOIN pg_tablespace t ON t.oid = c.reltablespace
            LEFT JOIN (pg_inherits i INNER JOIN pg_class c2 ON i.inhparent = c2.oid LEFT JOIN pg_namespace n2 ON n2.oid = c2.relnamespace) i2
                      ON i2.inhrelid = c.oid
            LEFT JOIN pg_index ind ON (ind.indrelid = c.oid) and (ind.indisclustered = 't')
            LEFT JOIN pg_class ci ON ci.oid = ind.indexrelid
            LEFT JOIN pg_foreign_table ft ON ft.ftrelid = c.oid
            LEFT JOIN pg_foreign_server fs ON ft.ftserver = fs.oid
   WHERE ((c.relkind = 'r'::"char") OR (c.relkind = 'f'::"char"))
     AND n.nspname = 'public'
   ORDER BY schemaname, tablename;
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] menghaoranss closed issue #13571: Improve sql support of shardingsphere-parser

Posted by GitBox <gi...@apache.org>.
menghaoranss closed issue #13571:
URL: https://github.com/apache/shardingsphere/issues/13571


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuichenchuxin commented on issue #13571: Improve sql support of shardingsphere-parser

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #13571:
URL: https://github.com/apache/shardingsphere/issues/13571#issuecomment-966940898


   in postgresql
   ```
   SELECT d.oid,
          d.datname                               AS databasename,
          d.datacl,
          d.datistemplate,
          d.datallowconn,
          pg_get_userbyid(d.datdba)               AS databaseowner,
          d.datcollate,
          d.datctype,
          shobj_description(d.oid, 'pg_database') AS description,
          d.datconnlimit,
          t.spcname,
          d.encoding,
          pg_encoding_to_char(d.encoding)         AS encodingname
   FROM pg_database d
            LEFT JOIN pg_tablespace t ON d.dattablespace = t.oid
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuichenchuxin commented on issue #13571: Improve sql support of shardingsphere-parser

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #13571:
URL: https://github.com/apache/shardingsphere/issues/13571#issuecomment-987656616


   > pg union / union all
   
   pg union / union all has been supported in shardingsphere-parse. And we'll support these sql execute soon.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org