Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ecdb23c9
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ecdb23c9
编写于
1月 20, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove warnings and adjust dependencies
上级
aa4a4d05
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
53 addition
and
47 deletion
+53
-47
include/util/compare.h
include/util/compare.h
+33
-35
source/util/src/compare.c
source/util/src/compare.c
+8
-8
source/util/src/tskiplist.c
source/util/src/tskiplist.c
+10
-2
tests/test/c/create_table.c
tests/test/c/create_table.c
+2
-2
未找到文件。
include/util/compare.h
浏览文件 @
ecdb23c9
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_UTIL_COMPARE_H
#define _TD_UTIL_COMPARE_H
#ifndef _TD_UTIL_COMPARE_H
_
#define _TD_UTIL_COMPARE_H
_
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -35,67 +35,65 @@ extern "C" {
#define FLT_GREATEREQUAL(_x, _y) (FLT_EQUAL((_x), (_y)) || ((_x) > (_y)))
#define FLT_LESSEQUAL(_x, _y) (FLT_EQUAL((_x), (_y)) || ((_x) < (_y)))
#define PATTERN_COMPARE_INFO_INITIALIZER { '%', '_' }
#define PATTERN_COMPARE_INFO_INITIALIZER \
{ '%', '_' }
typedef
struct
SPatternCompareInfo
{
char
matchAll
;
// symbol for match all wildcard, default: '%'
char
matchOne
;
// symbol for match one wildcard, default: '_'
}
SPatternCompareInfo
;
int
patternMatch
(
const
char
*
pattern
,
const
char
*
str
,
size_t
size
,
const
SPatternCompareInfo
*
pInfo
);
int
32_t
patternMatch
(
const
char
*
pattern
,
const
char
*
str
,
size_t
size
,
const
SPatternCompareInfo
*
pInfo
);
int
WCSPatternMatch
(
const
wchar_t
*
pattern
,
const
wchar_t
*
str
,
size_t
size
,
const
SPatternCompareInfo
*
pInfo
);
int
32_t
WCSPatternMatch
(
const
wchar_t
*
pattern
,
const
wchar_t
*
str
,
size_t
size
,
const
SPatternCompareInfo
*
pInfo
);
int32_t
taosArrayCompareString
(
const
void
*
a
,
const
void
*
b
);
int32_t
taosArrayCompareString
(
const
void
*
a
,
const
void
*
b
);
int32_t
setCompareBytes1
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
setCompareBytes2
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
setCompareBytes4
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
setCompareBytes8
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt8Val
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt16Val
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt32Val
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt64Val
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt16Val
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt8Val
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint8Val
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint16Val
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint32Val
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint64Val
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint16Val
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint8Val
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareFloatVal
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareDoubleVal
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareLenPrefixedStr
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareLenPrefixedWStr
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareStrRegexComp
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareStrRegexCompMatch
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareStrRegexCompNMatch
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareFindItemInSet
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareStrRegexComp
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareStrRegexCompMatch
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareStrRegexCompNMatch
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareFindItemInSet
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt8ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt16ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt32ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt64ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareFloatValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareDoubleValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint8ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint16ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint32ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint64ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareLenPrefixedStrDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareLenPrefixedWStrDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt16ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt32ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareInt64ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareFloatValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareDoubleValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint8ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint16ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint32ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareUint64ValDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareLenPrefixedStrDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
int32_t
compareLenPrefixedWStrDesc
(
const
void
*
pLeft
,
const
void
*
pRight
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_UTIL_COMPARE_H
*/
#endif
/*_TD_UTIL_COMPARE_H_
*/
source/util/src/compare.c
浏览文件 @
ecdb23c9
...
...
@@ -16,13 +16,13 @@
#define _GNU_SOURCE
#define _XOPEN_SOURCE
#define _DEFAULT_SOURCE
#include "os.h"
#include "types.h"
#include "compare.h"
#include "ulog.h"
#include "thash.h"
#include "regex.h"
#include "thash.h"
#include "types.h"
#include "ulog.h"
int32_t
setCompareBytes1
(
const
void
*
pLeft
,
const
void
*
pRight
)
{
return
NULL
!=
taosHashGet
((
SHashObj
*
)
pRight
,
pLeft
,
1
)
?
1
:
0
;
...
...
@@ -228,7 +228,7 @@ int32_t compareLenPrefixedWStrDesc(const void* pLeft, const void* pRight) {
* '_': Matches one character
*
*/
int
patternMatch
(
const
char
*
patterStr
,
const
char
*
str
,
size_t
size
,
const
SPatternCompareInfo
*
pInfo
)
{
int
32_t
patternMatch
(
const
char
*
patterStr
,
const
char
*
str
,
size_t
size
,
const
SPatternCompareInfo
*
pInfo
)
{
char
c
,
c1
;
int32_t
i
=
0
;
...
...
@@ -289,7 +289,7 @@ int patternMatch(const char *patterStr, const char *str, size_t size, const SPat
return
(
str
[
j
]
==
0
||
j
>=
size
)
?
TSDB_PATTERN_MATCH
:
TSDB_PATTERN_NOMATCH
;
}
int
WCSPatternMatch
(
const
wchar_t
*
patterStr
,
const
wchar_t
*
str
,
size_t
size
,
const
SPatternCompareInfo
*
pInfo
)
{
int
32_t
WCSPatternMatch
(
const
wchar_t
*
patterStr
,
const
wchar_t
*
str
,
size_t
size
,
const
SPatternCompareInfo
*
pInfo
)
{
wchar_t
c
,
c1
;
wchar_t
matchOne
=
L'_'
;
// "_"
wchar_t
matchAll
=
L'%'
;
// "%"
...
...
@@ -360,11 +360,11 @@ int32_t compareStrRegexComp(const void* pLeft, const void* pRight) {
memcpy
(
str
,
varDataVal
(
pLeft
),
sz
);
str
[
sz
]
=
0
;
int
errCode
=
0
;
int
32_t
errCode
=
0
;
regex_t
regex
;
char
msgbuf
[
256
]
=
{
0
};
int
cflags
=
REG_EXTENDED
;
int
32_t
cflags
=
REG_EXTENDED
;
if
((
errCode
=
regcomp
(
&
regex
,
pattern
,
cflags
))
!=
0
)
{
regerror
(
errCode
,
&
regex
,
msgbuf
,
sizeof
(
msgbuf
));
uError
(
"Failed to compile regex pattern %s. reason %s"
,
pattern
,
msgbuf
);
...
...
source/util/src/tskiplist.c
浏览文件 @
ecdb23c9
...
...
@@ -13,11 +13,13 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "tskiplist.h"
#include "os.h"
#include "compare.h"
#include "
ulog
.h"
#include "
tskiplist
.h"
#include "tutil.h"
#include "ulog.h"
static
int
initForwardBackwardPtr
(
SSkipList
*
pSkipList
);
static
SSkipListNode
*
getPriorNode
(
SSkipList
*
pSkipList
,
const
char
*
val
,
int32_t
order
,
SSkipListNode
**
pCur
);
...
...
@@ -52,11 +54,17 @@ SSkipList *tSkipListCreate(uint8_t maxLevel, uint8_t keyType, uint16_t keyLen, _
pSkipList
->
flags
=
flags
;
pSkipList
->
keyFn
=
fn
;
pSkipList
->
seed
=
rand
();
#if 0
// the function getkeycomparfunc is defined in common
if (comparFn == NULL) {
pSkipList->comparFn = getKeyComparFunc(keyType, TSDB_ORDER_ASC);
} else {
pSkipList->comparFn = comparFn;
}
#else
pSkipList
->
comparFn
=
comparFn
;
#endif
if
(
initForwardBackwardPtr
(
pSkipList
)
<
0
)
{
tSkipListDestroy
(
pSkipList
);
...
...
tests/test/c/create_table.c
浏览文件 @
ecdb23c9
...
...
@@ -182,7 +182,7 @@ void *threadFunc(void *param) {
exit
(
1
);
}
p
Error
(
"====before thread:%d, table range: %"
PRId64
" - %"
PRId64
"
\n
"
,
p
Print
(
"====before thread:%d, table range: %"
PRId64
" - %"
PRId64
"
\n
"
,
pInfo
->
threadIndex
,
pInfo
->
tableBeginIndex
,
pInfo
->
tableEndIndex
);
...
...
@@ -190,7 +190,7 @@ void *threadFunc(void *param) {
pInfo
->
tableBeginIndex
+=
startOffset
;
pInfo
->
tableEndIndex
+=
startOffset
;
p
Error
(
"====after thread:%d, table range: %"
PRId64
" - %"
PRId64
"
\n
"
,
p
Print
(
"====after thread:%d, table range: %"
PRId64
" - %"
PRId64
"
\n
"
,
pInfo
->
threadIndex
,
pInfo
->
tableBeginIndex
,
pInfo
->
tableEndIndex
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录