[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
|
#if STMT_IFACE_ENABLED == 1
|
||||||
case STMT_IFACE:
|
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)) {
|
if (0 != taos_stmt_execute(pThreadInfo->stmt)) {
|
||||||
errorPrint("%s() LN%d, failied to execute insert statement\n",
|
errorPrint("%s() LN%d, failied to execute insert statement\n",
|
||||||
__func__, __LINE__);
|
__func__, __LINE__);
|
||||||
|
@ -5771,6 +5772,8 @@ static int32_t prepareStbStmtBind(
|
||||||
TAOS_BIND *bind;
|
TAOS_BIND *bind;
|
||||||
|
|
||||||
if (isColumn) {
|
if (isColumn) {
|
||||||
|
int cursor = 0;
|
||||||
|
|
||||||
for (int i = 0; i < stbInfo->columnCount + 1; i ++) {
|
for (int i = 0; i < stbInfo->columnCount + 1; i ++) {
|
||||||
bind = (TAOS_BIND *)((char *)bindArray + (sizeof(TAOS_BIND) * i));
|
bind = (TAOS_BIND *)((char *)bindArray + (sizeof(TAOS_BIND) * i));
|
||||||
|
|
||||||
|
@ -5794,7 +5797,6 @@ static int32_t prepareStbStmtBind(
|
||||||
|
|
||||||
ptr += bind->buffer_length;
|
ptr += bind->buffer_length;
|
||||||
} else {
|
} else {
|
||||||
int cursor = 0;
|
|
||||||
|
|
||||||
if (sourceRand) {
|
if (sourceRand) {
|
||||||
if ( -1 == prepareStmtBindArrayByType(
|
if ( -1 == prepareStmtBindArrayByType(
|
||||||
|
@ -5851,6 +5853,7 @@ static int32_t prepareStbStmtBind(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(bindBuffer);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6724,14 +6727,17 @@ static void startMultiThreadInsertData(int threads, char* db_name,
|
||||||
int64_t limit;
|
int64_t limit;
|
||||||
uint64_t offset;
|
uint64_t offset;
|
||||||
|
|
||||||
if ((NULL != g_args.sqlFile) && (superTblInfo->childTblExists == TBL_NO_EXISTS) &&
|
if ((NULL != g_args.sqlFile)
|
||||||
((superTblInfo->childTblOffset != 0) || (superTblInfo->childTblLimit >= 0))) {
|
&& (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");
|
printf("WARNING: offset and limit will not be used since the child tables not exists!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (superTblInfo->childTblExists == TBL_ALREADY_EXISTS) {
|
if (superTblInfo->childTblExists == TBL_ALREADY_EXISTS) {
|
||||||
if ((superTblInfo->childTblLimit < 0)
|
if ((superTblInfo->childTblLimit < 0)
|
||||||
|| ((superTblInfo->childTblOffset + superTblInfo->childTblLimit)
|
|| ((superTblInfo->childTblOffset
|
||||||
|
+ superTblInfo->childTblLimit)
|
||||||
> (superTblInfo->childTblCount))) {
|
> (superTblInfo->childTblCount))) {
|
||||||
superTblInfo->childTblLimit =
|
superTblInfo->childTblLimit =
|
||||||
superTblInfo->childTblCount - superTblInfo->childTblOffset;
|
superTblInfo->childTblCount - superTblInfo->childTblOffset;
|
||||||
|
@ -6837,7 +6843,8 @@ static void startMultiThreadInsertData(int threads, char* db_name,
|
||||||
|
|
||||||
#if STMT_IFACE_ENABLED == 1
|
#if STMT_IFACE_ENABLED == 1
|
||||||
if ((g_args.iface == STMT_IFACE)
|
if ((g_args.iface == STMT_IFACE)
|
||||||
|| ((superTblInfo) && (superTblInfo->iface == STMT_IFACE))) {
|
|| ((superTblInfo)
|
||||||
|
&& (superTblInfo->iface == STMT_IFACE))) {
|
||||||
|
|
||||||
int columnCount;
|
int columnCount;
|
||||||
if (superTblInfo) {
|
if (superTblInfo) {
|
||||||
|
@ -6865,7 +6872,8 @@ static void startMultiThreadInsertData(int threads, char* db_name,
|
||||||
== superTblInfo->autoCreateTable)) {
|
== superTblInfo->autoCreateTable)) {
|
||||||
pstr += sprintf(pstr, "INSERT INTO ? USING %s TAGS(?",
|
pstr += sprintf(pstr, "INSERT INTO ? USING %s TAGS(?",
|
||||||
superTblInfo->sTblName);
|
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, ",?");
|
||||||
}
|
}
|
||||||
pstr += sprintf(pstr, ") VALUES(?");
|
pstr += sprintf(pstr, ") VALUES(?");
|
||||||
|
|
Loading…
Reference in New Issue