<commit_before>/*
 * The contents of this file are subject to the MonetDB Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.monetdb.org/Legal/MonetDBLicense
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * The Original Code is the MonetDB Database System.
 *
 * The Initial Developer of the Original Code is CWI.
 * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
 * Copyright August 2008-2013 MonetDB B.V.
 * All Rights Reserved.
 */

/*
 * This code was created by <NAME> (mostly during Christmas 98/99).
 * This code is LGPL. Please ensure that this message remains in future
 * distributions and uses of this code (thats about all I get out of it).
 * - <NAME> <EMAIL>
 *
 * This file has been modified for the MonetDB project.  See the file
 * Copyright in this directory for more information.
 */

/**********************************************************************
 * SQLParamOptions()
 * CLI Compliance: deprecated in ODBC 3.0 (replaced by SQLSetStmtAttr())
 * Provided here for old (pre ODBC 3.0) applications and driver managers.
 **********************************************************************/

#include "ODBCGlobal.h"
#include "ODBCStmt.h"

SQLRETURN SQL_API
SQLParamOptions(SQLHSTMT StatementHandle,
		SQLULEN RowNumber,
		SQLULEN *RowNumberPtr)
{
	ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
	RETCODE rc;

#ifdef ODBCDEBUG
	ODBCLOG("SQLParamOptions " PTRFMT " " ULENFMT "\n",
		PTRFMTCAST StatementHandle, ULENCAST RowNumber);
#endif

	/* use mapping as described in ODBC 3 SDK Help file */
	rc = SQLSetStmtAttr_(stmt, SQL_ATTR_PARAMSET_SIZE, &RowNumber, 0);

	if (SQL_SUCCEEDED(rc)) {
		rc = SQLSetStmtAttr_(stmt, SQL_ATTR_PARAMS_PROCESSED_PTR,
				     RowNumberPtr, 0);
	}
	return rc;
}<commit_msg>Fix implementation of SQLParamOptions function. This should fix bug 3397.<commit_after>/*
 * The contents of this file are subject to the MonetDB Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.monetdb.org/Legal/MonetDBLicense
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * The Original Code is the MonetDB Database System.
 *
 * The Initial Developer of the Original Code is CWI.
 * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
 * Copyright August 2008-2013 MonetDB B.V.
 * All Rights Reserved.
 */

/*
 * This code was created by <NAME> (mostly during Christmas 98/99).
 * This code is LGPL. Please ensure that this message remains in future
 * distributions and uses of this code (thats about all I get out of it).
 * - <NAME> <EMAIL>
 *
 * This file has been modified for the MonetDB project.  See the file
 * Copyright in this directory for more information.
 */

/**********************************************************************
 * SQLParamOptions()
 * CLI Compliance: deprecated in ODBC 3.0 (replaced by SQLSetStmtAttr())
 * Provided here for old (pre ODBC 3.0) applications and driver managers.
 **********************************************************************/

#include "ODBCGlobal.h"
#include "ODBCStmt.h"

SQLRETURN SQL_API
SQLParamOptions(SQLHSTMT StatementHandle,
		SQLULEN RowNumber,
		SQLULEN *RowNumberPtr)
{
	ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
	RETCODE rc;

#ifdef ODBCDEBUG
	ODBCLOG("SQLParamOptions " PTRFMT " " ULENFMT "\n",
		PTRFMTCAST StatementHandle, ULENCAST RowNumber);
#endif

	/* use mapping as described in ODBC 3 SDK Help file */
	rc = SQLSetStmtAttr_(stmt, SQL_ATTR_PARAMSET_SIZE,
			     (SQLPOINTER) (size_t) RowNumber, 0);

	if (SQL_SUCCEEDED(rc)) {
		rc = SQLSetStmtAttr_(stmt, SQL_ATTR_PARAMS_PROCESSED_PTR,
				     RowNumberPtr, 0);
	}
	return rc;
}
{'fraction_non_alphanumeric': 0.14367133697459036, 'fraction_numerical': 0.014723343623842318, 'mean_word_length': 4.318181818181818, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4875854', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1209, 'n_words': 491}