Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Questdb
提交
48cea608
Q
Questdb
项目概览
jobily
/
Questdb
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
Questdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
48cea608
编写于
6月 12, 2020
作者:
V
Vlad Ilyushchenko
提交者:
GitHub
6月 12, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(griffin): GORM sends ';' after login, making sure we reply to that. (#388)
上级
8fa21f67
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
27 addition
and
5 deletion
+27
-5
core/src/main/java/io/questdb/cutlass/pgwire/PGConnectionContext.java
...n/java/io/questdb/cutlass/pgwire/PGConnectionContext.java
+5
-0
core/src/main/java/io/questdb/griffin/SqlKeywords.java
core/src/main/java/io/questdb/griffin/SqlKeywords.java
+4
-0
core/src/main/java/io/questdb/griffin/engine/table/TableListRecordCursorFactory.java
...db/griffin/engine/table/TableListRecordCursorFactory.java
+1
-1
core/src/test/java/io/questdb/cutlass/pgwire/PGJobContextTest.java
...test/java/io/questdb/cutlass/pgwire/PGJobContextTest.java
+13
-0
core/src/test/java/io/questdb/griffin/ShowTablesTest.java
core/src/test/java/io/questdb/griffin/ShowTablesTest.java
+4
-4
未找到文件。
core/src/main/java/io/questdb/cutlass/pgwire/PGConnectionContext.java
浏览文件 @
48cea608
...
...
@@ -1214,6 +1214,11 @@ public class PGConnectionContext implements IOContext, Mutable {
prepareForNewQuery
();
parseQueryText
(
lo
,
limit
-
1
);
if
(
SqlKeywords
.
isSemicolon
(
queryText
))
{
sendExecuteTail
(
TAIL_SUCCESS
);
return
;
}
final
Object
statement
=
factoryCache
.
peek
(
queryText
);
if
(
statement
==
null
)
{
CompiledQuery
cc
=
compiler
.
compile
(
queryText
,
sqlExecutionContext
);
...
...
core/src/main/java/io/questdb/griffin/SqlKeywords.java
浏览文件 @
48cea608
...
...
@@ -46,6 +46,10 @@ public class SqlKeywords {
&&
(
tok
.
charAt
(
i
)
|
32
)
==
'n'
;
}
public
static
boolean
isSemicolon
(
CharSequence
tok
)
{
return
tok
.
length
()
==
1
&&
(
tok
.
charAt
(
0
)
|
32
)
==
';'
;
}
public
static
boolean
isOnKeyword
(
CharSequence
tok
)
{
if
(
tok
.
length
()
!=
2
)
{
return
false
;
...
...
core/src/main/java/io/questdb/griffin/engine/table/TableListRecordCursorFactory.java
浏览文件 @
48cea608
...
...
@@ -41,7 +41,7 @@ public class TableListRecordCursorFactory implements RecordCursorFactory {
static
{
final
GenericRecordMetadata
metadata
=
new
GenericRecordMetadata
();
metadata
.
add
(
new
TableColumnMetadata
(
"table
Name
"
,
ColumnType
.
STRING
));
metadata
.
add
(
new
TableColumnMetadata
(
"table"
,
ColumnType
.
STRING
));
METADATA
=
metadata
;
}
...
...
core/src/test/java/io/questdb/cutlass/pgwire/PGJobContextTest.java
浏览文件 @
48cea608
...
...
@@ -1336,6 +1336,19 @@ public class PGJobContextTest extends AbstractGriffinTest {
assertHexScript
(
script
);
}
@Test
public
void
testGORMConnect
()
throws
Exception
{
// GORM is a Golang ORM tool
assertHexScript
(
">0000005e0003000064617461626173650071646200646174657374796c650049534f2c204d44590065787472615f666c6f61745f646967697473003200757365720061646d696e00636c69656e745f656e636f64696e6700555446380000\n"
+
"<520000000800000003\n"
+
">700000000a717565737400\n"
+
"<520000000800000000530000001154696d655a6f6e6500474d5400530000001d6170706c69636174696f6e5f6e616d6500517565737444420053000000187365727665725f76657273696f6e0031312e33005300000019696e74656765725f6461746574696d6573006f6e005a0000000549\n"
+
">51000000063b00\n"
+
"<43000000063b005a0000000549\n"
);
}
@Test
public
void
testSimpleSimpleQuery
()
throws
Exception
{
TestUtils
.
assertMemoryLeak
(()
->
{
...
...
core/src/test/java/io/questdb/griffin/ShowTablesTest.java
浏览文件 @
48cea608
...
...
@@ -33,7 +33,7 @@ public class ShowTablesTest extends AbstractGriffinTest {
public
void
testShowTablesWithSingleTable
()
throws
Exception
{
assertMemoryLeak
(()
->
{
compiler
.
compile
(
"create table balances(cust_id int, ccy symbol, balance double)"
,
sqlExecutionContext
);
assertQuery
(
"table
Name
\nbalances\n"
,
"show tables"
,
null
,
false
,
sqlExecutionContext
,
false
);
assertQuery
(
"table\nbalances\n"
,
"show tables"
,
null
,
false
,
sqlExecutionContext
,
false
);
});
}
...
...
@@ -41,10 +41,10 @@ public class ShowTablesTest extends AbstractGriffinTest {
public
void
testShowTablesWithDrop
()
throws
Exception
{
assertMemoryLeak
(()
->
{
compiler
.
compile
(
"create table balances(cust_id int, ccy symbol, balance double)"
,
sqlExecutionContext
);
assertQuery
(
"table
Name
\nbalances\n"
,
"show tables"
,
null
,
false
,
sqlExecutionContext
,
false
);
assertQuery
(
"table\nbalances\n"
,
"show tables"
,
null
,
false
,
sqlExecutionContext
,
false
);
compiler
.
compile
(
"create table balances2(cust_id int, ccy symbol, balance double)"
,
sqlExecutionContext
);
compiler
.
compile
(
"drop table balances"
,
sqlExecutionContext
);
assertQuery
(
"table
Name
\nbalances2\n"
,
"show tables"
,
null
,
false
,
sqlExecutionContext
,
false
);
assertQuery
(
"table\nbalances2\n"
,
"show tables"
,
null
,
false
,
sqlExecutionContext
,
false
);
});
}
...
...
@@ -99,7 +99,7 @@ public class ShowTablesTest extends AbstractGriffinTest {
public
void
testShowTablesWithFunction
()
throws
Exception
{
assertMemoryLeak
(()
->
{
compiler
.
compile
(
"create table balances(cust_id int, ccy symbol, balance double)"
,
sqlExecutionContext
);
assertQuery
(
"table
Name
\nbalances\n"
,
"select * from all_tables()"
,
null
,
false
,
sqlExecutionContext
,
false
);
assertQuery
(
"table\nbalances\n"
,
"select * from all_tables()"
,
null
,
false
,
sqlExecutionContext
,
false
);
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录