[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.133.114.90: ~ $
�
O=�_c
@s!ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	e	j
e	jZd�Z
d�Zdejfd��YZd�Zd�Zd�Zd	�Zd
�Zdejfd��YZd
ejfd��YZedkrejdZeejd�Zeejd�Zeejd�Zeejd�ZejdZ ejdZ!eejd�Z"ejdZ#eejd�Z$eejd�Z%ejda&eejd�Z'eejd�Z(eejd�Z)dZ+gZ,ee-e�j.��Z/e-dt&d �Z0er�e0d!e$IJej1d"e d#e!d$e"d%e#�Z2ee2ee$e0�s�ej3d�ne2j4�ne(re0d&IJeej1d"e d#e!d$e"d%e#�e(�Z+e,j5e+�ne0d'eIJx`e6e�D]RZ7eee7ej1d"e d#e!d$e"d%e#�e/e$e%e'e)�Z8e,j5e8�q&Wer�e0d(IJej9e�ej:e/ej;�ne0d)IJxe,D]Z<e<j=�q�We+re+j(e(kre0d*e(e+j(fIJej3d�ne0d+IJndS(,i����NcCstjt|��j�S(N(thashlibtsha1tstrt	hexdigest(tx((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyRscCs�tj|�|r(tjdd�}ntjdd�}tjdd�dkr�djgt|�D]}tjt�^qe�Stjt�|SdS(Nii�]i�it(trandomtseedtrandinttjointxrangetchoicetCHARS(tdo_blobtidxtblob_lengthR((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pytget_msgs
/tPopulateWorkercBs,eZd�Zd�Zd�Zd�ZRS(cCs�tjj|�||_|jt�tdt|fd�|_||_	||_
||_d|_
tj�|_|j�dS(Ns/%s/populate-%d.logta(t	threadingtThreadt__init__tcont
autocommittFalsetopent
LG_TMP_DIRtlogtnumtstart_idtend_idtNonet	exceptionttimet
start_timetstart(tselfRRRti((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyR"s	
				cCs�z�y|j�|jdIJWn{tk
r�}||_y$|jj�}|jd|�Wn'tjk
r�}|jd|IJnX|jd|IJnXWd|j	�XdS(NtoksINSERT INTO errors VALUES('%s')s!caught while inserting error (%s)scaught (%s)(
trunmeRt	ExceptionR RtcursortexecutetMySQLdbtErrortfinish(R$teR)te2((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pytrun.s
	cCsI|jdtj�|jIJ|jj�|jj�|jj�dS(Nstotal time: %.2f s(RR!R"tcloseRtcommit(R$((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyR-=s

cCs�|jd|jIJ|jj�}d}x�t|j|j�D]r}tt	|�}d|d|dd!|t
|�t|�f}|j|�|ddkr?|jj
�q?q?WdS(Nspopulate thread-%d startedsY
INSERT INTO t1(id,msg_prefix,msg,msg_length,msg_checksum) VALUES (%d,'%s','%s',%d,'%s')
iii�id(RRRR)RR
RRRR
tlenRR*R2(R$tcurtstmtR%tmsg((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyR'Cs0
(t__name__t
__module__RR0R-R'(((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyR s			cCsG|jt�|j�}d}g}|d}d}xbtd�D]T}	ttjdtdt	dt
dt�||||	�}
||7}|j|
�qBWxct||�D]R}	t
||	�}d|	d|dd	!|t|�t|�f}|j|�q�W|j�x6|D].}
|
j�|
jr|d
|
jIJtSqWtS(Ni
ituserthosttporttdbsY
INSERT INTO t1(id,msg_prefix,msg,msg_length,msg_checksum) VALUES (%d,'%s','%s',%d,'%s')
ii�s%populater thead %d threw an exception(RRR)RR
RR+tconnectR9R:R;R<tappendRR3RR*R2R	R RtTrue(Rtnum_records_beforeR
RR4R5tworkerstNRR%twR6((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pytpopulate_tablePs,

$
0


	cCs*d|dd!|t|�t|�|fS(NsS
UPDATE t1 SET msg_prefix='%s',msg='%s',msg_length=%d,msg_checksum='%s' WHERE id=%dii�(R3R(R6R((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyt
get_updatemscCs*d|dd!|t|�t|�|fS(Ns�
INSERT INTO t1 (msg_prefix,msg,msg_length,msg_checksum,id) VALUES ('%s','%s',%d,'%s',%d)
ON DUPLICATE KEY UPDATE
msg_prefix=VALUES(msg_prefix),
msg=VALUES(msg),
msg_length=VALUES(msg_length),
msg_checksum=VALUES(msg_checksum),
id=VALUES(id)ii�(R3R(R6R((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pytget_insert_on_duprscCs*d|dd!|t|�t|�|fS(NsY
INSERT INTO t1 (msg_prefix,msg,msg_length,msg_checksum,id) VALUES ('%s','%s',%d,'%s',%d)ii�(R3R(R6R((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyt
get_insert}scCs'd|dd!|t|�t|�fS(Ns[
INSERT INTO t1 (msg_prefix,msg,msg_length,msg_checksum,id) VALUES ('%s','%s',%d,'%s',NULL)ii�(R3R(R6((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pytget_insert_null�stChecksumWorkercBs,eZd�Zd�Zd�Zd�ZRS(cCsdtjj|�||_|jt�tdtd�|_||_	|jd|IJ|j
�dS(Ns/%s/worker-checksum.logRsgiven checksum=%d(RRRRRRRRRtchecksumR#(R$RRJ((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyR�s	
	cCs�z�y|j�|jdIJWn|tk
r�}y.|jj�}|jd|�tj�Wn'tjk
r�}|jd|IJnX|jd|IJnXWd|j	�XdS(NR&sINSERT INTO errors VALUES('%s')s!caught while inserting error (%s)scaught (%s)(
R'RR(RR)R*R2R+R,R-(R$R.R)R/((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyR0�s
cCs<|jdtj�|jIJ|jj�|jj�dS(Nstotal time: %.2f s(RR!R"R1R(R$((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyR-�s
cCs�|jdIJtj�|_|jj�}|jd�|jd�|j�d}|jj�||jkr�|jd|j|fIJ||_n|jd|IJdS(Nschecksum thread startedsSET SESSION innodb_lra_size=16sCHECKSUM TABLE t1isAchecksums do not match. given checksum=%d, calculated checksum=%dschecksums match! (both are %d)(	RR!R"RR)R*tfetchoneR2RJ(R$R4RJ((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyR'�s



(R7R8RR0R-R'(((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyRI�s				tWorkercBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(c	
Cstjj|�||_||_|jt�||_||_|jj	�}	t
j�|_|jj
||�d|_||_d|_d|_d|_d|_d|_d|_d|_tdt|jfd�|_|r�|	jd�n||_|j�dS(Nis/%s/worker%02d.logRsSET innodb_fake_changes=1(RRRR
txidRRRtnum_xactionsR)RtRandomtrandRtloop_numtmax_idtnum_primary_selecttnum_secondary_selecttnum_secondary_only_selecttnum_insertstnum_deletestnum_updatest
time_spentRRRR*tsecondary_checksR#(
R$RNRMRt
server_pidR
RRtfake_changesRZR4((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyR�s.		
												cCs�|jd|jtj�|j|jfIJ|jd|j|j|jfIJ|jd|j|j	|j
|jfIJ|jj�dS(Nsloop_num:%d, total time: %.2f ssJnum_primary_select=%d,num_secondary_select=%d,num_secondary_only_select=%ds:num_inserts=%d,num_updates=%d,num_deletes=%d,time_spent=%d(RRQR!R"RYRSRTRURVRXRWR1(R$((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyR-�s
$

cCs�||dd!k}t|�}||k}t|�|k}	|sR|sR|	r�d||	t|�|||||||dd!f
}
|j|
IJ|jj�}|jd|
�|jd�td��n|jd||fIJdS(Nii�s=id(%d), length(%s,%d,%d), checksum(%s,%s,%s) prefix(%s,%s,%s)sINSERT INTO errors VALUES('%s')tCOMMITsvalidate_msg faileds#Validated for length(%d) and id(%d)(RR3RRR)R*R((R$t
msg_prefixR6t
msg_lengthtmsg_checksumRtprefix_matchRJtchecksum_matcht	len_matchterrmsgR)((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pytvalidate_msg�s 	

cCs)x"|D]}|d|krtSqWtS(Ni(R?R(R$t	res_arrayRtres((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pytcheck_exists�s
cCs�z�y"|j�|jd|jIJWntk
r�}y1|jj�}|jd|�|jd�Wn'tjk
r�}|jd|IJnX|jd|IJnXWd|j	�XdS(Nsok, with do_blob %ssINSERT INTO errors VALUES('%s')R]s!caught while inserting error (%s)scaught (%s)(
R'RR
R(RR)R*R+R,R-(R$R.R)R/((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyR0�s
c	Cs�tj�|_|jj�}|jd|j|j|jfIJx:|js`|j|jkr}|jj	d|j
�}|jj	dd�}|jd7_|jj	dd�dkr�|jd�nyXd}t
|j|�}|jj	dd�}|dkr2|jd	|�|j�}|jd7_nx|d
krt|jd|dd!�|j�}|jd7_n6|jd
|dd!�|j�}|jd7_wD|r�|j|d|d|d|d|�nt}|r�|r<|jj	dd�rt||�}nt||�}t}|jd7_q�|jj	dd�}|dkrut||�}t}n0|dkr�t||�}t}nt|�}|jd7_nd|}|jd7_|j|�}	|jr�|jj	dd�dkr�|jd
|dd!�|j�}
|rg|r�|j|
|�sd|jdIJt d��qdq�q�|j|
|�r�|jdIJt d��q�n|jddkr�|jd|j|j|	|fIJn|jj	dd�}|dkr|jj!�n|dkr|jj"�nWqDt#j$k
ry}|j%ddkr_|jd|jIJdS|jd||fIJqDXqDWy|jj!�Wn$t k
r�}|jd|IJnXdS(Ns$thread %d started, run from %d to %diiiis`SET GLOBAL innodb_prefix_index_cluster_optimization=1-@@innodb_prefix_index_cluster_optimizationi
isASELECT msg_prefix,msg,msg_length,msg_checksum FROM t1 WHERE id=%di	sKSELECT msg_prefix,msg,msg_length,msg_checksum FROM t1 WHERE msg_prefix='%s'i�s3SELECT id, msg_prefix FROM t1 WHERE msg_prefix='%s'isDELETE FROM t1 WHERE id=%ds4Error: Inserted row doesn't exist in secondary indexs2Error: Deleted row still exists in secondary indexids$Thread %d loop_num %d: result %d: %sii�smysqld down, transaction %dsmysql error for stmt(%s) %sscommit error %s(&R!R"RR)RRMRQRNRPRRRR*RRR
RKRSRTtfetchallRUReRRERFR?RXRGRHRVRWRZRhR(R2trollbackR+R,targs(R$R4Rtinsert_or_updateR5R6trRgtinsert_with_indextquery_resultRfR.((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyR's�
,		
$

	
(R7R8RR-ReRhR0R'(((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyRL�s						t__main__iiiiiiiii	i
iii
iis/%s/main.logRspopulate table do_blob is %dR9R:R;R<sstart the checksum threadsstart %d threadsskill mysqldswait for threadssAchecksums do not match. given checksum=%d, calculated checksum=%dsall threads done(>t	cStringIORR+tosRtsignaltsysRR!tstringtletterstdigitsRRRRRRDRERFRGRHRIRLR7targvtpid_filetintt
kill_db_afterR@tnum_workerstnum_xactions_per_workerR9R:R;R<R
RRRR\RJRZRtchecksum_workerRARtreadR[RR=RtexitR1R>R
R%tworkertsleeptkilltSIGKILLRCR	(((s=/usr/share/mysql-test/suite/innodb_stress/t/load_generator.pyt<module>s�		0					/�




$

-	!





Filemanager

Name Type Size Permission Actions
.load_generator.pyo.40009 File 14.52 KB 0644
Readme File 269 B 0644
innodb_bigstress-master.opt File 143 B 0644
innodb_bigstress-slave.opt File 88 B 0644
innodb_bigstress.test File 1011 B 0644
innodb_bigstress_blob-master.opt File 143 B 0644
innodb_bigstress_blob-slave.opt File 88 B 0644
innodb_bigstress_blob.test File 1008 B 0644
innodb_bigstress_blob_nocompress-master.opt File 143 B 0644
innodb_bigstress_blob_nocompress-slave.opt File 88 B 0644
innodb_bigstress_blob_nocompress.test File 969 B 0644
innodb_bigstress_crash-master.opt File 143 B 0644
innodb_bigstress_crash-slave.opt File 88 B 0644
innodb_bigstress_crash.test File 1010 B 0644
innodb_bigstress_crash_blob-master.opt File 143 B 0644
innodb_bigstress_crash_blob-slave.opt File 88 B 0644
innodb_bigstress_crash_blob.test File 1007 B 0644
innodb_bigstress_crash_blob_nocompress-master.opt File 143 B 0644
innodb_bigstress_crash_blob_nocompress-slave.opt File 88 B 0644
innodb_bigstress_crash_blob_nocompress.test File 967 B 0644
innodb_bigstress_crash_nocompress-master.opt File 143 B 0644
innodb_bigstress_crash_nocompress-slave.opt File 88 B 0644
innodb_bigstress_crash_nocompress.test File 973 B 0644
innodb_bigstress_nocompress-master.opt File 143 B 0644
innodb_bigstress_nocompress-slave.opt File 88 B 0644
innodb_bigstress_nocompress.test File 971 B 0644
innodb_hugestress-master.opt File 143 B 0644
innodb_hugestress-slave.opt File 88 B 0644
innodb_hugestress.test File 1.06 KB 0644
innodb_hugestress_blob-master.opt File 143 B 0644
innodb_hugestress_blob-slave.opt File 88 B 0644
innodb_hugestress_blob.test File 1.06 KB 0644
innodb_hugestress_blob_nocompress-master.opt File 143 B 0644
innodb_hugestress_blob_nocompress-slave.opt File 88 B 0644
innodb_hugestress_blob_nocompress.test File 1.02 KB 0644
innodb_hugestress_crash-master.opt File 143 B 0644
innodb_hugestress_crash-slave.opt File 88 B 0644
innodb_hugestress_crash.test File 1014 B 0644
innodb_hugestress_crash_blob-master.opt File 143 B 0644
innodb_hugestress_crash_blob-slave.opt File 88 B 0644
innodb_hugestress_crash_blob.test File 1011 B 0644
innodb_hugestress_crash_blob_nocompress-master.opt File 143 B 0644
innodb_hugestress_crash_blob_nocompress-slave.opt File 88 B 0644
innodb_hugestress_crash_blob_nocompress.test File 971 B 0644
innodb_hugestress_crash_nocompress-master.opt File 143 B 0644
innodb_hugestress_crash_nocompress-slave.opt File 88 B 0644
innodb_hugestress_crash_nocompress.test File 974 B 0644
innodb_hugestress_nocompress-master.opt File 143 B 0644
innodb_hugestress_nocompress-slave.opt File 88 B 0644
innodb_hugestress_nocompress.test File 1.02 KB 0644
innodb_stress-master.opt File 112 B 0644
innodb_stress-slave.opt File 57 B 0644
innodb_stress.test File 978 B 0644
innodb_stress_blob-master.opt File 112 B 0644
innodb_stress_blob-slave.opt File 57 B 0644
innodb_stress_blob.test File 975 B 0644
innodb_stress_blob_nocompress-master.opt File 112 B 0644
innodb_stress_blob_nocompress-slave.opt File 57 B 0644
innodb_stress_blob_nocompress.test File 936 B 0644
innodb_stress_crash-master.opt File 112 B 0644
innodb_stress_crash-slave.opt File 57 B 0644
innodb_stress_crash.test File 1.05 KB 0644
innodb_stress_crash_blob-master.opt File 112 B 0644
innodb_stress_crash_blob-slave.opt File 57 B 0644
innodb_stress_crash_blob.test File 1.04 KB 0644
innodb_stress_crash_blob_nocompress-master.opt File 112 B 0644
innodb_stress_crash_blob_nocompress-slave.opt File 57 B 0644
innodb_stress_crash_blob_nocompress.test File 1 KB 0644
innodb_stress_crash_nocompress-master.opt File 112 B 0644
innodb_stress_crash_nocompress-slave.opt File 57 B 0644
innodb_stress_crash_nocompress.test File 1.01 KB 0644
innodb_stress_nocompress-master.opt File 112 B 0644
innodb_stress_nocompress-slave.opt File 57 B 0644
innodb_stress_nocompress.test File 938 B 0644
load_generator.py File 14.05 KB 0644
load_generator.pyc File 14.52 KB 0644
load_generator.pyo File 14.52 KB 0644