1 Star 0 Fork 15

zhuangzt / openGauss-tools-sqlines

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

openGauss Sqlines 使用指导

[TOC]

Sqlines简介

Sqlines是一款开源软件,支持多种数据库之间的SQL语句语法的的转换,openGauss将此工具修改适配,新增了openGauss数据库选项,目前可以支持PostgreSQL、MySQL、Oracle向openGauss的SQL语法转换。

如何获取和使用

1、在社区下载代码到任意位置:openGauss/openGauss-tools-sqlines (gitee.com)

2、进入代码根目录下, 执行脚本编译安装sqlines:

[user@openGauss sqlines]$ sh build.sh -i

3、sqlines将安装到根目录下的/bin文件夹下,可将其添加到环境变量方便使用:

[user@openGauss sqlines]$ export PATH=$PATH:`pwd`/bin

4、使用sqlines

[user@openGauss sqlines]$ sqlines -?
SQLines 3.1.330 - SQL Assessment and Conversion Tool.
Portions Copyright (c) 2020 SQLines.
Portions Copyright (c) 2021 Huawei Technologies Co.,Ltd.
All Rights Reserved.

How to use:
    sqlines -option=value [...n]

Options:
   -s        - Source type
   -t        - Target type
   -in       - List of files (wildcards *.* are allowed)
   -out      - Output directory (the current directory by default)
   -log      - Log file (sqlines.log by default)
   -?        - Print how to use

Example:
Convert script.sql file from Oracle to openGauss
   ./sqlines -s=oracle -t=opengauss -in=script.sql

参数说明:

参数 值域 功能
-? - 帮助菜单
-s [ oracle | mysql | postgresql ] Source数据库
-t [ opengauss ] Target数据库
-in FILE_PATH 输入文件
-out [ FILE_PATH | /* empty */] 输出文件,不指定时输出在in文件夹,
-log [ FILE_PATH | /* empty */] 输出日志,不指定时输出在当前文件夹

5、执行脚本卸载sqlines:

[user@openGauss sqlines]$ sh build.sh -m

PostgreSQL to openGauss

删除IF

Create table IF NOT EXISTS tb as select * from basetb;
Create table IF NOT EXISTS tb as execute p1();
Create index IF NOT EXISTS idx on tb(a);
Create sequence IF NOT EXISTS sqc;
Create schema IF NOT EXISTS schm;

openGauss中很多语法暂时不支持 if not exists判断,因此在转换时会给删掉。

如: Create schema IF NOT EXISTS schm; => Create schema schm;

MySQL to openGauss

数据类型

MYSQL 数据类型 openGauss 数据类型 备注
TINYINT SMALLINT
MEDIUMINT INT
DOUBLE DOUBLE PRECISION
FLOAT DOUBLE PRECISION
DATETIME TIMESTAMP
TINYBLOB BYTEA
BLOB BYTEA
MEDIUNBLOB BYTEA
LONGBLOB BYTEA
TINYTEXT TEXT
MEDIUMTEXT TEXT
LONGTEXT TEXT
BINARY BYTEA
VARBINARY BYTEA

Mysql中很多数据类型与openGauss有差别,对于表中的数据类型,可以进行转换成为openGauss的数据类型。

CREATE TABLE

删除if

CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name select_statement

对于create table as语句,openGauss不支持使用 if not exists 判断,因此会删除if判断。

列约束

语法:column_definition:
  		col_name type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY] [COMMENT 'string'] [reference_definition]

举例:
Create table tb(a int NOT NULL, b text PRIMARY KEY, c int AUTO_INCREMENT……)括号内的部分。在创建表定义列时,可以立马为列指定很多的属性与约束,如NOT NULL等。

转换时行为如下:

AUTO_INCREMENT:在前面添加一句创建序列SQL,并将auto_increment转换为defualt nextval(seq);

COMMENT 'string':删除

表属性

table_option:
  {ENGINE|TYPE} = engine_name
 | AUTO_INCREMENT = value
 | AVG_ROW_LENGTH = value
 | [DEFAULT] CHARACTER SET charset_name [COLLATE collation_name]
 | CHECKSUM = {0 | 1}
 | COMMENT = 'string'
 | CONNECTION = 'connect_string'
 | MAX_ROWS = value
 | MIN_ROWS = value
 | PACK_KEYS = {0 | 1 | DEFAULT}
 | PASSWORD = 'string'
 | DELAY_KEY_WRITE = {0 | 1}
 | ROW_FORMAT = {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT}
 | UNION = (tbl_name[, tbl_name]...)
 | INSERT_METHOD = { NO | FIRST | LAST }
 | DATA DIRECTORY = 'absolute path to directory'
 | INDEX DIRECTORY = 'absolute path to directory'

举例:
Create table tb(a int) MAX_ROWS = 1000, CHECNSUM = 1, ……;中的MAX_ROWS等

openGauss 并不支持这个地方添加这些语法用来指定一些属性,转换时全部删除处理。

CREATE DATABASE

CREATE DATABASE [IF NOT EXISTS] db_name
    [create_specification [, create_specification] ...]
 
create_specification:
    [DEFAULT] CHARACTER SET charset_name
  | [DEFAULT] COLLATE = collation_name

1、openGauss 语法不支持 if 判断,转换时会删掉

2、对于创建参数,openGauss和mysql也不大一样。其行为如下:

**[DEFAULT] CHARACTER SET *charset_name***:  删除

[DEFAULT] COLLATE = collation_name: 将COLLATE转换为 LC_COLLATE

CREATE FUNCTION/PROCDURE

若不存在or replace则自动添加。

在 AS后的函数体部分,前后自动添加 $$ 符号。

语言属性自动添加或修改为 language plpgsql;

SQL%NOTFOUND => NOT FOUND

SQL%FOUND => FOUND

SQL%ROWCOUNT => V_SQLROWCOUNT

CREATE INDEX

CREATE [UNIQUE | FULLTEXT | SPATIAL] INDEX index_name
    [USING index_type]
    ON tbl_name (index_col_name,...)
 
index_col_name:
    col_name [(length)] [ASC | DESC]

openGauss 不支持FULLTEXT、SPATIAL类型的 index,因此若有这两种的话,转换时会删除这两个关键字。

CREATE SCHEMA

CREATE SCHEMA [IF NOT EXISTS] db_name
[create_specification [, create_specification] ...]
 
create_specification:
    [DEFAULT] CHARACTER SET charset_name
  | [DEFAULT] COLLATE collation_name

1、openGauss 的语法不支持if判断,转换时会删掉

2、对于创建参数,openGauss 和mysql也不大一样。其行为如下:

[DEFAULT] CHARACTER SET charset_name: 注释掉。

[DEFAULT] COLLATE collation_name: 将COLLATE关键字转换为 LC_COLLATE

ALTER TABLE

ALTER [IGNORE] TABLE tbl_name alter_specification [, alter_specification] ...
 
alter_specification:
    ADD [COLUMN] column_definition [FIRST | AFTER col_name ]
……

1、openGauss 不支持ignore选项,转换时会给删除。

2、ADD COLUMN时,openGauss 不支持使用first、after来指定列的位置,会将其删除。

DROP INDEX

DROP INDEX index_name ON tbl_name

openGauss 不支持on子句,如 drop index idxa on tba, 转换时会删掉ON子句。

INSERT

INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
    [INTO] tbl_name [(col_name,...)]     
    VALUES ({expr | DEFAULT},...),(...),...
    [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]

openGauss 的insert不支持 LOW_PRIORITY / DELAYED / HIGH_PROPRITY / IGNORE等选项,转换时会直接删掉这些选项。

UPDATE

UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
    SET col_name1=expr1 [, col_name2=expr2 ...]
    [WHERE where_definition]
    [ORDER BY ...]
    [LIMIT row_count]

openGauss 不支持 LOW_PRIORITY \ IGNORE 选项,转换时会直接删除

DELETE

single delete:
DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name
    [WHERE where_definition]
    [ORDER BY ...]
[LIMIT row_count]
 
muilty-delete:
DELETE [LOW_PRIORITY] [QUICK] [IGNORE]
    FROM tbl_name[.*] [, tbl_name[.*] ...]
    USING table_references
    [WHERE where_definition]
 

openGauss 不支持 LOW_PRIORITY \ QUICK \ IGNORE 选项,转换时会直接删除。

SELECT

SELECT
[ALL | DISTINCT | DISTINCTROW ] [HIGH_PRIORITY] [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT] [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
select_expr, ...
[INTO OUTFILE 'file_name' export_options | INTO DUMPFILE 'file_name']
[FROM table_references]
[WHERE where_definition]
[GROUP BY {col_name | expr | position} [ASC | DESC], ... [WITH ROLLUP]]
[HAVING where_definition]
[ORDER BY {col_name | expr | position}  [ASC | DESC] , ...]
[LIMIT {[offset,] row_count | row_count OFFSET offset}]
[FOR UPDATE | LOCK IN SHARE MODE]]

openGauss 不支持 DISTINCTROW 关键字,转换时会给删掉。

openGauss 不支持 [HIGH_PRIORITY] [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT] [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]这些关键字,转换时都会给删除。

RENAME

RENAME TABLE tbl_name TO new_tbl_name;

支持将rename语法转换为 alter table rename语法

​ 如: RENAME TABLE tba TO tbb; => ALTER TABLE tba RENAME TO tbb;

Oracle to openGauss

数据类型

ORACLE OPENGAUSS 备注
BINARY_FLOAT REAL
BINARY_DOUBLE DOUBLE PRECISION
BLOB BYTEA
CLOB TEXT
DATE TIMESTAMP
FLOAT DOUBLE PRECISION
INTERVAL YEAR(4) TO MONTH INTERVAL YEAR TO MONTH
INTERVAL DAY(4) TO SECOND(8) INTERVAL DAY TO SECOND(8)
TIMESTAMP WITH LOCAL TIME ZONE TIMESTAMP WITH TIME ZONE
LONG TEXT
LONG RAW BYTEA
NCHAR(8) CHAR(8)
NCHAR VARYING(7) VARCHAR(7)
NCLOB TEXT
NUMBER(8) INT
NUMBER(1,0) SMALLINT
NUMBER(4,0) SMALLINT
NUMBER(8,0) INT
NUMBER(12,0) BIGINT
NUMBER(20,0) DECIMAL(20,0)
NUMBER(10,2) DECIMAL(10,2)
NUMBER DOUBLE PRECISION
NUMBER(*) DOUBLE PRECISION
NVARCHAR2(12) VARCHAR(12)
RAW(8) BYTEA
REAL DOUBLE PRECISION
SMALLINT DECIMAL(38)
UROWID(16) VARCHAR(16)
VARCHAR2(18) VARCHAR(18)
BFILE VARCHAR(255)
ROWID CHAR(10)
SYS_REFCURSOR REFCURSOR
XMLTYPE XML

CREATE FUNCTION/PROCDURE

没有or replace时会给自动添加上。

在 AS后的函数体部分,前后自动添加 $$ 符号。

函数的语言属性自动修改或添加为 language plpgsql;

函数的 RETURN 关键字转换为 RETURNS

DBMS_OUTPUT.PUT_LINE('err'); => RAISE NOTICE '%','err';

调用传参操作符 => 会转换为 :=

EXISTS IF NOT FOUND => EXISTS

SQL%NOTFOUND => NOT FOUND

SQL%FOUND => FOUND

SQL%ROWCOUNT => V_SQLROWCOUNT

SYS_REFCURSOR => REFCURSOR

CREATE TABLE

CREATE [ GLOBAL TEMPORARY | SHARDED | DUPLICATED ] TABLE
  [ schema. ] table
  [ SHARING = { METADATA | DATA | EXTENDED DATA | NONE } ]
  { relational_table | object_table | XMLType_table }
  [ PARENT [ schema. ] table ] ;

openGauss没有SHARDED、 DUPLICATED的表,转换时会删除此关键字。

openGauss没有SHARING参数选项,转换时会删除此参数。

这些存储参数全部删除: SEGMENT、PCTFREE、PCTUSED、INITRANS、MAXTRANS、COMPRESS、NOCOMPRESS、NOCACHE、LOGGING、NOLOGGING、NOPARALLEL、PARALLEL、NOMONITORING、TABLESPACE 、STORAGE、LOB、COMPUTE、ENABLE、REVERSE

CREATE VIEW

CREATE [OR REPLACE]
  [[NO] FORCE] [ EDITIONING | EDITIONABLE [ EDITIONING ] | NONEDITIONABLE ]
VIEW [schema.] view
  [ SHARING = { METADATA | DATA | EXTENDED DATA | NONE } ]
  [ ( { alias [ VISIBLE | INVISIBLE ] [ inline_constraint... ]
      | out_of_line_constraint
      }
        [, { alias [ VISIBLE | INVISIBLE ] [ inline_constraint...]
           | out_of_line_constraint
           }
        ]
    )
  | object_view_clause
  | XMLType_view_clause
  ]
  [ DEFAULT COLLATION collation_name ]
  [ BEQUEATH { CURRENT_USER | DEFINER } ]
AS subquery [ subquery_restriction_clause ]
  [ CONTAINER_MAP | CONTAINERS_DEFAULT ] ;

CREATE OR REPLACEVIEW关键词之间的参数,[[NO] FORCE] [ EDITIONING | EDITIONABLE [ EDITIONING ] | NONEDITIONABLE ] 转换时会被删除。

[ SHARING = { METADATA | DATA | EXTENDED DATA | NONE } ]转换时会被删除。

CREATE SEQUENCE

CREATE SEQUENCE [ schema. ] sequence
  [ SHARING = { METADATA | DATA | NONE } ]
  [ { INCREMENT BY | START WITH } integer
  	| { MAXVALUE integer | NOMAXVALUE }
  	| { MINVALUE integer | NOMINVALUE }
 	| { CYCLE | NOCYCLE }
  	| { CACHE integer | NOCACHE }
  	| { ORDER | NOORDER }
  	| { KEEP | NOKEEP }
  	| { SESSION | GLOBAL }
  ]...
;

openGauss不支持[ SHARING = { METADATA | DATA | NONE } ],转换时会删除。

openGauss不支持参数NOCACHE, ORDER NOORDER,KEEP, NOKEEP, SESSION, GLOBAL,转换时会删除

ALTER INDEX

ALTER INDEX [ schema. ]index
  { { deallocate_unused_clause
    	| allocate_extent_clause
    	| shrink_clause
    	| parallel_clause
    	| physical_attributes_clause
    	| logging_clause
    	| partial_index_clause
    } ...
  	| rebuild_clause [ { DEFERRED | IMMEDIATE } INVALIDATION]
  	| PARAMETERS ( 'ODCI_parameters' )
  	| COMPILE
  	| { ENABLE | DISABLE }
  	| UNUSABLE [ ONLINE ] [ { DEFERRED | IMMEDIATE } INVALIDATION ]
  	| VISIBLE | INVISIBLE
  	| RENAME TO new_name
  	| COALESCE [ CLEANUP ] [ parallel_clause ]
  	| { MONITORING | NOMONITORING } USAGE
  	| UPDATE BLOCK REFERENCES
  	| alter_index_partitioning
  }
  ;

rebuild_clause 的三个参数,转换时会给删除。

​ 如:alter index idx rebuild immediate invalidation; => alter index idx rebuild;

ENABLE / VISABLE 关键字支持改为 REBUILD

​ 如:alter index idx enable; => alter index idx rebuild;

DISABLE / INVLSIBLE 支持改为 UNUSABLE

​ 如:alter index idx disable => alter index idx unusable;

openGauss的UNUSBALE后面没有参数,转换时给删除

​ 如:alter index idx ununsable online; => alter index idx ununsable;

ALTER SEQUENCE

ALTER SEQUENCE [ schema. ] sequence
  { INCREMENT BY integer
  | { MAXVALUE integer | NOMAXVALUE }
  | { MINVALUE integer | NOMINVALUE }
  | { CYCLE | NOCYCLE }
  | { CACHE integer | NOCACHE }
  | { ORDER | NOORDER }
  | { KEEP | NOKEEP }
  | { SESSION | GLOBAL }
  } ...
;

openGauss不支持参数 { MINVALUE integer | NOMINVALUE }{ CYCLE | NOCYCLE }NOCACHE{ ORDER | NOORDER }{ KEEP | NOKEEP }{ SESSION | GLOBAL },转换时会删掉。

DROP INDEX

DROP INDEX [ schema. ] index [ ONLINE ] [ FORCE ] [ { DEFERRED | IMMEDIATE } INVALIDATION ];

openGauss仅支持 DROP INDEX name;后面的参数 ONLINE \ FORCE \ DEFERRED \ IMMEDIATE \ INVALIDATION 转换时都会删除。

DROP MATERIALIZED VIEW

DROP MATERIALIZED VIEW [ schema. ] materialized_view
   [ PRESERVE TABLE ] ;

openGauss不支持加参数,后面的preserve table会被删掉。

DROP TABLE

DROP TABLE [ schema. ] table [ CASCADE CONSTRAINTS ] [ PURGE ] ;

后面的参数 cascade constraints、purge 会删掉。

DROP TABLESPACE

DROP TABLESPACE tablespace
  [ { DROP | KEEP } QUOTA ]
  [ INCLUDING CONTENTS [ { AND | KEEP } DATAFILES ] [ CASCADE CONSTRAINTS ] ]
  ;

openGauss只支持 DROP TABLESPACE tablespace;

各种选项参数都会被删除。

DROP TYPE

DROP TYPE [ schema. ] type_name [ FORCE | VALIDATE ] ;

openGauss不支持 FORCE \ VALIDATE参数,转换时会删除。

DROP VIEW

DROP VIEW [ schema. ] view [ CASCADE CONSTRAINTS ] ;

参数只保留cascade;

ANALYZE

ANALYZE
  { { TABLE [ schema. ] table
    | INDEX [ schema. ] index
    } [ partition_extension_clause ]
  | CLUSTER [ schema. ] cluster
  }
  { validation_clauses
  | LIST CHAINED ROWS [ into_clause ]
  | DELETE [ SYSTEM ] STATISTICS
  } ;

openGauss在analyze后面不支持添加 TABLE \ INDEX关键字,转换时会删除这两个关键字。

SELECT

  [ with_clause ]
SELECT [ hint ] [ { { DISTINCT | UNIQUE } | ALL } ] select_list
FROM { table_reference | join_clause | ( join_clause ) }
         [ , { table_reference | join_clause | (join_clause) } ] ...
  [ where_clause ]
  [ hierarchical_query_clause ]
  [ group_by_clause ]
  [ model_clause ]

对于某些情况,oracle需要加FROM DUAL,我们不需要,转换时会给删除。

​ 如: select 1 from dual; => select 1;

我们不支持unique关键字,会转变为distinct

​ 如:select unique * from tb; => select distinct * from tb;

EXECUTE

EXECUTE IMMEDIATE function();

我们不支持IMMEDIATE参数,会给删除。

GRANT

GRANT USAGE ON LANGUAGE SPL TO …

openGauss 内叫做plpgsql,会将SPL关键字转换为 PLPGSQL;

REVOKE

REVOKE USAGE ON LANGUAGE SPL FROM … 

openGauss 内叫做plpgsql,会将SPL关键字转换为 PLPGSQL;

RENAME

RENAME old_name TO new_name ;

支持将rename修改为alter table rename

​ 如: rename oldname to newname; => alter table oldname rename to newname;

TRUNCATE

TRUNCATE TABLE [schema.] table
  [ {PRESERVE | PURGE} MATERIALIZED VIEW LOG ]
  [ {DROP [ ALL ] | REUSE} STORAGE ] [ CASCADE ] ;

转换时最多仅会保留 truncate table name cascade;其他都会删除。

函数转换

有一些系统函数、无参函数等,是有差异的,但语义基本一样,因此可支持做一些映射

Source openGauss 备注
Charindex(str1, str2) Position(str1 in str2)
CURRENT DATE CURRENT_DATE
CURRENT TIMESTAMP CURRENT_TIMESTAMP
Convert(varchar, source) To_char(source)
USER CURRENT_USER
Getdate() Now()
ISNULL(expr, replace) COALESCE(expr, replace)
NVL(expr, expr) COALESCE(expr, expr)
SYSDATE() CURRENT_TIMESTAMP()
SYSTIMESTAMP CURRENT_TIMESTAMP
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2016 SQLines Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

暂无描述 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/zhuangzt/openGauss-tools-sqlines.git
git@gitee.com:zhuangzt/openGauss-tools-sqlines.git
zhuangzt
openGauss-tools-sqlines
openGauss-tools-sqlines
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891