change the range of int data to 0-49

This commit is contained in:
fang 2019-08-09 10:51:33 +08:00
parent 1d66b64cf8
commit 2d8c7bc0a4
1 changed files with 1 additions and 1 deletions

View File

@ -808,7 +808,7 @@ void generateData(char *res, char **data_type, int num_of_cols, long timestamp,
} else if (strcasecmp(data_type[i % c], "smallint") == 0) { } else if (strcasecmp(data_type[i % c], "smallint") == 0) {
pstr += sprintf(pstr, ", %d", (int)(rand() % 32767)); pstr += sprintf(pstr, ", %d", (int)(rand() % 32767));
} else if (strcasecmp(data_type[i % c], "int") == 0) { } else if (strcasecmp(data_type[i % c], "int") == 0) {
pstr += sprintf(pstr, ", %d", (int)(rand() % 2147483648)); pstr += sprintf(pstr, ", %d", (int)(rand() % 50));
} else if (strcasecmp(data_type[i % c], "bigint") == 0) { } else if (strcasecmp(data_type[i % c], "bigint") == 0) {
pstr += sprintf(pstr, ", %ld", rand() % 2147483648); pstr += sprintf(pstr, ", %ld", rand() % 2147483648);
} else if (strcasecmp(data_type[i % c], "float") == 0) { } else if (strcasecmp(data_type[i % c], "float") == 0) {