Skip to content

Commit db4d3a3

Browse files
committed
5.4.19-20240428_17142882 release
1 parent 239c6ff commit db4d3a3

File tree

5 files changed

+43
-46
lines changed

5 files changed

+43
-46
lines changed

polardbx-common/src/main/java/com/alibaba/polardbx/common/properties/ConnectionParams.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3455,7 +3455,7 @@ public static class ConnectionParamValues {
34553455
ConnectionProperties.ADVISE_TYPE, null, true);
34563456

34573457
public static final BooleanConfigParam ENABLE_HLL = new BooleanConfigParam(
3458-
ConnectionProperties.ENABLE_HLL, false, true);
3458+
ConnectionProperties.ENABLE_HLL, true, true);
34593459

34603460
public static final IntConfigParam HLL_PARALLELISM = new IntConfigParam(
34613461
ConnectionProperties.HLL_PARALLELISM,

polardbx-net/src/main/java/com/alibaba/polardbx/net/AbstractConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public void read() throws IOException {
196196
lastReadTime = TimeUtil.currentTimeMillis();
197197
if (got < 0) {
198198
logout();
199-
throw new TddlRuntimeException(ERR_PACKET_READ, "end of stream has been reached unexpectedly");
199+
throw new EOFException();
200200
}
201201
buffer.writerIndex(buffer.writerIndex() + got);
202202
netInBytes += got;

polardbx-optimizer/src/main/java/com/alibaba/polardbx/optimizer/core/TddlRelDataTypeSystemImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ public boolean isSchemaCaseSensitive() {
4848
public RelDataType deriveSumType(RelDataTypeFactory typeFactory, RelDataType argumentType) {
4949
RelDataType sumType;
5050
switch (argumentType.getSqlTypeName()) {
51+
case DECIMAL:
52+
return argumentType;
5153
case VARCHAR:
5254
case CHAR:
5355
case BINARY:

polardbx-server/src/main/java/com/alibaba/polardbx/server/ServerConnection.java

Lines changed: 38 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
import com.alibaba.polardbx.common.utils.MergeHashMap;
5959
import com.alibaba.polardbx.common.utils.Pair;
6060
import com.alibaba.polardbx.common.utils.TStringUtil;
61+
import com.alibaba.polardbx.common.utils.logger.Level;
6162
import com.alibaba.polardbx.common.utils.logger.Logger;
6263
import com.alibaba.polardbx.common.utils.logger.LoggerFactory;
6364
import com.alibaba.polardbx.common.utils.thread.ThreadCpuStatUtil;
@@ -225,7 +226,7 @@
225226
*/
226227
public final class ServerConnection extends FrontendConnection implements Reschedulable {
227228

228-
private static final Logger logger = LoggerFactory.getLogger(ServerConnection.class);
229+
protected static final Logger logger = LoggerFactory.getLogger(ServerConnection.class);
229230
private static final Logger io_logger = LoggerFactory.getLogger("net_error");
230231
private static final Logger cdcLogger = LoggerFactory.getLogger("cdc_log");
231232
private static final ErrorPacket shutDownError = PacketUtil.getShutdown();
@@ -2089,29 +2090,18 @@ public void handleError(ErrorCode errCode, Throwable t) {
20892090
}
20902091

20912092
public void handleError(ErrorCode errCode, Throwable t, String sql, boolean fatal) {
2092-
2093-
String db = this.schema;
2094-
if (db == null) {
2095-
db = "";
2096-
}
20972093
// 取得配置文件
20982094
SchemaConfig schema = getSchemaConfig();
20992095

21002096
String message = t.getMessage();
2101-
Throwable ex;
21022097
if (!ErrorCode.match(message)) {
2103-
logger.error(t.getMessage(), t);
21042098
if (t instanceof NullPointerException) {
2105-
ex = new TddlRuntimeException(ERR_SERVER, "unknown NPE");
2099+
message = "unknown NPE";
21062100
// NPE (NullPointerException) may not have been handled correctly,
21072101
// to avoid the exception being swallowed, print the exception stack trace again.
21082102
} else {
2109-
ex = new TddlRuntimeException(ERR_SERVER, message);
2103+
message = t.getMessage();
21102104
}
2111-
logger.error(ex.getMessage(), t);
2112-
message = ex.getMessage();
2113-
} else {
2114-
ex = t;
21152105
}
21162106

21172107
String sqlState = null;
@@ -2152,35 +2142,8 @@ public void handleError(ErrorCode errCode, Throwable t, String sql, boolean fata
21522142
io_logger.info(toString(), t);
21532143
}
21542144
} else {
2155-
if (ex instanceof EOFException || ex instanceof ClosedChannelException) {
2156-
if (logger.isInfoEnabled()) {
2157-
buildMDC();
2158-
logger.info(ex);
2159-
}
2160-
} else if (isConnectionReset(ex)) {
2161-
if (logger.isInfoEnabled()) {
2162-
buildMDC();
2163-
logger.info(ex);
2164-
}
2165-
} else if (isTableNotFount(ex) || isColumnNotFount(ex)) {
2166-
if (logger.isDebugEnabled()) {
2167-
buildMDC();
2168-
logger.debug(ex);
2169-
}
2170-
} else if (isMySQLIntegrityConstraintViolationException(ex)) {
2171-
if (logger.isDebugEnabled()) {
2172-
buildMDC();
2173-
logger.debug(ex);
2174-
}
2175-
} else {
2176-
if (logger.isWarnEnabled()) {
2177-
buildMDC();
2178-
if (schema != null) {
2179-
schema.getDataSource().getStatistics().errorCount++;
2180-
}
2181-
logger.warn("[ERROR-CODE: " + errCode + "][" + this.traceId + "] SQL: " + sql, ex);
2182-
}
2183-
}
2145+
// use origin exception t to judge log level
2146+
logError(logger, errCode, sql, t, schema);
21842147
}
21852148

21862149
switch (errCode) {
@@ -2196,6 +2159,38 @@ public void handleError(ErrorCode errCode, Throwable t, String sql, boolean fata
21962159
}
21972160
}
21982161

2162+
protected void logError(Logger logger, ErrorCode errCode, String sql, Throwable ex, SchemaConfig schema) {
2163+
if (ex instanceof EOFException || ex instanceof ClosedChannelException) {
2164+
if (logger.isInfoEnabled()) {
2165+
buildMDC();
2166+
logger.info(ex);
2167+
}
2168+
} else if (isConnectionReset(ex)) {
2169+
if (logger.isInfoEnabled()) {
2170+
buildMDC();
2171+
logger.info(ex);
2172+
}
2173+
} else if (isTableNotFount(ex) || isColumnNotFount(ex)) {
2174+
if (logger.isDebugEnabled()) {
2175+
buildMDC();
2176+
logger.debug(ex);
2177+
}
2178+
} else if (isMySQLIntegrityConstraintViolationException(ex)) {
2179+
if (logger.isDebugEnabled()) {
2180+
buildMDC();
2181+
logger.debug(ex);
2182+
}
2183+
} else {
2184+
if (logger.isWarnEnabled()) {
2185+
buildMDC();
2186+
if (schema != null) {
2187+
schema.getDataSource().getStatistics().errorCount++;
2188+
}
2189+
logger.warn("[ERROR-CODE: " + errCode + "][" + this.traceId + "] SQL: " + sql, ex);
2190+
}
2191+
}
2192+
}
2193+
21992194
public void handleErrorForTrx(Throwable t) {
22002195
// Handle specific errors.
22012196
if (t.getMessage().contains("Unknown system variable 'innodb_mark_distributed'")) {

saveVersion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fi
5656
# for rpm
5757
if [ "x${RELEASE}" != "x" ];then
5858
# since 5.4.19, version changes into "5.4.19-${DATE}_${BUILDNUMBER}-SNAPSHOT"
59-
ec="echo $version | sed 's/SNAPSHOT/$RELEASE/g'"
59+
ec="echo $version | sed 's/_.*-SNAPSHOT//'"
6060
version=`eval $ec`
6161
elif [ "x${FW_BRANCH_NAME}" != "x" ]; then
6262
# for fastwork read from rpm tag build name

0 commit comments

Comments
 (0)