Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow #8689

Open
scharger opened this issue Apr 27, 2020 · 0 comments
Open

Slow #8689

scharger opened this issue Apr 27, 2020 · 0 comments

Comments

@scharger
Copy link

scharger commented Apr 27, 2020

for (int i = 0; i < res->getFieldCount(); i++) {

In each iteration -> getFieldCount() and checking result type

Maybe:

  // 1411
	int fieldCound = res->getFieldCount();
	if (fieldCound == 0) {
		return ret; //Return array() in cases when no data present
	}
	
	if (result_type & PHP_MYSQL_NUM) {
		for (int i = 0; i < fieldCound; i++) {
			ret.set(i, res->getField(i));
		}
	} else if (result_type & PHP_MYSQL_ASSOC) {
		for (int i = 0; i < fieldCound; i++) {
			MySQLFieldInfo *info = res->getFieldInfo(i);
			auto const arrkey =
				ret.convertKey<IntishCast::Cast>(info->name);
			ret.set(arrkey, *res->getField(i).asTypedValue());
		}
	}
  // 1421
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant