IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20017


Ignore:
Timestamp:
Oct 9, 2008, 10:23:30 AM (18 years ago)
Author:
jhoblitt
Message:

use a temp table instead of a view in getmountedvol()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm

    r19959 r20017  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: SQL.pm,v 1.66 2008-10-07 21:53:21 jhoblitt Exp $
     3# $Id: SQL.pm,v 1.67 2008-10-09 20:23:30 jhoblitt Exp $
    44
    55package Nebulous::Server::SQL;
     
    498498    DECLARE xattrvar BOOLEAN;
    499499    DECLARE trans_level VARCHAR(255);
    500     DECLARE cur1 CURSOR FOR SELECT vol_id, name, host, path, allocate, available, xattr FROM v;
     500    DECLARE cur1 CURSOR FOR SELECT vol_id, name, host, path, allocate, available, xattr FROM myvolume;
    501501    DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = TRUE;
    502502
    503     CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW v AS SELECT * FROM volume;
     503--   SET FOREIGN_KEY_CHECKS=0;
     504
     505    CREATE TEMPORARY TABLE myvolume LIKE volume;
     506
    504507    -- store the current transaction level
    505508--    SELECT @@session.tx_isolation INTO trans_level;
    506 
    507509    -- set trans level to repeatable-read so the volume table does not change
    508510    -- out from under our cursor
     
    534536--    SET @@session.tx_isolation = trans_level;
    535537
    536     DROP VIEW v;
     538    DROP TABLE IF EXISTS myvolume;
     539
     540--    SET FOREIGN_KEY_CHECKS=1;
     541
    537542    COMMIT;
    538543END
Note: See TracChangeset for help on using the changeset viewer.