<commit_before><cffunction name="$generatedKey" returntype="string" access="public" output="false">
	<cfreturn "rowid">
</cffunction>

<cffunction name="$randomOrder" returntype="string" access="public" output="false">
	<cfreturn "dbms_random.value()">
</cffunction>

<cffunction name="$getType" returntype="string" access="public" output="false">
	<cfargument name="type" type="string" required="true">
	<cfargument name="scale" type="string" required="true">
	<cfscript>
		var loc = {};
		switch(arguments.type)
		{
			case "blob": case "bfile": {loc.returnValue = "cf_sql_blob"; break;}
			case "char": case "nchar": {loc.returnValue = "cf_sql_char"; break;}
			case "clob": case "nclob": {loc.returnValue = "cf_sql_clob"; break;}
			case "date": case "timestamp": {loc.returnValue = "cf_sql_timestamp"; break;}
			case "binary_double": {loc.returnValue = "cf_sql_double"; break;}
			case "number": case "float": case "binary_float":
			{
				// integer datatypes are represented by number(38,0)
				if (val(arguments.scale) == 0)
				{
					loc.returnValue = "cf_sql_integer";
				}
				else
				{
					loc.returnValue = "cf_sql_float";
				}
				break;
			}
			case "long": {loc.returnValue = "cf_sql_longvarchar"; break;}
			case "raw": {loc.returnValue = "cf_sql_varbinary"; break;}
			case "varchar2": case "nvarchar2": {loc.returnValue = "cf_sql_varchar"; break;}
		}
	</cfscript>
	<cfreturn loc.returnValue>
</cffunction>

<cffunction name="$query" returntype="struct" access="public" output="false">
	<cfargument name="sql" type="array" required="true">
	<cfargument name="limit" type="numeric" required="false" default=0>
	<cfargument name="offset" type="numeric" required="false" default=0>
	<cfargument name="parameterize" type="boolean" required="true">
	<cfargument name="$primaryKey" type="string" required="false" default="">
	<cfscript>
		var loc = {};

		arguments.sql = $removeColumnAliasesInOrderClause(arguments.sql);
		if (arguments.limit > 0)
		{
			loc.beforeWhere = "SELECT * FROM (SELECT a.*, rownum rnum FROM (";
			loc.afterWhere = ") a WHERE rownum <=" & arguments.limit+arguments.offset & ")" & " WHERE rnum >" & arguments.offset;
			ArrayPrepend(arguments.sql, loc.beforeWhere);
			ArrayAppend(arguments.sql, loc.afterWhere);
		}

		// oracle doesn't support limit and offset in sql
		StructDelete(arguments, "limit", false);
		StructDelete(arguments, "offset", false);
		loc.returnValue = $performQuery(argumentCollection=arguments);
		loc.returnValue = $handleTimestampObject(loc.returnValue);
	</cfscript>
	<cfreturn loc.returnValue>
</cffunction>

<cffunction name="$identitySelect" returntype="any" access="public" output="false">
	<cfargument name="queryAttributes" type="struct" required="true">
	<cfargument name="result" type="struct" required="true">
	<cfargument name="primaryKey" type="string" required="true">
	<cfset var loc = {}>
	<cfset var query = {}>
	<cfset loc.sql = Trim(arguments.result.sql)>
	<cfif Left(loc.sql, 11) IS "INSERT INTO">
		<cfset arguments.table = SpanExcluding(Right(loc.sql, Len(loc.sql)-12), " ")>
		<cfset arguments.primaryKey = ListFirst(arguments.primaryKey)>
		<cfif NOT StructKeyExists(arguments.result, $generatedKey())>
			<cfset loc.startPar = Find("(", loc.sql) + 1>
			<cfset loc.endPar = Find(")", loc.sql)>
			<cfset loc.columnList = ReplaceList(Mid(loc.sql, loc.startPar, (loc.endPar-loc.startPar)), "#Chr(10)#,#Chr(13)#, ", ",,")>
			<cfif NOT ListFindNoCase(loc.columnList, arguments.primaryKey)>
				<cfreturn $identityRetrieve(argumentCollection=arguments)>
			</cfif>
		<cfelse>
			<cfreturn $identityRetrieve(argumentCollection=arguments)>
		</cfif>
	</cfif>
</cffunction>

<cffunction name="$identityRetrieve" access="public" returntype="any" output="false">
	<cfargument name="queryAttributes" type="struct" required="true">
	<cfargument name="result" type="struct" required="true">
	<cfargument name="primaryKey" type="string" required="true">
	<cfargument name="table" type="string" required="true">
	<cfset var loc = {}>
	<cfset var query = {}>
	<cfquery attributeCollection="#arguments.queryAttributes#">SELECT #arguments.primaryKey# AS lastId FROM #arguments.table# WHERE ROWID = '#arguments.result[$generatedKey()]#'</cfquery>
	<cfset loc.returnValue[$generatedKey()] = query.name.lastId>
	<cfreturn loc.returnValue>
</cffunction>

<cffunction name="$$dbinfo">
	<cfscript>
	var loc = {};
	loc.args = duplicate(variables.instance.connection);
	loc.args.name = "loc.returnValue";
	</cfscript>

	<cfquery attributeCollection="#loc.args#">
	SELECT  TC.COLUMN_NAME,
			TC.DATA_TYPE AS TYPE_NAME,
			TC.NULLABLE AS IS_NULLABLE,
			CASE WHEN PKC.COLUMN_NAME IS NULL THEN 0 ELSE 1 END AS IS_PRIMARYKEY,
			0 AS IS_FOREIGNKEY,
			'' AS REFERENCED_PRIMARYKEY,<commit_msg>Fixed another Oracle test failure.<commit_after><cffunction name="$generatedKey" returntype="string" access="public" output="false">
	<cfreturn "rowid">
</cffunction>

<cffunction name="$randomOrder" returntype="string" access="public" output="false">
	<cfreturn "dbms_random.value()">
</cffunction>

<cffunction name="$getType" returntype="string" access="public" output="false">
	<cfargument name="type" type="string" required="true">
	<cfargument name="scale" type="string" required="true">
	<cfscript>
		var loc = {};
		switch(arguments.type)
		{
			case "blob": case "bfile": {loc.returnValue = "cf_sql_blob"; break;}
			case "char": case "nchar": {loc.returnValue = "cf_sql_char"; break;}
			case "clob": case "nclob": {loc.returnValue = "cf_sql_clob"; break;}
			case "date": case "timestamp": {loc.returnValue = "cf_sql_timestamp"; break;}
			case "binary_double": {loc.returnValue = "cf_sql_double"; break;}
			case "number": case "float": case "binary_float":
			{
				// integer datatypes are represented by number(38,0)
				if (val(arguments.scale) == 0)
				{
					loc.returnValue = "cf_sql_integer";
				}
				else
				{
					loc.returnValue = "cf_sql_float";
				}
				break;
			}
			case "long": {loc.returnValue = "cf_sql_longvarchar"; break;}
			case "raw": {loc.returnValue = "cf_sql_varbinary"; break;}
			case "varchar2": case "nvarchar2": {loc.returnValue = "cf_sql_varchar"; break;}
		}
	</cfscript>
	<cfreturn loc.returnValue>
</cffunction>

<cffunction name="$query" returntype="struct" access="public" output="false">
	<cfargument name="sql" type="array" required="true">
	<cfargument name="limit" type="numeric" required="false" default=0>
	<cfargument name="offset" type="numeric" required="false" default=0>
	<cfargument name="parameterize" type="boolean" required="true">
	<cfargument name="$primaryKey" type="string" required="false" default="">
	<cfscript>
		var loc = {};

		arguments.sql = $removeColumnAliasesInOrderClause(arguments.sql);
		if (arguments.limit > 0)
		{
			loc.beforeWhere = "SELECT * FROM (SELECT a.*, rownum rnum FROM (";
			loc.afterWhere = ") a WHERE rownum <=" & arguments.limit+arguments.offset & ")" & " WHERE rnum >" & arguments.offset;
			ArrayPrepend(arguments.sql, loc.beforeWhere);
			ArrayAppend(arguments.sql, loc.afterWhere);
		}

		// oracle doesn't support limit and offset in sql
		StructDelete(arguments, "limit", false);
		StructDelete(arguments, "offset", false);
		loc.returnValue = $performQuery(argumentCollection=arguments);
		loc.returnValue = $handleTimestampObject(loc.returnValue);
	</cfscript>
	<cfreturn loc.returnValue>
</cffunction>

<cffunction name="$identitySelect" returntype="any" access="public" output="false">
	<cfargument name="queryAttributes" type="struct" required="true">
	<cfargument name="result" type="struct" required="true">
	<cfargument name="primaryKey" type="string" required="true">
	<cfset var loc = {}>
	<cfset var query = {}>
	<cfset loc.sql = Trim(arguments.result.sql)>
	<cfif Left(loc.sql, 11) IS "INSERT INTO">
		<cfset arguments.table = SpanExcluding(Right(loc.sql, Len(loc.sql)-12), " ")>
		<cfset arguments.primaryKey = ListFirst(arguments.primaryKey)>
		<cfif NOT StructKeyExists(arguments.result, $generatedKey())>
			<cfset loc.startPar = Find("(", loc.sql) + 1>
			<cfset loc.endPar = Find(")", loc.sql)>
			<cfset loc.columnList = ReplaceList(Mid(loc.sql, loc.startPar, (loc.endPar-loc.startPar)), "#Chr(10)#,#Chr(13)#, ", ",,")>
			<cfif NOT ListFindNoCase(loc.columnList, arguments.primaryKey)>
				<cfreturn $identityRetrieve(argumentCollection=arguments)>
			</cfif>
		<cfelse>
			<cfreturn $identityRetrieve(argumentCollection=arguments)>
		</cfif>
	</cfif>
</cffunction>

<cffunction name="$identityRetrieve" access="public" returntype="any" output="false">
	<cfargument name="queryAttributes" type="struct" required="true">
	<cfargument name="result" type="struct" required="true">
	<cfargument name="primaryKey" type="string" required="true">
	<cfargument name="table" type="string" required="true">
	<cfset var loc = {}>
	<cfset var query = {}>
	<cfquery attributeCollection="#arguments.queryAttributes#">SELECT #arguments.primaryKey# AS lastId FROM #arguments.table# WHERE ROWID = '#arguments.result[$generatedKey()]#'</cfquery>
	<cfset loc.returnValue[$generatedKey()] = Trim(query.name.lastId)>
	<cfreturn loc.returnValue>
</cffunction>

<cffunction name="$$dbinfo">
	<cfscript>
	var loc = {};
	loc.args = duplicate(variables.instance.connection);
	loc.args.name = "loc.returnValue";
	</cfscript>

	<cfquery attributeCollection="#loc.args#">
	SELECT  TC.COLUMN_NAME,
			TC.DATA_TYPE AS TYPE_NAME,
			TC.NULLABLE AS IS_NULLABLE,
			CASE WHEN PKC.COLUMN_NAME IS NULL THEN 0 ELSE 1 END AS IS_PRIMARYKEY,
			0 AS IS_FOREIGNKEY,
			'' AS REFERENCED_PRIMARYKEY,
{'fraction_non_alphanumeric': 0.16577652110168603, 'fraction_numerical': 0.004398366321080742, 'mean_word_length': 5.725352112676056, 'pattern_counts': {'":': 32, '<': 127, '<?xml version=': 0, '>': 129, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1073195', 'n_tokens_mistral': 3438, 'n_tokens_neox': 3165, 'n_words': 677}