亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? oracle_txns8.c

?? oracle數據庫tpcc(在線事務處理能力)測試的源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/***************************
oracle_txns8.c
***************************/
/*+ file: oracle_txns8.c based on Oracle files - plpay.c plnew.c
plord.c
pldel.c plsto.c
-*/
/*+================================================================
=+
| Copyright (c) 1995 Oracle Corp, Redwood Shores, CA
|
| OPEN SYSTEMS PERFORMANCE GROUP
|
| All Rights Reserved
|
+==================================================================
+
| DESCRIPTION
| OCI version (using PL/SQL stored procedure) of
| PAYMENT transaction in TPC-C benchmark.
| OCI version (using PL/SQL stored procedure) of
| NEW ORDER transaction in TPC-C benchmark.
| OCI version (using PL/SQL anynomous block) of
| ORDER STATUS transaction in TPC-C benchmark.
| OCI version of DELIVERY transaction in TPC-C benchmark.
| OCI version of STOCK LEVEL transaction in TPC-C benchmark.
+=================================================================-
*/
/*+****************************************************************
**********
*
*
* COPYRIGHT (c) 1998 BY
*
* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS.
*
* ALL RIGHTS RESERVED.
*
*
*
* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED *
* ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE *
* INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER *
* COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY *
* OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY *
* TRANSFERRED.
*
*
*
* THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE *
* AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT *
* CORPORATION.
*
*
*
* DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS *
* SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
*
*
*
*
*
*******************************************************************
*********/
/*+
* Abstract: This file contains the transaction routines for connection
* to the oracle v8 database - for the tpcc benchmark.
*
*
* Modification history:
*
*
* 08/01/2002 Andrew Bond, HP Corporation
* - Conversion to run under Linux
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <ocidfn.h>
#include <oci.h>
#include <ociapr.h>
#include <tpccerr.h>
#include <tpccstruct.h>
#include <oracle_db8.h>
#include <tpcc.h>
#ifdef OL_CHECK
#include <httpext.h>
extern int iMaxWareHouses;
#endif
/* prototypes */
int getfile(char *filename, text *filebuf);
void vgetdate (unsigned char *oradt)
{
   struct tm *loctime;
   time_t int_time;
   struct ORADATE 
   {
      unsigned char century;
      unsigned char year;
      unsigned char month;
      unsigned char day;
      unsigned char hour;
      unsigned char minute;
      unsigned char second;
   } Date;
   int century;
   int cnvrtOK;/* assume convert is successful */
   cnvrtOK = 1;/* get the current date and time as an integer */
   time( &int_time);/* Convert the current date and time into local time */
   loctime = localtime( &int_time);
   century = (1900+loctime->tm_year) / 100;
   Date.century = (unsigned char)(century + 100);
   if (Date.century < 119 || Date.century > 120) cnvrtOK = 0;
      Date.year = (unsigned char)(loctime->tm_year%100+100);
   if (Date.year < 100 || Date.year > 199) cnvrtOK = 0;
      Date.month = (unsigned char)(loctime->tm_mon + 1);
   if (Date.month < 1 || Date.month > 12) cnvrtOK = 0;
      Date.day = (unsigned char)loctime->tm_mday;
   if (Date.day < 1 || Date.day > 31) cnvrtOK = 0;
      Date.hour = (unsigned char)(loctime->tm_hour + 1);
   if (Date.hour < 1 || Date.hour > 24) cnvrtOK = 0;
      Date.minute= (unsigned char)(loctime->tm_min + 1);
   if (Date.minute < 1 || Date.minute > 60) cnvrtOK = 0;
      Date.second= (unsigned char)(loctime->tm_sec + 1);
   if (Date.second < 1 || Date.second > 60) cnvrtOK = 0;
   if (cnvrtOK)
      memcpy(oradt,&Date,7);
   else
     *oradt = '\0';
   return;
}
void cvtdmy (unsigned char *oradt, char *outdate)
{
   struct ORADATE 
   {
      unsigned char century;
      unsigned char year;
      unsigned char month;
      unsigned char day;
      unsigned char hour;
      unsigned char minute;
      unsigned char second;
   } Date;
   int day,month,year;
   memcpy(&Date,oradt,7);
   year = (Date.century-100)*100 + Date.year-100;
   month = Date.month;
   day = Date.day;/* sprintf(outdate,"%02d-%02d-%4d\0",day,month,year); */
   sprintf(outdate,"%02d-%02d-%4d",day,month,year);
   return;
}
void cvtdmyhms (unsigned char *oradt, char *outdate)
{
   struct ORADATE 
   {
      unsigned char century;
      unsigned char year;
      unsigned char month;
      unsigned char day;
      unsigned char hour;
      unsigned char minute;
      unsigned char second;
   } Date;
   int day,month,year;
   int hour,min,sec;
   memcpy(&Date,oradt,7);
   year = (Date.century-100)*100 + Date.year-100;
   month = Date.month;
   day = Date.day;
   hour = Date.hour - 1;
   min = Date.minute - 1;
   sec = Date.second - 1;/*sprintf(outdate,"%02d-%02d-%4d %02d:%02d:%02d\0", */
   sprintf(outdate,"%02d-%02d-%4d %02d:%02d:%02d",day,month,year,hour,min,sec);
   return;
}

swapitemstock (int i, int j, int *i_price, char i_name[][25],int *s_quantity, newctx *nctx)
{
   int tempi;
   int tempf;
   char tempstr[52];
   ub2 tempub2;
   sb2 tempsb2;
   OCIRowid *tmprid;
   tempsb2 = nctx->cons_ind[i];
   nctx->cons_ind[i] = nctx->cons_ind[j];
   nctx->cons_ind[j] = tempsb2;
   tempub2 = nctx->cons_len[i];
   nctx->cons_len[i] = nctx->cons_len[j];
   nctx->cons_len[j] = tempub2;
   tempub2 = nctx->cons_rcode[i];
   nctx->cons_rcode[i] = nctx->cons_rcode[j];
   nctx->cons_rcode[j] = tempub2;
   tempi = nctx->cons[i];
   nctx->cons[i] = nctx->cons[j];
   nctx->cons[j] = tempi;
   tempsb2 = nctx->s_rowid_ind[i];
   nctx->s_rowid_ind[i] = nctx->s_rowid_ind[j];
   nctx->s_rowid_ind[j] = tempsb2;
   tempub2 = nctx->s_rowid_len[i];
   nctx->s_rowid_len[i] = nctx->s_rowid_len[j];
   nctx->s_rowid_len[j] = tempub2;
   tempub2 = nctx->s_rowid_rcode[i];
   nctx->s_rowid_rcode[i] = nctx->s_rowid_rcode[j];
   nctx->s_rowid_rcode[j] = tempub2;
   tmprid = nctx->s_rowid_ptr[i];
   nctx->s_rowid_ptr[i]= nctx->s_rowid_ptr[j];
   nctx->s_rowid_ptr[j]=tmprid;
   tempsb2 = nctx->i_price_ind[i];
   nctx->i_price_ind[i] = nctx->i_price_ind[j];
   nctx->i_price_ind[j] = tempsb2;
   tempub2 = nctx->i_price_len[i];
   nctx->i_price_len[i] = nctx->i_price_len[j];
   nctx->i_price_len[j] = tempub2;
   tempub2 = nctx->i_price_rcode[i];
   nctx->i_price_rcode[i] = nctx->i_price_rcode[j];
   nctx->i_price_rcode[j] = tempub2;
   tempf = i_price[i];
   i_price[i] = i_price[j];
   i_price[j] = tempf;
   tempsb2 = nctx->i_name_ind[i];
   nctx->i_name_ind[i] = nctx->i_name_ind[j];
   nctx->i_name_ind[j] = tempsb2;
   tempub2 = nctx->i_name_len[i];
   nctx->i_name_len[i] = nctx->i_name_len[j];
   nctx->i_name_len[j] = tempub2;
   tempub2 = nctx->i_name_rcode[i];
   nctx->i_name_rcode[i] = nctx->i_name_rcode[j];
   nctx->i_name_rcode[j] = tempub2;
   strncpy (tempstr, i_name[i], 25);
   strncpy (i_name[i], i_name[j], 25);
   strncpy (i_name[j], tempstr, 25);
   tempsb2 = nctx->i_data_ind[i];
   nctx->i_data_ind[i] = nctx->i_data_ind[j];
   nctx->i_data_ind[j] = tempsb2;
   tempub2 = nctx->i_data_len[i];
   nctx->i_data_len[i] = nctx->i_data_len[j];
   nctx->i_data_len[j] = tempub2;
   tempub2 = nctx->i_data_rcode[i];
   nctx->i_data_rcode[i] = nctx->i_data_rcode[j];
   nctx->i_data_rcode[j] = tempub2;
   strncpy (tempstr, nctx->i_data[i], 51);
   strncpy (nctx->i_data[i], nctx->i_data[j], 51);
   strncpy (nctx->i_data[j], tempstr, 51);
   tempsb2 = nctx->s_quantity_ind[i];
   nctx->s_quantity_ind[i] = nctx->s_quantity_ind[j];
   nctx->s_quantity_ind[j] = tempsb2;
   tempub2 = nctx->s_quantity_len[i];
   nctx->s_quantity_len[i] = nctx->s_quantity_len[j];
   nctx->s_quantity_len[j] = tempub2;
   tempub2 = nctx->s_quantity_rcode[i];
   nctx->s_quantity_rcode[i] = nctx->s_quantity_rcode[j];
   nctx->s_quantity_rcode[j] = tempub2;
   tempi = s_quantity[i];
   s_quantity[i] = s_quantity[j];
   s_quantity[j] = tempi;
   tempsb2 = nctx->s_dist_info_ind[i];
   nctx->s_dist_info_ind[i] = nctx->s_dist_info_ind[j];
   nctx->s_dist_info_ind[j] = tempsb2;
   tempub2 = nctx->s_dist_info_len[i];
   nctx->s_dist_info_len[i] = nctx->s_dist_info_len[j];
   nctx->s_dist_info_len[j] = tempub2;
   tempub2 = nctx->s_dist_info_rcode[i];
   nctx->s_dist_info_rcode[i] = nctx->s_dist_info_rcode[j];
   nctx->s_dist_info_rcode[j] = tempub2;
   strncpy (tempstr, nctx->s_dist_info[i], 25);
   strncpy (nctx->s_dist_info[i], nctx->s_dist_info[j], 25);
   strncpy (nctx->s_dist_info[j], tempstr, 25);
   tempsb2 = nctx->s_data_ind[i];
   nctx->s_data_ind[i] = nctx->s_data_ind[j];
   nctx->s_data_ind[j] = tempsb2;
   tempub2 = nctx->s_data_len[i];
   nctx->s_data_len[i] = nctx->s_data_len[j];
   nctx->s_data_len[j] = tempub2;
   tempub2 = nctx->s_data_rcode[i];
   nctx->s_data_rcode[i] = nctx->s_data_rcode[j];
   nctx->s_data_rcode[j] = tempub2;
   strncpy (tempstr, nctx->s_data[i], 51);
   strncpy (nctx->s_data[i], nctx->s_data[j], 51);
   strncpy (nctx->s_data[j], tempstr, 51);
   return 0;
}
/* the arrays are initialized based on a successful select from */
/* stock/item. We need to shift the values in the orderline array*/
/* one position up to compensate when we have an invalid item */
shiftitemstock (int i, int j, newctx *nctx, OraContext *p)
{
   newtemp *ntemp = &(p->tempvars.new);/* shift up the values for the stock table */
   nctx->s_remote[i] = nctx->s_remote[j];/* shift up the order_line values */
   nctx->nol_i_id_ind[i]=nctx->nol_i_id_ind[j];
   ntemp->nol_i_id[i] = ntemp->nol_i_id[j];
   nctx->nol_quantity_ind[i] = nctx->nol_quantity_ind[j];
   ntemp->nol_quantity[i] = ntemp->nol_quantity[j];
   nctx->nol_supply_w_id_ind [i] = nctx->nol_supply_w_id_ind[j];
   ntemp->nol_supply_w_id[i] = ntemp->nol_supply_w_id[j];
   return 0;
}
int SelItemStk (NewOrderData *pNew,int *pstatus,int retries, int proc_no, newctx *nctx,OraContext *p)
{
   int i, j, rpc3,rcount;
   int errcode;
   int execstatus;
   #ifdef OL_CHECK
      newtemp *ntemp = &(p->tempvars.new);
      for (i = 0; i < MAX_OL; i++) 
      {
          if((TRUE == nctx->nol_supply_w_id_ind[i]) &&( ntemp->nol_supply_w_id[i] > iMaxWareHouses )) 
          {
              TPCCErr( "Bad supply warehouse ol: %d, s_w_id: %d, query:%s",i+1, ntemp->nol_supply_w_id[i],
                      ((EXTENSION_CONTROL_BLOCK *)pNew->pCC)->lpszQueryString );
          }
      }
   #endif
/* array select from item and stock tables */
   execstatus=OCIStmtExecute(p->tpcsvc,(nctx->curn3)[pNew->d_id-1],p->errhp,
                             pNew->o_ol_cnt,0,0,0,OCI_DEFAULT);
   if((execstatus != OCI_SUCCESS) && (execstatus != OCI_NO_DATA)) 
   {
      errcode = OCIERROR(p,execstatus);
      if((errcode == NOT_SERIALIZABLE) || (errcode == RECOVERR))
      {
/* In case of NO_DATA this should NOT return, but simply fall through */
         OCITransRollback(p->tpcsvc,p->errhp,OCI_DEFAULT);
         return (RECOVERR);
      }
      else
      {
          OCITransRollback(p->tpcsvc,p->errhp,OCI_DEFAULT);
          return (IRRECERR);
      }
   }/* mark invalid items */
   OCIAttrGet((nctx->curn3)[pNew->d_id-1],OCI_HTYPE_STMT,&rcount,NULL,OCI_ATTR_ROW_COUNT, p->errhp);
   rpc3 = rcount;
/* the result is in order, so we have to shift up to fill */
/* the slot for the line with the invalid item. */
/* If more than one item is wrong, this is not an simulated */
/* error and we'll blow off */
   if ((*pstatus = pNew->o_ol_cnt - rcount) >1)
   {
      TPCCErr ("TPC-C server %d: more than 1 invalid item?\n",proc_no);
      return (rpc3);
   }
   if (*pstatus == 0) return (rpc3);
/* find the invalid item, transfer the rowid information */
   for (i = 0; i < pNew->o_ol_cnt; i++) 
   {
       if (nctx->cons[i] != i) break; /* this item is invalid */
   }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久成人免费网站| 欧美丰满美乳xxx高潮www| 在线一区二区三区四区| 欧美一区二区播放| 亚洲女同女同女同女同女同69| 美国毛片一区二区| 欧美午夜电影一区| 亚洲欧洲国产日本综合| 久久99蜜桃精品| 欧美日本国产视频| 一区二区视频在线| 不卡电影一区二区三区| 精品国产一二三| 全部av―极品视觉盛宴亚洲| 欧美性大战久久| 亚洲黄一区二区三区| 91香蕉视频mp4| 中文字幕av一区二区三区免费看| 麻豆91在线播放免费| 制服丝袜中文字幕一区| 亚洲国产另类精品专区| 91老师片黄在线观看| 中文字幕一区在线观看视频| 国产一区二区中文字幕| 日韩精品专区在线| 久久精品免费看| 欧美精品第1页| 日韩国产欧美视频| 欧美精品自拍偷拍动漫精品| 性做久久久久久久久| 欧美日韩精品综合在线| 五月婷婷激情综合| 777a∨成人精品桃花网| 日本怡春院一区二区| 91精品国产综合久久久久久久| 偷拍自拍另类欧美| 欧美一卡二卡三卡| 国产毛片精品视频| 国产欧美精品区一区二区三区| 高清日韩电视剧大全免费| 中文在线一区二区| 99在线精品一区二区三区| 国产精品毛片久久久久久久| 91麻豆精品视频| 亚洲午夜视频在线观看| 欧美一卡二卡三卡| 国内外成人在线| 国产精品毛片a∨一区二区三区| 北条麻妃国产九九精品视频| 亚洲黄网站在线观看| 欧美精品vⅰdeose4hd| 老司机午夜精品| 国产精品人妖ts系列视频| 欧美伊人精品成人久久综合97 | 在线免费观看视频一区| 一区二区三区欧美日| 欧美日韩二区三区| 国产一区欧美一区| 亚洲欧美日韩国产综合在线| 欧美日韩aaa| 九九国产精品视频| 国产精品久久国产精麻豆99网站| 色婷婷综合激情| 麻豆精品视频在线| 中文字幕一区二区三区色视频| 欧美日韩五月天| 国产激情视频一区二区三区欧美| 亚洲黄色片在线观看| 精品对白一区国产伦| 91色婷婷久久久久合中文| 日本午夜一区二区| 成人欧美一区二区三区小说| 日韩美女一区二区三区四区| 91丨九色丨尤物| 狠狠色伊人亚洲综合成人| 伊人婷婷欧美激情| 国产日产精品1区| 欧美一区二区三区不卡| 91小视频免费观看| 国产精品一二三四区| 婷婷综合另类小说色区| 国产精品久久毛片av大全日韩| 6080日韩午夜伦伦午夜伦| 99久久久无码国产精品| 日本va欧美va欧美va精品| 亚洲美女淫视频| 国产欧美日韩在线视频| 91精品国产综合久久香蕉麻豆| 色天天综合色天天久久| 国产精品夜夜爽| 青娱乐精品视频在线| 夜夜揉揉日日人人青青一国产精品| 久久先锋影音av| 日韩视频不卡中文| 欧美三级电影网| 欧洲国产伦久久久久久久| 不卡区在线中文字幕| 国产经典欧美精品| 久久国产尿小便嘘嘘尿| 日本不卡视频一二三区| 午夜欧美视频在线观看| 亚洲成人黄色小说| 亚洲高清视频的网址| 亚洲综合久久久| 亚洲日本青草视频在线怡红院| 国产欧美一区二区精品性| 日韩欧美一级二级| 精品国产sm最大网站| 日韩一级片网站| 欧美一区二区高清| 欧美电影免费观看完整版| 欧美一级在线观看| 日韩欧美的一区二区| 日韩三级免费观看| 欧美va在线播放| 欧美r级在线观看| 亚洲精品在线免费观看视频| 久久综合色一综合色88| 精品美女在线播放| 精品国产乱码久久久久久蜜臀| 欧美成人三级在线| 2021国产精品久久精品| 久久久另类综合| 亚洲欧洲av另类| 一区二区在线看| 日日夜夜精品视频免费| 免费人成精品欧美精品| 久久99精品久久久久久久久久久久| 国产在线精品一区在线观看麻豆| 国产精品自拍一区| 丁香婷婷深情五月亚洲| 色8久久人人97超碰香蕉987| 欧美午夜在线一二页| 欧美一区二区三级| 欧美国产综合一区二区| 亚洲欧美激情在线| 五月婷婷激情综合| 国产一区二区91| 91在线精品一区二区| 欧美日韩国产区一| 久久先锋影音av| 亚洲欧美日韩在线| 蜜桃91丨九色丨蝌蚪91桃色| 国产91精品一区二区| 91捆绑美女网站| 欧美成人性福生活免费看| 国产精品进线69影院| 亚洲444eee在线观看| 国内偷窥港台综合视频在线播放| 96av麻豆蜜桃一区二区| 91精品国产入口| 国产精品传媒在线| 男男成人高潮片免费网站| 懂色av一区二区三区免费看| 欧美狂野另类xxxxoooo| 国产精品美女视频| 免费成人美女在线观看| 91女厕偷拍女厕偷拍高清| 日韩精品一区二区在线| 亚洲六月丁香色婷婷综合久久| 美日韩一区二区三区| 91啪亚洲精品| 亚洲国产激情av| 久久电影网站中文字幕| 欧美无乱码久久久免费午夜一区| 国产亚洲福利社区一区| 亚洲国产精品欧美一二99| 丰满亚洲少妇av| 欧美电影免费观看完整版| 亚洲电影一区二区三区| 成人av高清在线| 久久综合九色综合欧美亚洲| 天堂一区二区在线免费观看| 不卡视频在线看| 国产亚洲人成网站| 麻豆精品在线视频| 9191国产精品| 夜夜嗨av一区二区三区 | 免费在线观看日韩欧美| 91毛片在线观看| 中文字幕在线视频一区| 国产呦精品一区二区三区网站| 91超碰这里只有精品国产| 亚洲一区二区精品久久av| 99视频国产精品| 国产欧美一区二区精品性色| 国产一区二区三区| 日韩精品一区二区三区在线观看 | 中日韩av电影| 国产精品一区在线观看你懂的| 日韩久久免费av| 免费在线观看一区| 日韩欧美一区二区不卡| 日本美女一区二区三区| 欧美一区二区三区色| 玖玖九九国产精品| 久久久久久久久久美女| 国产精品66部| 中文字幕av不卡| 一本到三区不卡视频|