Code Duplication    Length = 22-22 lines in 2 locations

Sources/Subs-Db-postgresql.php 1 location

@@ 462-483 (lines=22) @@
459
	}
460
461
	// Debugging.
462
	if (isset($db_show_debug) && $db_show_debug === true)
463
	{
464
		// Get the file and line number this function was called.
465
		list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__);
466
467
		// Initialize $db_cache if not already initialized.
468
		if (!isset($db_cache))
469
			$db_cache = array();
470
471
		if (!empty($_SESSION['debug_redirect']))
472
		{
473
			$db_cache = array_merge($_SESSION['debug_redirect'], $db_cache);
474
			$db_count = count($db_cache) + 1;
475
			$_SESSION['debug_redirect'] = array();
476
		}
477
478
		// Don't overload it.
479
		$db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...';
480
		$db_cache[$db_count]['f'] = $file;
481
		$db_cache[$db_count]['l'] = $line;
482
		$db_cache[$db_count]['s'] = ($st = microtime(true)) - $time_start;
483
	}
484
485
	$db_last_result = @pg_query($connection, $db_string);
486

Sources/Subs-Db-mysql.php 1 location

@@ 450-471 (lines=22) @@
447
	}
448
449
	// Debugging.
450
	if (isset($db_show_debug) && $db_show_debug === true)
451
	{
452
		// Get the file and line number this function was called.
453
		list ($file, $line) = smf_db_error_backtrace('', '', 'return', __FILE__, __LINE__);
454
455
		// Initialize $db_cache if not already initialized.
456
		if (!isset($db_cache))
457
			$db_cache = array();
458
459
		if (!empty($_SESSION['debug_redirect']))
460
		{
461
			$db_cache = array_merge($_SESSION['debug_redirect'], $db_cache);
462
			$db_count = count($db_cache) + 1;
463
			$_SESSION['debug_redirect'] = array();
464
		}
465
466
		// Don't overload it.
467
		$db_cache[$db_count]['q'] = $db_count < 50 ? $db_string : '...';
468
		$db_cache[$db_count]['f'] = $file;
469
		$db_cache[$db_count]['l'] = $line;
470
		$db_cache[$db_count]['s'] = ($st = microtime(true)) - $time_start;
471
	}
472
473
	if (empty($db_unbuffered))
474
		$ret = @mysqli_query($connection, $db_string);