Ejemplo n.º 1
0
        public byte[] getXyz(int storage_id, SqlConnection conn)
        {
            object ret = BingoSqlUtils.ExecObjQuery(conn, "SELECT xyz from {0} where storage_id={1}",
                                                    shadowTable, storage_id);

            return((byte[])ret);
        }
Ejemplo n.º 2
0
        private void _getBitChunk(Block block, int bit_index, SqlConnection conn, ref byte[] chunk)
        {
            BingoTimer timer = new BingoTimer("fingerprints.read");

            if (block.bits != null)
            {
                Buffer.BlockCopy(block.bits[bit_index], 0, chunk, 0, chunk.Length);
            }
            else
            {
                chunk = (byte[])BingoSqlUtils.ExecObjQuery(conn,
                                                           "SELECT bits_chunk from {0} where part = {1} and bit = {2}",
                                                           _index_data.fingerprintBitsTable, block.part, bit_index);
            }
            timer.end();
        }
Ejemplo n.º 3
0
        public static void DropAllIndices(SqlConnection conn, string bingo_schema, bool only_invalid)
        {
            List <TableWithId> tables = new List <TableWithId>();

            using (SqlCommand cmd = new SqlCommand(String.Format(
                                                       "SELECT full_table_name, obj_id FROM {0}",
                                                       _contextTable(bingo_schema)), conn))
            {
                cmd.CommandTimeout = 3600;
                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        string full_table_name = Convert.ToString(reader[0]);
                        int    table_id        = Convert.ToInt32(reader[1]);
                        tables.Add(new TableWithId()
                        {
                            table_name = full_table_name, id = table_id
                        });
                    }
                }
            }

            foreach (TableWithId table in tables)
            {
                if (only_invalid)
                {
                    object ret = BingoSqlUtils.ExecObjQuery(conn, "SELECT OBJECT_NAME({0})", table.id);
                    if (ret != null)
                    {
                        continue;
                    }
                }
                DropIndexData(conn, bingo_schema, table.table_name, false);
            }
        }