You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2022/12/02 16:10:04 UTC

[incubator-streampark] branch dev updated: [Bug] postgres syntax error fixed #2104 (#2105)

This is an automated email from the ASF dual-hosted git repository.

benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new 99cae4603 [Bug] postgres syntax error fixed #2104 (#2105)
99cae4603 is described below

commit 99cae4603cd195621416ead079a034cc41126468
Author: zhangxiangyang <10...@qq.com>
AuthorDate: Sat Dec 3 00:09:57 2022 +0800

    [Bug] postgres syntax error fixed #2104 (#2105)
---
 .../src/assembly/script/data/pgsql-data.sql        | 136 ++++++++++-----------
 .../src/assembly/script/schema/pgsql-schema.sql    |   6 +-
 .../main/resources/mapper/system/UserMapper.xml    |   3 +-
 3 files changed, 72 insertions(+), 73 deletions(-)

diff --git a/streampark-console/streampark-console-service/src/assembly/script/data/pgsql-data.sql b/streampark-console/streampark-console-service/src/assembly/script/data/pgsql-data.sql
index 4b83e0f64..a130843c4 100644
--- a/streampark-console/streampark-console-service/src/assembly/script/data/pgsql-data.sql
+++ b/streampark-console/streampark-console-service/src/assembly/script/data/pgsql-data.sql
@@ -46,74 +46,74 @@ insert into "public"."t_flink_sql" values (100000, 100000, 'eNqlUUtPhDAQvu+vmFs1
 -- ----------------------------
 -- Records of t_menu
 -- ----------------------------
-insert into "public"."t_menu" values (100000, 0, 'menu.system', '/system', 'PageView', null, 'desktop', '0', 1, 1, now(), now());
-insert into "public"."t_menu" values (100001, 100000, 'menu.userManagement', '/system/user', 'system/user/User', null, 'user', '0', 1, 1, now(), now());
-insert into "public"."t_menu" values (100002, 100000, 'menu.roleManagement', '/system/role', 'system/role/Role', null, 'smile', '0', 1, 2, now(), now());
-insert into "public"."t_menu" values (100003, 100000, 'menu.menuManagement', '/system/menu', 'system/menu/Menu', 'menu:view', 'bars', '0', 1, 3, now(), now());
-insert into "public"."t_menu" values (100004, 100001, 'add', null, null, 'user:add', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100005, 100001, 'update', null, null, 'user:update', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100006, 100001, 'delete', null, null, 'user:delete', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100007, 100002, 'add', null, null, 'role:add', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100008, 100002, 'update', null, null, 'role:update', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100009, 100002, 'delete', null, null, 'role:delete', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100012, 100001, 'reset', null, null, 'user:reset', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100013, 0, 'StreamPark', '/flink', 'PageView', null, 'build', '0', 1, 2, now(), now());
-insert into "public"."t_menu" values (100014, 100013, 'menu.project', '/flink/project', 'flink/project/View', null, 'github', '0', 1, 1, now(), now());
-insert into "public"."t_menu" values (100015, 100013, 'menu.application', '/flink/app', 'flink/app/View', null, 'mobile', '0', 1, 2, now(), now());
-insert into "public"."t_menu" values (100016, 100015, 'add', '/flink/app/add', 'flink/app/Add', 'app:create', '', '0', 0, null, now(), now());
-insert into "public"."t_menu" values (100017, 100014, 'add', '/flink/project/add', 'flink/project/Add', 'project:create', '', '0', 0, null, now(), now());
-insert into "public"."t_menu" values (100018, 100015, 'detail app', '/flink/app/detail', 'flink/app/Detail', 'app:detail', '', '0', 0, null, now(), now());
--- insert into "public"."t_menu" values (100019, 100013, 'Notebook', '/flink/notebook/view', 'flink/notebook/Submit', 'notebook:submit', 'read', '0', 1, 4, now(), now());
-insert into "public"."t_menu" values (100020, 100015, 'edit flink', '/flink/app/edit_flink', 'flink/app/EditFlink', 'app:update', '', '0', 0, null, now(), now());
-insert into "public"."t_menu" values (100021, 100015, 'edit streampark', '/flink/app/edit_streampark', 'flink/app/EditStreamPark', 'app:update', '', '0', 0, null, now(), now());
-insert into "public"."t_menu" values (100022, 100014, 'build', null, null, 'project:build', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100023, 100014, 'delete', null, null, 'project:delete', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100024, 100015, 'mapping', null, null, 'app:mapping', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100025, 100015, 'launch', null, null, 'app:launch', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100026, 100015, 'start', null, null, 'app:start', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100027, 100015, 'clean', null, null, 'app:clean', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100028, 100015, 'cancel', null, null, 'app:cancel', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100029, 100015, 'savepoint delete', null, null, 'savepoint:delete', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100030, 100015, 'backup rollback', null, null, 'backup:rollback', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100031, 100015, 'backup delete', null, null, 'backup:delete', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100032, 100015, 'conf delete', null, null, 'conf:delete', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100033, 100015, 'flame Graph', null, null, 'app:flameGraph', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100034, 100013, 'menu.setting', '/flink/setting', 'flink/setting/View', null, 'setting', '0', 1, 5, now(), now());
-insert into "public"."t_menu" values (100035, 100034, 'setting update', null, null, 'setting:update', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100036, 100014, 'edit', '/flink/project/edit', 'flink/project/Edit', 'project:update', null, '0', 0, null, now(), now());
-insert into "public"."t_menu" values (100037, 100015, 'delete', null, null, 'app:delete', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100038, 100000, 'menu.tokenManagement', '/system/token', 'system/token/Token', null, 'lock', '0', 1, 1, now(), now());
-insert into "public"."t_menu" values (100039, 100038, 'add', null, null, 'token:add', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100040, 100038, 'delete', null, null, 'token:delete', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100041, 100034, 'add cluster', '/flink/setting/add_cluster', 'flink/setting/AddCluster', 'cluster:create', '', '0', 0, null, now(), now());
-insert into "public"."t_menu" values (100042, 100034, 'edit cluster', '/flink/setting/edit_cluster', 'flink/setting/EditCluster', 'cluster:update', '', '0', 0, null, now(), now());
-insert into "public"."t_menu" values (100043, 100015, 'copy', null, null, 'app:copy', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100044, 100000, 'menu.teamManagement', '/system/team', 'system/team/Team', null, 'team', '0', 1, 2, now(), now());
-insert into "public"."t_menu" values (100045, 100044, 'add', null, null, 'team:add', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100046, 100044, 'update', null, null, 'team:update', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100047, 100044, 'delete', null, null, 'team:delete', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100048, 100000, 'menu.memberManagement', '/system/member', 'system/member/Member', null, 'usergroup-add', '0', 1, 2, now(), now());
-insert into "public"."t_menu" values (100049, 100048, 'add', null, null, 'member:add', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100050, 100048, 'update', null, null, 'member:update', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100051, 100048, 'delete', null, null, 'member:delete', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100052, 100048, 'role view', null, null, 'role:view', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100053, 100001, 'types', null, null, 'user:types', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100054, 100013, 'menu.variable', '/flink/variable', 'flink/variable/View', null, 'code', '0', 1, 3, now(), now());
-insert into "public"."t_menu" values (100055, 100054, 'add', NULL, NULL, 'variable:add', NULL, '1', 1, NULL, now(), now());
-insert into "public"."t_menu" values (100056, 100054, 'update', NULL, NULL, 'variable:update', NULL, '1', 1, NULL, now(), now());
-insert into "public"."t_menu" values (100057, 100054, 'delete', NULL, NULL, 'variable:delete', NULL, '1', 1, NULL, now(), now());
-insert into "public"."t_menu" values (100058, 100054, 'depend apps', '/flink/variable/depend_apps', 'flink/variable/DependApps', 'variable:depend_apps', '', '0', 0, NULL, now(), now());
-insert into "public"."t_menu" values (100059, 100054, 'show original', NULL, NULL, 'variable:show_original', NULL, '1', 1, NULL, now(), now());
-insert into "public"."t_menu" values (100060, 100001, 'view', null, null, 'user:view', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100061, 100038, 'view', null, null, 'token:view', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100062, 100002, 'view', null, null, 'role:view', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100063, 100044, 'view', null, null, 'team:view', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100064, 100048, 'view', null, null, 'member:view', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100066, 100014, 'view', null, null, 'project:view', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100067, 100015, 'view', null, null, 'app:view', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100068, 100054, 'view', NULL, NULL, 'variable:view', NULL, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100069, 100034, 'view', null, null, 'setting:view', null, '1', 1, null, now(), now());
-insert into "public"."t_menu" values (100070, 100054, 'depend view', null, null, 'variable:depend_apps', null, '1', 1, NULL, now(), now());
+insert into "public"."t_menu" values (100000, 0, 'menu.system', '/system', 'PageView', null, 'desktop', '0', '1', 1, now(), now());
+insert into "public"."t_menu" values (100001, 100000, 'menu.userManagement', '/system/user', 'system/user/User', null, 'user', '0', '1', 1, now(), now());
+insert into "public"."t_menu" values (100002, 100000, 'menu.roleManagement', '/system/role', 'system/role/Role', null, 'smile', '0', '1', 2, now(), now());
+insert into "public"."t_menu" values (100003, 100000, 'menu.menuManagement', '/system/menu', 'system/menu/Menu', 'menu:view', 'bars', '0', '1', 3, now(), now());
+insert into "public"."t_menu" values (100004, 100001, 'add', null, null, 'user:add', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100005, 100001, 'update', null, null, 'user:update', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100006, 100001, 'delete', null, null, 'user:delete', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100007, 100002, 'add', null, null, 'role:add', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100008, 100002, 'update', null, null, 'role:update', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100009, 100002, 'delete', null, null, 'role:delete', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100012, 100001, 'reset', null, null, 'user:reset', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100013, 0, 'StreamPark', '/flink', 'PageView', null, 'build', '0', '1', 2, now(), now());
+insert into "public"."t_menu" values (100014, 100013, 'menu.project', '/flink/project', 'flink/project/View', null, 'github', '0', '1', 1, now(), now());
+insert into "public"."t_menu" values (100015, 100013, 'menu.application', '/flink/app', 'flink/app/View', null, 'mobile', '0', '1', 2, now(), now());
+insert into "public"."t_menu" values (100016, 100015, 'add', '/flink/app/add', 'flink/app/Add', 'app:create', '', '0', '0', null, now(), now());
+insert into "public"."t_menu" values (100017, 100014, 'add', '/flink/project/add', 'flink/project/Add', 'project:create', '', '0', '0', null, now(), now());
+insert into "public"."t_menu" values (100018, 100015, 'detail app', '/flink/app/detail', 'flink/app/Detail', 'app:detail', '', '0', '0', null, now(), now());
+-- insert into "public"."t_menu" values (100019, 100013, 'Notebook', '/flink/notebook/view', 'flink/notebook/Submit', 'notebook:submit', 'read', '0', '1', 4, now(), now());
+insert into "public"."t_menu" values (100020, 100015, 'edit flink', '/flink/app/edit_flink', 'flink/app/EditFlink', 'app:update', '', '0', '0', null, now(), now());
+insert into "public"."t_menu" values (100021, 100015, 'edit streampark', '/flink/app/edit_streampark', 'flink/app/EditStreamPark', 'app:update', '', '0', '0', null, now(), now());
+insert into "public"."t_menu" values (100022, 100014, 'build', null, null, 'project:build', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100023, 100014, 'delete', null, null, 'project:delete', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100024, 100015, 'mapping', null, null, 'app:mapping', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100025, 100015, 'launch', null, null, 'app:launch', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100026, 100015, 'start', null, null, 'app:start', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100027, 100015, 'clean', null, null, 'app:clean', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100028, 100015, 'cancel', null, null, 'app:cancel', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100029, 100015, 'savepoint delete', null, null, 'savepoint:delete', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100030, 100015, 'backup rollback', null, null, 'backup:rollback', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100031, 100015, 'backup delete', null, null, 'backup:delete', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100032, 100015, 'conf delete', null, null, 'conf:delete', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100033, 100015, 'flame Graph', null, null, 'app:flameGraph', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100034, 100013, 'menu.setting', '/flink/setting', 'flink/setting/View', null, 'setting', '0', '1', 5, now(), now());
+insert into "public"."t_menu" values (100035, 100034, 'setting update', null, null, 'setting:update', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100036, 100014, 'edit', '/flink/project/edit', 'flink/project/Edit', 'project:update', null, '0', '0', null, now(), now());
+insert into "public"."t_menu" values (100037, 100015, 'delete', null, null, 'app:delete', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100038, 100000, 'menu.tokenManagement', '/system/token', 'system/token/Token', null, 'lock', '0', '1', 1, now(), now());
+insert into "public"."t_menu" values (100039, 100038, 'add', null, null, 'token:add', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100040, 100038, 'delete', null, null, 'token:delete', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100041, 100034, 'add cluster', '/flink/setting/add_cluster', 'flink/setting/AddCluster', 'cluster:create', '', '0', '0', null, now(), now());
+insert into "public"."t_menu" values (100042, 100034, 'edit cluster', '/flink/setting/edit_cluster', 'flink/setting/EditCluster', 'cluster:update', '', '0', '0', null, now(), now());
+insert into "public"."t_menu" values (100043, 100015, 'copy', null, null, 'app:copy', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100044, 100000, 'menu.teamManagement', '/system/team', 'system/team/Team', null, 'team', '0', '1', 2, now(), now());
+insert into "public"."t_menu" values (100045, 100044, 'add', null, null, 'team:add', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100046, 100044, 'update', null, null, 'team:update', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100047, 100044, 'delete', null, null, 'team:delete', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100048, 100000, 'menu.memberManagement', '/system/member', 'system/member/Member', null, 'usergroup-add', '0', '1', 2, now(), now());
+insert into "public"."t_menu" values (100049, 100048, 'add', null, null, 'member:add', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100050, 100048, 'update', null, null, 'member:update', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100051, 100048, 'delete', null, null, 'member:delete', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100052, 100048, 'role view', null, null, 'role:view', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100053, 100001, 'types', null, null, 'user:types', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100054, 100013, 'menu.variable', '/flink/variable', 'flink/variable/View', null, 'code', '0', '1', 3, now(), now());
+insert into "public"."t_menu" values (100055, 100054, 'add', NULL, NULL, 'variable:add', NULL, '1', '1', NULL, now(), now());
+insert into "public"."t_menu" values (100056, 100054, 'update', NULL, NULL, 'variable:update', NULL, '1', '1', NULL, now(), now());
+insert into "public"."t_menu" values (100057, 100054, 'delete', NULL, NULL, 'variable:delete', NULL, '1', '1', NULL, now(), now());
+insert into "public"."t_menu" values (100058, 100054, 'depend apps', '/flink/variable/depend_apps', 'flink/variable/DependApps', 'variable:depend_apps', '', '0', '0', NULL, now(), now());
+insert into "public"."t_menu" values (100059, 100054, 'show original', NULL, NULL, 'variable:show_original', NULL, '1', '1', NULL, now(), now());
+insert into "public"."t_menu" values (100060, 100001, 'view', null, null, 'user:view', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100061, 100038, 'view', null, null, 'token:view', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100062, 100002, 'view', null, null, 'role:view', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100063, 100044, 'view', null, null, 'team:view', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100064, 100048, 'view', null, null, 'member:view', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100066, 100014, 'view', null, null, 'project:view', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100067, 100015, 'view', null, null, 'app:view', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100068, 100054, 'view', NULL, NULL, 'variable:view', NULL, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100069, 100034, 'view', null, null, 'setting:view', null, '1', '1', null, now(), now());
+insert into "public"."t_menu" values (100070, 100054, 'depend view', null, null, 'variable:depend_apps', null, '1', '1', NULL, now(), now());
 
 -- ----------------------------
 -- Records of t_role
diff --git a/streampark-console/streampark-console-service/src/assembly/script/schema/pgsql-schema.sql b/streampark-console/streampark-console-service/src/assembly/script/schema/pgsql-schema.sql
index ecefb7de6..ae26f74c4 100644
--- a/streampark-console/streampark-console-service/src/assembly/script/schema/pgsql-schema.sql
+++ b/streampark-console/streampark-console-service/src/assembly/script/schema/pgsql-schema.sql
@@ -462,7 +462,7 @@ create table "public"."t_flink_project" (
 )
 ;
 alter table "public"."t_flink_project" add constraint "t_flink_project_pkey" primary key ("id");
-create index "inx_team" on "public"."t_flink_project" using btree (
+create index "inx_team_pro" on "public"."t_flink_project" using btree (
   "team_id" "pg_catalog"."int8_ops" asc nulls last
 );
 
@@ -614,8 +614,8 @@ create table "public"."t_variable" (
   "variable_code" varchar(100) collate "pg_catalog"."default" not null,
   "variable_value" text collate "pg_catalog"."default" not null,
   "description" text collate "pg_catalog"."default" default null,
-  "creator_id" int8 collate "pg_catalog"."default" not null,
-  "team_id" int8 collate "pg_catalog"."default" not null,
+  "creator_id" int8  not null,
+  "team_id" int8  not null,
   "desensitization" boolean not null default false,
   "create_time" timestamp(6) not null default timezone('UTC-8'::text, (now())::timestamp(0) without time zone),
   "modify_time" timestamp(6) not null default timezone('UTC-8'::text, (now())::timestamp(0) without time zone)
diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/system/UserMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/system/UserMapper.xml
index 0c73e18b2..142b2c1ae 100644
--- a/streampark-console/streampark-console-service/src/main/resources/mapper/system/UserMapper.xml
+++ b/streampark-console/streampark-console-service/src/main/resources/mapper/system/UserMapper.xml
@@ -71,8 +71,7 @@
             select distinct(user_id) as user_id
             from t_flink_app
             where team_id = #{teamId}
-        ) t
-        where u.user_id = t.user_id
+        ) t on  u.user_id = t.user_id
     </select>
 
     <update id="clearLastTeamByUserId" parameterType="java.lang.Long">