-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for Bug#23204652, Bug#71929 (18346501) and Bug#103612 (32902019).
Fix for Bug#23204652, CURSOR POSITIONING API'S DOESNOT CHECK THE VALIDITY OF RESULTSET. Fix for Bug#71929 (18346501), Prefixing query with double comments cancels query DML validation. Fix for Bug#103612 (32902019), Incorrectly identified WITH...SELECT as unsafe for read-only connections.
- Loading branch information
Showing
19 changed files
with
2,007 additions
and
998 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2021, Oracle and/or its affiliates. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, version 2.0, as published by the | ||
* Free Software Foundation. | ||
* | ||
* This program is also distributed with certain software (including but not | ||
* limited to OpenSSL) that is licensed under separate terms, as designated in a | ||
* particular file or component or in included license documentation. The | ||
* authors of MySQL hereby grant you an additional permission to link the | ||
* program and your derivative works with the separately licensed software that | ||
* they have included with MySQL. | ||
* | ||
* Without limiting anything contained in the foregoing, this file, which is | ||
* part of MySQL Connector/J, is also subject to the Universal FOSS Exception, | ||
* version 1.0, a copy of which can be found at | ||
* http://oss.oracle.com/licenses/universal-foss-exception. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, Inc., | ||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
package com.mysql.cj; | ||
|
||
/** | ||
* The possible return types from executing queries. | ||
*/ | ||
public enum QueryReturnType { | ||
PRODUCES_RESULT_SET, MAY_PRODUCE_RESULT_SET, DOES_NOT_PRODUCE_RESULT_SET, NONE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
src/main/core-api/java/com/mysql/cj/util/SearchMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/* | ||
* Copyright (c) 2021, Oracle and/or its affiliates. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, version 2.0, as published by the | ||
* Free Software Foundation. | ||
* | ||
* This program is also distributed with certain software (including but not | ||
* limited to OpenSSL) that is licensed under separate terms, as designated in a | ||
* particular file or component or in included license documentation. The | ||
* authors of MySQL hereby grant you an additional permission to link the | ||
* program and your derivative works with the separately licensed software that | ||
* they have included with MySQL. | ||
* | ||
* Without limiting anything contained in the foregoing, this file, which is | ||
* part of MySQL Connector/J, is also subject to the Universal FOSS Exception, | ||
* version 1.0, a copy of which can be found at | ||
* http://oss.oracle.com/licenses/universal-foss-exception. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, write to the Free Software Foundation, Inc., | ||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
package com.mysql.cj.util; | ||
|
||
import java.util.Collections; | ||
import java.util.EnumSet; | ||
import java.util.Set; | ||
|
||
/** | ||
* Search mode flags enumeration. Primarily used by {@link StringInspector}. | ||
*/ | ||
public enum SearchMode { | ||
/** | ||
* Allow backslash escapes. | ||
*/ | ||
ALLOW_BACKSLASH_ESCAPE, | ||
/** | ||
* Skip between markers (quoted text, quoted identifiers, text between parentheses). | ||
*/ | ||
SKIP_BETWEEN_MARKERS, | ||
/** | ||
* Skip between block comments ("/* text... *\/") but not between hint blocks. | ||
*/ | ||
SKIP_BLOCK_COMMENTS, | ||
/** | ||
* Skip line comments ("-- text...", "# text..."). | ||
*/ | ||
SKIP_LINE_COMMENTS, | ||
/** | ||
* Skip MySQL specific markers ("/*![12345]" and "*\/") but not their contents. | ||
*/ | ||
SKIP_MYSQL_MARKERS, | ||
/** | ||
* Skip hint blocks ("/*+ text... *\/"). | ||
*/ | ||
SKIP_HINT_BLOCKS, | ||
/** | ||
* Skip white space. | ||
*/ | ||
SKIP_WHITE_SPACE, | ||
/** | ||
* Dummy search mode. Does nothing. | ||
*/ | ||
VOID; | ||
|
||
/* | ||
* Convenience EnumSets for several SearchMode combinations | ||
*/ | ||
|
||
/** | ||
* Full search mode: allow backslash escape, skip between markers, skip block comments, skip line comments, skip MySQL markers, skip hint blocks and skip | ||
* white space. | ||
* This is technically equivalent to __BSE_MRK_COM_MYM_HNT_WS. | ||
*/ | ||
public static final Set<SearchMode> __FULL = Collections.unmodifiableSet(EnumSet.allOf(SearchMode.class)); | ||
|
||
/** | ||
* Search mode: allow backslash escape, skip between markers, skip block comments, skip line comments, skip MySQL markers, skip hint blocks and skip | ||
* white space. | ||
*/ | ||
public static final Set<SearchMode> __BSE_MRK_COM_MYM_HNT_WS = Collections.unmodifiableSet(EnumSet.of(ALLOW_BACKSLASH_ESCAPE, SKIP_BETWEEN_MARKERS, | ||
SKIP_BLOCK_COMMENTS, SKIP_LINE_COMMENTS, SKIP_MYSQL_MARKERS, SKIP_HINT_BLOCKS, SKIP_WHITE_SPACE)); | ||
|
||
/** | ||
* Search mode: skip between markers, skip block comments, skip line comments, skip MySQL markers, skip hint blocks and skip white space. | ||
*/ | ||
public static final Set<SearchMode> __MRK_COM_MYM_HNT_WS = Collections | ||
.unmodifiableSet(EnumSet.of(SKIP_BETWEEN_MARKERS, SKIP_BLOCK_COMMENTS, SKIP_LINE_COMMENTS, SKIP_MYSQL_MARKERS, SKIP_HINT_BLOCKS, SKIP_WHITE_SPACE)); | ||
|
||
/** | ||
* Search mode: allow backslash escape, skip block comments, skip line comments, skip MySQL markers, skip hint blocks and skip white space. | ||
*/ | ||
public static final Set<SearchMode> __BSE_COM_MYM_HNT_WS = Collections.unmodifiableSet( | ||
EnumSet.of(ALLOW_BACKSLASH_ESCAPE, SKIP_BLOCK_COMMENTS, SKIP_LINE_COMMENTS, SKIP_MYSQL_MARKERS, SKIP_HINT_BLOCKS, SKIP_WHITE_SPACE)); | ||
|
||
/** | ||
* Search mode: skip block comments, skip line comments, skip MySQL markers, skip hint blocks and skip white space. | ||
*/ | ||
public static final Set<SearchMode> __COM_MYM_HNT_WS = Collections | ||
.unmodifiableSet(EnumSet.of(SKIP_BLOCK_COMMENTS, SKIP_LINE_COMMENTS, SKIP_MYSQL_MARKERS, SKIP_HINT_BLOCKS, SKIP_WHITE_SPACE)); | ||
|
||
/** | ||
* Search mode: allow backslash escape, skip between markers and skip white space. | ||
*/ | ||
public static final Set<SearchMode> __BSE_MRK_WS = Collections.unmodifiableSet(EnumSet.of(ALLOW_BACKSLASH_ESCAPE, SKIP_BETWEEN_MARKERS, SKIP_WHITE_SPACE)); | ||
|
||
/** | ||
* Search mode: skip between markers and skip white space. | ||
*/ | ||
public static final Set<SearchMode> __MRK_WS = Collections.unmodifiableSet(EnumSet.of(SKIP_BETWEEN_MARKERS, SKIP_WHITE_SPACE)); | ||
|
||
/** | ||
* Empty search mode. | ||
* There must be at least one element so that the Set may be later duplicated if needed. | ||
*/ | ||
public static final Set<SearchMode> __NONE = Collections.unmodifiableSet(EnumSet.of(VOID)); | ||
} |
Oops, something went wrong.