[TD-5445]<fix>: taosdemo bug stmt interface with sample data. (#6971)
sync from develop branch.
This commit is contained in:
parent
c41d23daaa
commit
199bf6e0d5
|
@ -5118,7 +5118,8 @@ static int32_t execInsert(threadInfo *pThreadInfo, uint32_t k)
|
|||
|
||||
#if STMT_IFACE_ENABLED == 1
|
||||
case STMT_IFACE:
|
||||
debugPrint("%s() LN%d, stmt=%p", __func__, __LINE__, pThreadInfo->stmt);
|
||||
debugPrint("%s() LN%d, stmt=%p",
|
||||
__func__, __LINE__, pThreadInfo->stmt);
|
||||
if (0 != taos_stmt_execute(pThreadInfo->stmt)) {
|
||||
errorPrint("%s() LN%d, failied to execute insert statement\n",
|
||||
__func__, __LINE__);
|
||||
|
@ -5771,6 +5772,8 @@ static int32_t prepareStbStmtBind(
|
|||
TAOS_BIND *bind;
|
||||
|
||||
if (isColumn) {
|
||||
int cursor = 0;
|
||||
|
||||
for (int i = 0; i < stbInfo->columnCount + 1; i ++) {
|
||||
bind = (TAOS_BIND *)((char *)bindArray + (sizeof(TAOS_BIND) * i));
|
||||
|
||||
|
@ -5794,7 +5797,6 @@ static int32_t prepareStbStmtBind(
|
|||
|
||||
ptr += bind->buffer_length;
|
||||
} else {
|
||||
int cursor = 0;
|
||||
|
||||
if (sourceRand) {
|
||||
if ( -1 == prepareStmtBindArrayByType(
|
||||
|
@ -5851,6 +5853,7 @@ static int32_t prepareStbStmtBind(
|
|||
|
||||
}
|
||||
|
||||
free(bindBuffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -6724,14 +6727,17 @@ static void startMultiThreadInsertData(int threads, char* db_name,
|
|||
int64_t limit;
|
||||
uint64_t offset;
|
||||
|
||||
if ((NULL != g_args.sqlFile) && (superTblInfo->childTblExists == TBL_NO_EXISTS) &&
|
||||
((superTblInfo->childTblOffset != 0) || (superTblInfo->childTblLimit >= 0))) {
|
||||
if ((NULL != g_args.sqlFile)
|
||||
&& (superTblInfo->childTblExists == TBL_NO_EXISTS)
|
||||
&& ((superTblInfo->childTblOffset != 0)
|
||||
|| (superTblInfo->childTblLimit >= 0))) {
|
||||
printf("WARNING: offset and limit will not be used since the child tables not exists!\n");
|
||||
}
|
||||
|
||||
if (superTblInfo->childTblExists == TBL_ALREADY_EXISTS) {
|
||||
if ((superTblInfo->childTblLimit < 0)
|
||||
|| ((superTblInfo->childTblOffset + superTblInfo->childTblLimit)
|
||||
|| ((superTblInfo->childTblOffset
|
||||
+ superTblInfo->childTblLimit)
|
||||
> (superTblInfo->childTblCount))) {
|
||||
superTblInfo->childTblLimit =
|
||||
superTblInfo->childTblCount - superTblInfo->childTblOffset;
|
||||
|
@ -6837,7 +6843,8 @@ static void startMultiThreadInsertData(int threads, char* db_name,
|
|||
|
||||
#if STMT_IFACE_ENABLED == 1
|
||||
if ((g_args.iface == STMT_IFACE)
|
||||
|| ((superTblInfo) && (superTblInfo->iface == STMT_IFACE))) {
|
||||
|| ((superTblInfo)
|
||||
&& (superTblInfo->iface == STMT_IFACE))) {
|
||||
|
||||
int columnCount;
|
||||
if (superTblInfo) {
|
||||
|
@ -6865,7 +6872,8 @@ static void startMultiThreadInsertData(int threads, char* db_name,
|
|||
== superTblInfo->autoCreateTable)) {
|
||||
pstr += sprintf(pstr, "INSERT INTO ? USING %s TAGS(?",
|
||||
superTblInfo->sTblName);
|
||||
for (int tag = 0; tag < (superTblInfo->tagCount - 1); tag ++ ) {
|
||||
for (int tag = 0; tag < (superTblInfo->tagCount - 1);
|
||||
tag ++ ) {
|
||||
pstr += sprintf(pstr, ",?");
|
||||
}
|
||||
pstr += sprintf(pstr, ") VALUES(?");
|
||||
|
|
Loading…
Reference in New Issue