@@ -1051,7 +1051,7 @@ describe('17. extendedMetaData.js', function() {
1051
1051
1052
1052
} ) ;
1053
1053
1054
- it ( '17.3.27 TIMESTAMP (9 ) WITH TIME ZONE' , function ( done ) {
1054
+ it ( '17.3.27 TIMESTAMP (2 ) WITH TIME ZONE' , function ( done ) {
1055
1055
1056
1056
connection . execute (
1057
1057
"SELECT ts4 FROM nodb_metadata" ,
@@ -1156,7 +1156,7 @@ describe('17. extendedMetaData.js', function() {
1156
1156
it ( '17.3.33 UROWID' , function ( done ) {
1157
1157
1158
1158
connection . execute (
1159
- "SELECT rid FROM nodb_metadata" ,
1159
+ "SELECT urid FROM nodb_metadata" ,
1160
1160
[ ] ,
1161
1161
{ extendedMetaData : true } ,
1162
1162
function ( err , result ) {
@@ -1246,12 +1246,18 @@ describe('17. extendedMetaData.js', function() {
1246
1246
it ( '17.3.38 RAW(2000)' , function ( done ) {
1247
1247
1248
1248
connection . execute (
1249
- "SELECT mybfile FROM nodb_metadata" ,
1249
+ "SELECT myraw FROM nodb_metadata" ,
1250
1250
[ ] ,
1251
1251
{ extendedMetaData : true } ,
1252
1252
function ( err , result ) {
1253
- ( err . message ) . should . startWith ( 'NJS-010:' ) ;
1254
- // NJS-010: unsupported data type in select list
1253
+ should . not . exist ( err ) ;
1254
+ ( result . metaData ) . should . deepEqual (
1255
+ [ { name : 'MYRAW' ,
1256
+ fetchType : oracledb . BUFFER ,
1257
+ dbType : oracledb . DB_TYPE_RAW ,
1258
+ byteSize : 2000 ,
1259
+ nullable : true } ]
1260
+ ) ;
1255
1261
done ( ) ;
1256
1262
}
1257
1263
) ;
@@ -1325,7 +1331,7 @@ describe('17. extendedMetaData.js', function() {
1325
1331
1326
1332
async . series ( [
1327
1333
function ( cb ) {
1328
- var proc = "CREATE OR REPLACE PROCEDURE get_rc (p_out OUT SYS_REFCURSOR) \n" +
1334
+ var proc = "CREATE OR REPLACE PROCEDURE get_emd_rc (p_out OUT SYS_REFCURSOR) \n" +
1329
1335
"AS \n" +
1330
1336
"BEGIN \n" +
1331
1337
" OPEN p_out FOR \n" +
@@ -1342,7 +1348,7 @@ describe('17. extendedMetaData.js', function() {
1342
1348
} ,
1343
1349
function ( cb ) {
1344
1350
connection . execute (
1345
- "BEGIN get_rc (:out); END;" ,
1351
+ "BEGIN get_emd_rc (:out); END;" ,
1346
1352
{
1347
1353
out : { type : oracledb . CURSOR , dir : oracledb . BIND_OUT }
1348
1354
} ,
@@ -1356,7 +1362,7 @@ describe('17. extendedMetaData.js', function() {
1356
1362
} ,
1357
1363
function ( cb ) {
1358
1364
connection . execute (
1359
- "DROP PROCEDURE get_rc " ,
1365
+ "DROP PROCEDURE get_emd_rc " ,
1360
1366
function ( err ) {
1361
1367
should . not . exist ( err ) ;
1362
1368
cb ( ) ;
@@ -1438,13 +1444,12 @@ describe('17. extendedMetaData.js', function() {
1438
1444
1439
1445
it ( "17.6.2 oracledb.fetchAsString" , function ( done ) {
1440
1446
1441
- var defaultValue = oracledb . fetchAsString ;
1442
1447
async . series ( [
1443
- function ( cb ) {
1448
+ function change ( cb ) {
1444
1449
oracledb . fetchAsString = [ oracledb . DATE , oracledb . NUMBER ] ;
1445
1450
cb ( ) ;
1446
1451
} ,
1447
- function ( cb ) {
1452
+ function test ( cb ) {
1448
1453
connection . execute (
1449
1454
"SELECT * FROM nodb_md" ,
1450
1455
[ ] ,
@@ -1470,37 +1475,31 @@ describe('17. extendedMetaData.js', function() {
1470
1475
cb ( ) ;
1471
1476
}
1472
1477
) ;
1473
- } ,
1474
- function ( cb ) {
1475
- oracledb . fetchAsString = [ ] ;
1476
- ( oracledb . fetchAsString ) . should . eql ( defaultValue ) ;
1477
- cb ( ) ;
1478
1478
}
1479
- ] , done ) ;
1479
+ ] , function ( err ) {
1480
+ should . not . exist ( err ) ;
1481
+ var defaultValue = [ ] ;
1482
+ oracledb . fetchAsString = defaultValue ;
1483
+ done ( ) ;
1484
+ } ) ;
1485
+
1480
1486
} ) ; // 17.6.2
1481
1487
1482
1488
it ( "17.6.3 can override at execution" , function ( done ) {
1483
1489
1484
- var defaultValue = oracledb . fetchAsString ;
1485
1490
async . series ( [
1486
- function ( cb ) {
1491
+ function change ( cb ) {
1487
1492
oracledb . fetchAsString = [ oracledb . DATE , oracledb . NUMBER ] ;
1488
1493
cb ( ) ;
1489
1494
} ,
1490
- function ( cb ) {
1495
+ function test ( cb ) {
1491
1496
connection . execute (
1492
1497
"SELECT * FROM nodb_md" ,
1493
1498
[ ] ,
1494
- { outFormat : oracledb . OBJECT ,
1495
- extendedMetaData : true ,
1496
- fetchInfo :
1497
- {
1498
- "DT" : { type : oracledb . DEFAULT }
1499
- }
1500
- } ,
1499
+ { outFormat : oracledb . OBJECT , extendedMetaData : true } ,
1501
1500
function ( err , result ) {
1502
1501
should . not . exist ( err ) ;
1503
- ( result . rows [ 0 ] ) . DT . should . be . a . Date ( ) ;
1502
+ ( result . rows [ 0 ] ) . DT . should . be . a . String ( ) ;
1504
1503
( result . rows [ 0 ] ) . NUM . should . be . a . String ( ) ;
1505
1504
( result . metaData ) . should . deepEqual ( [
1506
1505
{ name : 'NUM' ,
@@ -1514,18 +1513,18 @@ describe('17. extendedMetaData.js', function() {
1514
1513
dbType : oracledb . DB_TYPE_VARCHAR ,
1515
1514
byteSize : 1000 ,
1516
1515
nullable : true } ,
1517
- { name : 'DT' , fetchType : oracledb . DATE , dbType : oracledb . DB_TYPE_DATE , nullable : true }
1516
+ { name : 'DT' , fetchType : oracledb . STRING , dbType : oracledb . DB_TYPE_DATE , nullable : true }
1518
1517
] ) ;
1519
1518
cb ( ) ;
1520
1519
}
1521
1520
) ;
1522
- } ,
1523
- function ( cb ) {
1524
- oracledb . fetchAsString = [ ] ;
1525
- ( oracledb . fetchAsString ) . should . eql ( defaultValue ) ;
1526
- cb ( ) ;
1527
1521
}
1528
- ] , done ) ;
1522
+ ] , function ( err ) {
1523
+ var defaultValue = [ ] ;
1524
+ oracledb . fetchAsString = defaultValue ;
1525
+ done ( ) ;
1526
+ } ) ;
1527
+
1529
1528
} ) ; // 17.6.3
1530
1529
1531
1530
} ) ; // 17.6
@@ -1564,13 +1563,13 @@ describe('17. extendedMetaData.js', function() {
1564
1563
" e_table_missing EXCEPTION; \n" +
1565
1564
" PRAGMA EXCEPTION_INIT(e_table_missing, -00942);\n " +
1566
1565
" BEGIN \n" +
1567
- " EXECUTE IMMEDIATE ('DROP TABLE nodb_casesensitive '); \n" +
1566
+ " EXECUTE IMMEDIATE ('DROP TABLE nodb_md_casesensitive '); \n" +
1568
1567
" EXCEPTION \n" +
1569
1568
" WHEN e_table_missing \n" +
1570
1569
" THEN NULL; \n" +
1571
1570
" END; \n" +
1572
1571
" EXECUTE IMMEDIATE (' \n" +
1573
- " CREATE TABLE nodb_casesensitive ( \n" +
1572
+ " CREATE TABLE nodb_md_casesensitive ( \n" +
1574
1573
" id NUMBER, \n" +
1575
1574
' "nAme" VARCHAR2(20) \n' +
1576
1575
" ) \n" +
@@ -1587,7 +1586,7 @@ describe('17. extendedMetaData.js', function() {
1587
1586
} ,
1588
1587
function ( callback ) {
1589
1588
connection . execute (
1590
- "SELECT * FROM nodb_casesensitive " ,
1589
+ "SELECT * FROM nodb_md_casesensitive " ,
1591
1590
[ ] ,
1592
1591
{ extendedMetaData : true } ,
1593
1592
function ( err , result ) {
@@ -1613,7 +1612,7 @@ describe('17. extendedMetaData.js', function() {
1613
1612
} ,
1614
1613
function ( callback ) {
1615
1614
connection . execute (
1616
- "DROP TABLE nodb_casesensitive " ,
1615
+ "DROP TABLE nodb_md_casesensitive " ,
1617
1616
function ( err ) {
1618
1617
should . not . exist ( err ) ;
1619
1618
callback ( ) ;
@@ -1630,7 +1629,7 @@ describe('17. extendedMetaData.js', function() {
1630
1629
1631
1630
it ( "17.9.1 works with column names comprised of single character" , function ( done ) {
1632
1631
1633
- var tableName = "nodb_single_char " ;
1632
+ var tableName = "nodb_md_singlechar " ;
1634
1633
var sqlCreate =
1635
1634
"BEGIN \n" +
1636
1635
" DECLARE \n" +
@@ -1746,15 +1745,31 @@ describe('17. extendedMetaData.js', function() {
1746
1745
return buffer . join ( ) ;
1747
1746
}
1748
1747
1749
- var table_name = "nodb_large_columns" ;
1750
- var sqlCreate = "CREATE TABLE " + table_name + " ( " + columns_string + " )" ;
1748
+ var table_name = "nodb_md_largecolumns" ;
1751
1749
var sqlSelect = "SELECT * FROM " + table_name ;
1752
1750
var sqlDrop = "DROP TABLE " + table_name ;
1753
1751
1752
+ var proc = "BEGIN \n" +
1753
+ " DECLARE \n" +
1754
+ " e_table_missing EXCEPTION; \n" +
1755
+ " PRAGMA EXCEPTION_INIT(e_table_missing, -00942);\n " +
1756
+ " BEGIN \n" +
1757
+ " EXECUTE IMMEDIATE ('DROP TABLE nodb_md_largecolumns'); \n" +
1758
+ " EXCEPTION \n" +
1759
+ " WHEN e_table_missing \n" +
1760
+ " THEN NULL; \n" +
1761
+ " END; \n" +
1762
+ " EXECUTE IMMEDIATE (' \n" +
1763
+ " CREATE TABLE nodb_md_largecolumns ( \n" +
1764
+ columns_string +
1765
+ " ) \n" +
1766
+ " '); \n" +
1767
+ "END; " ;
1768
+
1754
1769
async . series ( [
1755
1770
function ( callback ) {
1756
1771
connection . execute (
1757
- sqlCreate ,
1772
+ proc ,
1758
1773
function ( err ) {
1759
1774
should . not . exist ( err ) ;
1760
1775
callback ( ) ;
0 commit comments