(t *testing.T)
| 136 | } |
| 137 | |
| 138 | func TestCursorFetchExecuteCheck(t *testing.T) { |
| 139 | store, dom := testkit.CreateMockStoreAndDomain(t) |
| 140 | srv := server2.CreateMockServer(t, store) |
| 141 | srv.SetDomain(dom) |
| 142 | defer srv.Close() |
| 143 | |
| 144 | appendUint32 := binary.LittleEndian.AppendUint32 |
| 145 | ctx := context.Background() |
| 146 | c := server2.CreateMockConn(t, srv) |
| 147 | |
| 148 | stmt, _, _, err := c.Context().Prepare("select 1") |
| 149 | require.NoError(t, err) |
| 150 | |
| 151 | // execute with wrong ID |
| 152 | require.Error(t, c.Dispatch(ctx, append( |
| 153 | appendUint32([]byte{tmysql.ComStmtExecute}, uint32(stmt.ID()+1)), |
| 154 | tmysql.CursorTypeReadOnly, 0x1, 0x0, 0x0, 0x0, |
| 155 | ))) |
| 156 | |
| 157 | // execute with wrong flag |
| 158 | require.Error(t, c.Dispatch(ctx, append( |
| 159 | appendUint32([]byte{tmysql.ComStmtExecute}, uint32(stmt.ID())), |
| 160 | tmysql.CursorTypeReadOnly|tmysql.CursorTypeForUpdate, 0x1, 0x0, 0x0, 0x0, |
| 161 | ))) |
| 162 | |
| 163 | require.Error(t, c.Dispatch(ctx, append( |
| 164 | appendUint32([]byte{tmysql.ComStmtExecute}, uint32(stmt.ID())), |
| 165 | tmysql.CursorTypeReadOnly|tmysql.CursorTypeScrollable, 0x1, 0x0, 0x0, 0x0, |
| 166 | ))) |
| 167 | } |
| 168 | |
| 169 | func TestConcurrentExecuteAndFetch(t *testing.T) { |
| 170 | runTestConcurrentExecuteAndFetch(t, false) |
nothing calls this directly
no test coverage detected