{@inheritdoc}

SQL Anywhere supports a maximum length of 128 bytes for identifiers.
769260
public function fixSchemaElementName($schemaElementName)
    {
        $maxIdentifierLength = $this->getMaxIdentifierLength();

        if (strlen($schemaElementName) > $maxIdentifierLength) {
            return substr($schemaElementName, 0, $maxIdentifierLength);
        }

        return $schemaElementName;
    }
1104551
private function getIntegerSQLDeclarationSnippet(array $options = array())
    {
        $length = isset($options['length']) ? (int) $options['length'] : null;
        $unsigned = isset($options['unsigned']) && $options['unsigned'] ? ' UNSIGNED' : null;
        $autoIncrement = isset($options['auto_increment']) && $options['auto_increment'] ? ' AUTO_INCREMENT' : null;

        $sql = $unsigned.$autoIncrement;

        if ($length !== null) {
            $sql = '('.$length.')'.$sql;
        }

        return $sql;
    }
1229690
@Deprecated
    public C verifyAtMost(int allowedStatements, Threads threadMatcher) throws WrongNumberOfQueriesError {
        return verify(SqlQueries.maxQueries(allowedStatements).threads(threadMatcher));
    }
734372
private int staticEncodingLength(GenericPropertyInfo info) {
        TypeDesc type = info.getStorageType();
        TypeDesc primType = type.toPrimitiveType();

        if (primType == null) {
            if (info.isLob()) {
                // Lob locator is stored as a long.
                return 8;
            }
        } else {
            if (info.isNullable()) {
                // Type is a primitive wrapper.
                switch (primType.getTypeCode()) {
                case TypeDesc.BYTE_CODE:
                    return ~1;
                case TypeDesc.BOOLEAN_CODE:
                    return 1;
                case TypeDesc.SHORT_CODE:
                case TypeDesc.CHAR_CODE:
                    return ~1;
                case TypeDesc.INT_CODE:
                    return ~1;
                case TypeDesc.FLOAT_CODE:
                    return 4;
                case TypeDesc.LONG_CODE:
                    return ~1;
                case TypeDesc.DOUBLE_CODE:
                    return 8;
                }
            } else {
                // Type is primitive or a required primitive wrapper.
                switch (type.getTypeCode()) {
                case TypeDesc.BYTE_CODE:
                case TypeDesc.BOOLEAN_CODE:
                    return 1;
                case TypeDesc.SHORT_CODE:
                case TypeDesc.CHAR_CODE:
                    return 2;
                case TypeDesc.INT_CODE:
                case TypeDesc.FLOAT_CODE:
                    return 4;
                case TypeDesc.LONG_CODE:
                case TypeDesc.DOUBLE_CODE:
                    return 8;
                }
            }
        }

        return ~0;
    }
830943
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
	{
		$save = $this->_driver->fetchMode;
		$this->_driver->fetchMode = $this->fetchMode;
		$this->_driver->debug = $this->debug;
		$ret = $this->_driver->SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
		$this->_driver->fetchMode = $save;
		return $ret;
	}
425891
public function limit(string $sql, int $limit, $offset=FALSE): string
	{
		$sql .= "\nLIMIT {$limit}";

		if (is_numeric($offset))
		{
			$sql .= " OFFSET {$offset}";
		}

		return $sql;
	}
84408
@Override
    public byte getByte(int columnIndex) throws SQLException {
        checkColumnBounds(columnIndex);
        try {
            Long longValue = getPrivateInteger(columnIndex);
            if (longValue > Byte.MAX_VALUE || longValue < Byte.MIN_VALUE) {
                throw new SQLException("Value out of byte range");
            }
            return longValue.byteValue();
        } catch (Exception x) {
            throw SQLError.get(x);
        }
    }
76197
public static String getLimitSQL(String query, long offset, long length, String dbType) {
		if (query == null) {
			return null;
		}
		query = query.trim();
		if (StringUtils.startsWithIgnoreCase(query, "select")) {
			boolean isForUpdate = false;
			if (query.toLowerCase().endsWith(" for update")) {
				query = query.substring(0, query.length() - 11);
				isForUpdate = true;
			}

			StringBuffer pagingSelect = new StringBuffer(query.length() + 100);
			if (dbType.equalsIgnoreCase("oracle")) {
				if (offset > 0) {
					pagingSelect.append("select * from ( select row_.*, rownum rownum_ from ( ");
				} else {
					pagingSelect.append("select * from ( ");
				}
				pagingSelect.append(query);
				if (offset > 0) {
					pagingSelect.append(String.format(" ) row_ where rownum <= %d) where rownum_ > %d", length + offset, offset));
				} else {
					pagingSelect.append(String.format(" ) where rownum <= %d", length));
				}
			} else if (dbType.equalsIgnoreCase("mysql")) {
				pagingSelect.append("select * from ( ");
				pagingSelect.append(query);
				pagingSelect.append(String.format(" ) t limit %d, %d", offset, length));
			}

			if (isForUpdate) {
				pagingSelect.append(" for update");
			}

			return pagingSelect.toString();
		}
		return query;
	}
243129
final void setPSLong(PreparedStatement ps, int index, long value) throws SQLException {
        if (usingDB2Connect || usingSQLServer || usingDB2zOS) { // LIDB2775.25 zOS
            ps.setBigDecimal(index, BigDecimal.valueOf(value));
        } else {
            ps.setLong(index, value);
        }
    }
1353343
public function applyLimit(&$sql, $offset, $limit)
    {
        $offset = (int) $offset;
        $limit = (int) $limit;

        if ($limit >= 0) {
            $sql .= ' LIMIT ' . ($offset > 0 ? $offset . ', ' : '') . $limit;
        } elseif ($offset > 0) {
            $sql .= ' LIMIT ' . $offset . ', 18446744073709551615';
        }
    }
20666
function buildLimitPartial(requestQuery) {
        var sLimit = "";
        if (requestQuery && requestQuery.start !== undefined && self.dbType !== 'oracle') {
            var start = parseInt(requestQuery.start, 10);
            if (start >= 0) {
                var len = parseInt(requestQuery.length, 10);
                sLimit = (self.dbType === 'postgres') ? " OFFSET " + String(start) + " LIMIT " : " LIMIT " + String(start) + ", ";
                sLimit += ( len > 0 ) ? String(len) : String(DEFAULT_LIMIT);
            }
        }
        return sLimit;
    }
1346751
public String getSQLType(boolean bIncludeLength, Map<String, Object> properties) 
    {
        String strType = (String)properties.get(DBSQLTypes.SHORT);
        if (strType == null)
            strType = DBSQLTypes.SMALLINT;      // The default SQL Type (Byte)
        return  strType;        // The default SQL Type
    }
1340577
private String replaceAndAppendLimit(String parsedQuery)
    {
        StringBuilder builder = new StringBuilder(parsedQuery);
        onLimit(builder);
        parsedQuery = builder.toString();
        return parsedQuery;
    }
295320
static String sqlToRegexSimilar(
		String sqlPattern,
		char escapeChar) {
		similarEscapeRuleChecking(sqlPattern, escapeChar);

		boolean insideCharacterEnumeration = false;
		final StringBuilder javaPattern =
			new StringBuilder(sqlPattern.length() * 2);
		final int len = sqlPattern.length();
		for (int i = 0; i < len; i++) {
			char c = sqlPattern.charAt(i);
			if (c == escapeChar) {
				if (i == (len - 1)) {
					// It should never reach here after the escape rule
					// checking.
					throw invalidEscapeSequence(sqlPattern, i);
				}
				char nextChar = sqlPattern.charAt(i + 1);
				if (SQL_SIMILAR_SPECIALS.indexOf(nextChar) >= 0) {
					// special character, use \ to replace the escape char.
					if (JAVA_REGEX_SPECIALS.indexOf(nextChar) >= 0) {
						javaPattern.append('\\');
					}
					javaPattern.append(nextChar);
				} else if (nextChar == escapeChar) {
					javaPattern.append(nextChar);
				} else {
					// It should never reach here after the escape rule
					// checking.
					throw invalidEscapeSequence(sqlPattern, i);
				}
				i++; // we already process the next char.
			} else {
				switch (c) {
					case '_':
						javaPattern.append('.');
						break;
					case '%':
						javaPattern.append("(?s:.*)");
						break;
					case '[':
						javaPattern.append('[');
						insideCharacterEnumeration = true;
						i = sqlSimilarRewriteCharEnumeration(
							sqlPattern,
							javaPattern,
							i,
							escapeChar);
						break;
					case ']':
						if (!insideCharacterEnumeration) {
							throw invalidRegularExpression(sqlPattern, i);
						}
						insideCharacterEnumeration = false;
						javaPattern.append(']');
						break;
					case '\\':
						javaPattern.append("\\\\");
						break;
					case '$':

						// $ is special character in java regex, but regular in
						// SQL regex.
						javaPattern.append("\\$");
						break;
					default:
						javaPattern.append(c);
				}
			}
		}
		if (insideCharacterEnumeration) {
			throw invalidRegularExpression(sqlPattern, len);
		}

		return javaPattern.toString();
	}
211652
public function maxlength($length = null, $addFilter = true, $utf8 = true)
    {
        if ($addFilter) {
            $this->addFilter(new MaxLengthFilter($length, $utf8));
        }

        return $this->attr('maxlength', $length);
    }
1316911
@Override
    public Parser newFixedLengthParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition) {
        return new DBFixedLengthParser(con, dataSourceStream, dataDefinition);
    }
11457
@Override
    public Parser newFixedLengthParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition) {
        throw new UnsupportedOperationException("Not supported...");
    }